function openDialog(surl)
{
	var sURL  = surl ;
	var nDialogWidth= 650;
	var nDialogHeight= 350;
	var nLeft			= (window.screen.availWidth-nDialogWidth)/2;
	var nTop			= (window.screen.availHeight-nDialogHeight)/2;
	var sFeatures		= "dialogLeft:"+nLeft+"px;dialogTop:"+nTop+"px;dialogHeight:"+nDialogHeight+"px;dialogWidth:"+nDialogWidth+"px;help:no;status:no";
	var sReturnVal		= window.showModalDialog(sURL,window,sFeatures) ;
	
}
function openwin(URL,w,h)
{
  var l=(window.screen.width/2)-w/2;
  var t=(window.screen.height/2)-h/2;
  window.open(URL,'','width='+w+',height='+h+',top='+t+',left='+l+',alwaysRaised=yes,z-look=yes,menubar=no,toobar=no,scrollbars=yes,resizable=no,status=no,loation=no');

}
function winColse()
{	
	//top.returnValue	= '' ;
	this.window.close();
}
function cartWindow(url)
{
  window.open(url,"","resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no,top=20,left=10,width=650,height=350")
}

/*°´±ÈÀýÉú³ÉËõÂÔÍ¼*/
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){  
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){  
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;     
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
  }
} 
