﻿// window.open()方式
function ShowOpen(url,iWidth,iHeight) {           
           var iTop=(window.screen.height-iHeight)/2;
           var iLeft=(window.screen.width-iWidth)/2;
window.open(url,"","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft); 	
} 
    
//window.showModalDialog方式
	function ShowDialog(url,iWidth,iHeight) { 
           var iTop=(window.screen.height-iHeight)/2;
           var iLeft=(window.screen.width-iWidth)/2;
           window.showModalDialog(url,window,"dialogHeight: "+iHeight+"px; dialogWidth: "+iWidth+"px;dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no;help:no;"); 	
} 


//设定图片显示尺寸 onload="javascript:DrawImage(this,'80','80')"
var flag=false; 
function DrawImage(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= w/h){ 
    if(image.width>w){ 
      ImgD.width=w; 
      ImgD.height=(image.height*w)/image.width; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  }else{ 
    if(image.height>h){ 
      ImgD.height=h; 
      ImgD.width=(image.width*h)/image.height; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  } 
} 
} 