﻿// JScript 文件
 
 function returnV() 
 { 
    var oImg=document.getElementById("Image1"); 
    window.parent.returnValue=oImg.src; 
    self.close(); 
 } 
  
 function DrawImage(ImgD){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= 680/510){
     if(image.width>680){  
     ImgD.width=680;
     ImgD.height=(image.height*680)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>510){  
     ImgD.height=510;
     ImgD.width=(image.width*510)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt="图片大小:"+image.width+"×"+image.height;
     }
    }
   /*else{
    ImgD.src="";
    ImgD.alt=""
    }*/
   } 
   


 function DrawImage(ImgD,wid,bili){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>=bili){
     if(image.width>wid){  
     ImgD.width=wid;
     ImgD.height=(image.height*wid)/image.width;
   }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     //ImgD.alt="aasas"+image.width+"×"+image.height;
     }
    else{
     if(image.height<wid/bili){  
     ImgD.height=wid/bili;
     ImgD.width=(image.width*wid/bili)/image.height;     
    ImgD.width=wid;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt="图片大小:"+image.width+"×"+image.height;
     }
    }
   /*else{
    ImgD.src="";
    ImgD.alt=""
    }*/
   } 


 function DrawImageWH(ImgD,wid,hei)
 {
   var image=new Image();
   var bi=wid/hei;
   image.src=ImgD.src;
   var obi=image.width/image.height;
   if (obi>=bi && image.width>wid){
       flag=true;
         ImgD.width=wid;
         ImgD.height=(image.height*wid)/image.width;
       }
    else{
        if (obi<bi && image.height>hei){
        flag=true;
        ImgD.height=hei;
        ImgD.width=(image.width*hei)/image.height;
        } 
     else{
        ImgD.height=image.height;
        ImgD.width=image.width;
        } 
             
    }
    ImgD.alt="图片大小:"+ImgD.width+"×"+ImgD.height;
} 



 function DrawImageW(ImgD,wid)
 {
   var image=new Image();
   image.src=ImgD.src;
   var obi=image.width/image.height;
   if (image.width>wid){
         ImgD.width=wid;
         ImgD.height=(image.height*wid)/image.width;
   }
    ImgD.alt="图片大小:"+image.width+"×"+image.height;
} 


 function DrawImageH(ImgD,hei)
 {
   var image=new Image();
   image.src=ImgD.src;
   var obi=image.width/image.height;
   if (image.height>hei){
         ImgD.height=hei;
         ImgD.height=(image.width*hei)/image.height;
   }
    ImgD.alt="图片大小:"+image.width+"×"+image.height;
} 



function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}

 
 //变换Class
 function changeClass(ClassName){
 //alert(document.all.showPic.className);
 if (document.all.showPic.className == ClassName){
 document.all.showPic.className ="";
 }
 else
 { document.all.showPic.className =ClassName; }
 }