BaseWidth=800;
NewWindowWidth=BaseWidth-50;
NewWindowHeight=Math.floor(BaseWidth*0.75)-50;
MaxWidth=NewWindowWidth-30;
MaxHeight=NewWindowHeight-30;

function Disp(FileName,Wo,Ho){
  Ratio=Math.min(MaxWidth/Wo,MaxHeight/Ho);
    if(Ratio>1)Ratio=1;
  W=Math.floor(Wo*Ratio);
  H=Math.floor(Ho*Ratio);
  mW=window.open("","NewWindow","width="+NewWindowWidth+",Height="+NewWindowHeight);
  mW.focus();
  mW.document.open();
  mW.document.write("<TITLE>"+FileName+"</TITLE>");
  mW.document.write("<BODY BGCOLOR='#008040'>");
  mW.document.write("<TABLE BORDER=0 WIDTH="+MaxWidth+" HEIGHT="+MaxHeight+" CELLSPACING=0>");
  mW.document.write("<TR><TD ALIGN=CENTER VLAIGN=MIDDLE>");
  mW.document.write("<A HREF='JavaScript:window.close();'>");
  mW.document.write("<IMG SRC="+FileName+" WIDTH="+W+" HEIGHT="+H+" BORDER=0>");
  mW.document.write("</A></TABLE>");
  mW.document.close();
}
