var flag=false;
function DrawImage(ImgD,wid,hei){
	//alert(wid/hei)
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>=(wid/hei)){
     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=image.width+"×"+image.height;
     }
    else{
     if(image.height>hei){  
     ImgD.height=hei;
     ImgD.width=(image.width*hei)/image.height;     
     }else{
		if(image.width<500){
			ImgD.width=image.width;  
			ImgD.height=image.height;
		}else{
			ImgD.width=500;  
			ImgD.height=image.height;				
		}
     }
     //ImgD.alt=image.width+"×"+image.height;
     }
    }
} 

function menu(class2){
	myclass=document.getElementById(class2);
	if(myclass){
		if(myclass.style.display=='')
			myclass.style.display='none';
		else myclass.style.display='';
	}
}
