//首页专家图片框架控制
function HomeExpertPic(){
var a1=document.getElementById('HomeExpertPic');
a1.height=120;
a1.src="info/homeExpertPic.asp";
}

function checkimgW(t,s){
  if(t.width>s)t.width=s;
  t.style.border="1px solid #663300";
  t.vspace=8;
  t.hspace=2;
}

//图片按比例缩放#1
var flag=false; 
function DrawImage(ImgD,iwidth,iheight){ 
 var image=new Image(); 
// var iwidth = 120;  //定义允许图片宽度 
// var iheight = 180;  //定义允许图片高度
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
 flag=true; 
 if(image.width/image.height>= iwidth/iheight){ 
  if(image.width>iwidth){   
  ImgD.width=iwidth; 
  ImgD.height=(image.height*iwidth)/image.width; 
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  } 
 else{ 
  if(image.height>iheight){   
  ImgD.height=iheight; 
  ImgD.width=(image.width*iheight)/image.height;   
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  } 
 }
 ImgD.style.border="1px solid #cccccc"; 
}

//图片按比例缩放#2
function DrawImageb(ImgD,iwidth,iheight){ 
 var image=new Image(); 
// var iwidth = 120;  //定义允许图片宽度 
// var iheight = 180;  //定义允许图片高度
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
 flag=true; 
 if(image.width/image.height>= iwidth/iheight){ 
  if(image.width>iwidth){   
  ImgD.width=iwidth; 
  ImgD.height=(image.height*iwidth)/image.width; 
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  } 
 else{ 
  if(image.height>iheight){   
  ImgD.height=iheight; 
  ImgD.width=(image.width*iheight)/image.height;   
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  } 
 }
 ImgD.style.border="1px solid #333333"; 
}

//图片按比例缩放#3
function DrawImagec(ImgD,TolLenth){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
 flag=true;
 if(image.height>image.width)TolLenth=image.width/image.height*TolLenth;
 var n;
 n = Math.sqrt(image.width*TolLenth/image.height);
 ImgD.width = n; 
 ImgD.height= TolLenth / n; 
 ImgD.style.border="1px solid #333333"; 
 }
}

//网站收藏
function bookmarkit(){
window.external.addFavorite('http://www.yasp.gov.cn/','永安星火')
}

function showflash(w,h,u){
var str="<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width="+w+" height="+h+"><PARAM NAME=movie VALUE='"+u+"'><PARAM NAME=quality VALUE=high><param name='wmode' value='transparent'><embed src='"+u+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+w+" height="+h+" menu='false' wmode='transparent'></embed></OBJECT>";
document.write (str);
}
