// JavaScript Document
function  DrawImage(ImgD,Iwidth,Iheight){  
     var  image=new  Image();  
     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;  
         }  
         //ImgD.alt=image.width+"กม"+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.alt=image.width+"กม"+image.height;  
         }  
       }  
}

function printimg(imgid){
	var imgobj=document.getElementById(imgid);
	if(imgobj!=null){
		var printdialog=window.open(imgobj.src,'','height=5,width=5,top=102400,left=102400,toolbar=no,menubar=no');
		printdialog.blur();
		printdialog.document.execCommand('print');
		printdialog.close();
	}
}

function OpenURL(url){
	//alert('bbb');
	window.open (url,'newwindow','height='+(window.screen.height-40)+', width=980, top=0, left=0, toolbar=no, menubar=no, scrollbars=yes,resizable=no,location=no, status=no');
}
