var newW=null
var img=null
var scroll=null

function OpenImgWindow(imageName,alt,img_width,img_height) 
{

var doc_width = 640, doc_height = 480;

if (self.screen) { 
   doc_width = screen.width
   doc_height = screen.height
} else if (self.java) { 
   var jkit = java.awt.Toolkit.getDefaultToolkit();
   var scrsize = jkit.getScreenSize(); 

   doc_width = scrsize.width; 
   doc_height = scrsize.height; 
}

  img=new Image()
  img.src=imageName
  if (doc_width > (img_width))
{   w=img_width
    scroll=null  }
  else
{   w=doc_width
    scroll=",scrollbars=yes"  }
  if ((doc_height-60) > img_height)
{   h=img_height
    scroll=null  }
  else               
{   h=doc_height-60
    w+=16
    scroll=",scrollbars=yes"  }
  posLeft=0
  posTop=0
  if(newW != null) 
    if(!newW.closed) 
      newW.close()
  newW= window.open("","newW","width="+w+",height="+h+",left="+posLeft+",top="+posTop+scroll)
  newW.document.open()
  newW.document.writeln('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"><center>') 
  newW.document.writeln('<img src='+imageName+' alt='+alt+' width='+img_width+' height='+img_height+'>')
  newW.document.write('</body></html>')
  newW.document.close()
  img=null
  newW.focus()
}

