﻿/*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>');
}
/*IE6下Png透明显示*/
function isIE(){
if (navigator.appName!="Microsoft Internet Explorer") {return false}
return true
} 
function correctPNG()
{
   for(var i=0; i<document.images.length; i++)
   {
   var img = document.images[i]
   var LW=img.width
   var LH=img.height
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
   { 
         img.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+img.src+", sizingmethod=scale);"
         img.src="../images/blank.gif"
         img.width=LW
         img.height=LH
   }
   }
}
if (isIE()) {window.attachEvent("onload", correctPNG);}

/*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();
 }
}
