//自动等比例变换缩放图片
function  DrawImage(ImgD,ImgW,ImgH){  
//调用示例：onload="javascript:DrawImage(this,160,120);"
	 var  flag=false;  
	 var  image=new  Image();  
	 image.src=ImgD.src;  
     if(image.width>0  &&  image.height>0){  
       flag=true;  
       if(image.width/image.height>=  ImgW/ImgH){  
         if(image.width>ImgW){      
         ImgD.width=ImgW;  
         ImgD.height=(image.height*ImgW)/image.width;  
         }else{  
         ImgD.width=image.width;      
         ImgD.height=image.height;  
         }  
         ImgD.alt=image.width+"×"+image.height;  
         }  
       else{  
         if(image.height>ImgH){      
         ImgD.height=ImgH;  
         ImgD.width=(image.width*ImgH)/image.height;            
         }else{  
         ImgD.width=image.width;      
         ImgD.height=image.height;  
         }  
         ImgD.alt=image.width+"×"+image.height;  
         }  
       }  
}  
//改变CSS样式
function Change_css_over(PicID)
{
 PicID.className="Pic_Alpha_over";
}
function Change_css_out(PicID)
{
 PicID.className="Pic_Alpha_out";
}

function ShowID(ID)
{
 if(ID.style.display=='none')
 {
  //alert('run here1');
  ID.style.display='block'; 
 }
 else
 {
  //alert('run here2');
  ID.style.display='none';
 }
}
//复选框被选中后显示隐藏内容
function Checked_Show(CheckID,ShowID)
{
if(CheckID.checked==true)
 {
 ShowID.style.display="block";
 }
else
 {
 ShowID.style.display="none";
 }
}
//单选框被选中后显示隐藏内容 Radio_Show(单选按钮组ID,判断值,需显示部分的ID)
function Radio_Show(CheckID,Val,ShowID)
{
//alert(Val);
if(CheckID.value==Val)
 {
 ShowID.style.display="block";
 }
else
 {
 ShowID.style.display="none";
 }
}

//向DIV输入网页代码
function DivInputHtml(DivID,Code)
{
 document.getElementById(DivID).innerHTML=Code;
}

//点击切换效果,序号从1开始编号
function changeDis(sum,showID,IDName)
{
 var str,i;
 for(i=1;i<sum+1;i++){
 str=IDName+i+".style.display='none'";
 //alert(str);
 eval(str);
 }
 showID.style.display='block';
}

//播放图片
function showPic(PicID,PicPath)
{
 PicID.src=PicPath;	
}