function setImgSizeWH(theURL,sImage,imgW,imgH){
var imgObj;
imgObj=new Image();
imgObj.src=theURL;
  if((imgObj.width!=0)&&(imgObj.height!=0)){
    if(imgObj.width>imgW||imgObj.height>imgH){
      var iHeight=imgObj.height*imgW/imgObj.width;
      if(iHeight<=imgH){
        sImage.width=imgW;
        sImage.height=iHeight;
     }else{
        var iWidth=imgObj.width*imgH/imgObj.height;
        sImage.width=iWidth;sImage.height=imgH;
     }
    }else{
      sImage.width=imgObj.width;sImage.height=imgObj.height;
    }
  }else{
    sImage.width=imgW;sImage.height=imgH;
  }
}


function lookImg(){
var posX,posY;
if (window.innerHeight) {
posX = window.pageXOffset;
posY = window.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop) {
posX = document.documentElement.scrollLeft;
posY = document.documentElement.scrollTop;
}
else if (document.body) {
posX = document.body.scrollLeft;
posY = document.body.scrollTop;
}
var ad=document.getElementById("ad");
//ad.style.top=(posY+(screen.height-760)/2)+"px";
//ad.style.left=(posX+(screen.width-780)/2)+"px";

ad.style.top="400 px";
ad.style.left=(posX+(screen.width-780)/2)+"px";
setTimeout("lookImg()",100);
}


function strphoto(str,sta){
  if(str=="A"){
   ad.style.display ="block";
   if(sta==undefined){
     ad.style.display = "none";
     alert("链接错误!");
   }else{ 
    imgview.innerHTML="<img Class=BigMoveImg src='"+sta+"'>";
   }
  }else{ 
    ad.style.display = "none";
  }
}



function bookmarkit(){
    window.external.addFavorite('http://www.miaojia.net','河南省焦作市妙佳日用品有限公司')
}


function flash_ad(stra,strb){

var focus_width=320;
var focus_height=240;
var swf_height = focus_height;
var pics=stra;
var links=strb;


document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/pix.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'">');
document.write('<embed src="images/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');

}


function flash_adi(stra,strb){

var focus_width=245;
var focus_height=186;
var swf_height = focus_height;
var pics=stra;
var links=strb;


document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/pix.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'">');
document.write('<embed src="images/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');

}
