﻿/*IE下控件虚线框清除*/
function flash(url,width,height,var1) {
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0" width="'+width+'" height="'+height+'">');
    document.write('<param name="movie" value="'+url+'" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="flashVars" value="id='+var1+'" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<param name="menu" value="false" />');
    document.write('<embed flashvars="id='+var1+'" src="'+url+'" wmode="transparent" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
    document.write('</object>');
}
/*FF下连续长字段自动换行*/
function toBreakWord(intLen){
var obj=document.getElementById("ff");
var strContent=obj.innerHTML;
var strTemp="";
while(strContent.length>intLen){
strTemp+=strContent.substr(0,intLen)+"&#10;";
strContent=strContent.substr(intLen,strContent.length);
}
strTemp+="&#10;"+strContent;
obj.innerHTML=strTemp;
}
if(document.getElementById  &&  !document.all)  toBreakWord(37)

/*通用加入收藏夹代码  <a href="javascript:favorites()">加入收藏</a>*/
function favorites(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}
/*自动弹出大图*/
var imgObj;
function checkImg(theURL,winName){
 if (typeof(imgObj) == "object"){
  if ((imgObj.width != 0) && (imgObj.height != 0))
   OpenPic(theURL,winName, imgObj.width,imgObj.height);
  else
   setTimeout("checkImg('" + theURL + "','" + winName + "')", 100)
 }
}

function OpenPic(theURL,winName,width,height) {
 var aNewWin, sBaseCmd;
 sBaseCmd = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2)+",";
 if (width == null || width == ""){
  imgObj = new Image();
  imgObj.src = theURL;
  checkImg(theURL, winName)
 }else{
  newwin=window.open('about:blank','',sBaseCmd+'width='+width+',height='+height);
  newwin.document.write('<body leftmargin=0 topmargin=0><img id="img1" src='+theURL+'>'); 
  newwin.focus();
 }
}
//二级横向菜单JS
/*
function menuCedar() {
var sfEl = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEl.length; i++) {
    sfEl[i].onmouseover=function() {
    this.className+=(this.className.length>0? " ": "") + "sfhover";
    }
    sfEl[i].onMouseDown=function() {
    this.className+=(this.className.length>0? " ": "") + "sfhover";
    }
    sfEl[i].onMouseUp=function() {
    this.className+=(this.className.length>0? " ": "") + "sfhover";
    }
    sfEl[i].onmouseout=function() {
    this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),

"");
    }
}
}
window.onload=menuCedar;
*/
/*document.oncontextmenu=new Function("event.returnValue=false;"); //禁止右键功能,单击右键将无任何反应 
document.onselectstart=new Function("event.returnValue=false;"); //禁止先择,也就是无法复制 */