function mopenWindow(url, height, width)
{
  var winx = height + 50;
  var winy = width + 50;

  var winOptions  = "scrollbars=0,menubar=0,height=" + winx + ",width=" + winy;

  var newwindow=window.open(url,'popup',winOptions);

  if (window.focus) {
     newwindow.focus();
  }
}

function openWindow ( imagename, height, width )
{
  var winx = height + 50;
  var winy = width + 50;
  var x = (screen.availWidth - winx)/2;
  var y = (screen.availHeight - winy)/2;

  var winOptions  = "alwaysRaised=yes, resizable=yes, scrollbars=no, " +
		    "menubar=no, status=no, toolbar=no, location=no, " +
		    "directories=no, height=" + winx + 
		    ", width=" + winy + ", left=" + y + ", top=" + x;
					
  imgwin = window.open ( "", "img_win", winOptions );
	imgwin.document.open ();
	imgwin.document.writeln ( "<html>" );
	imgwin.document.writeln ( "<head>" );
	imgwin.document.writeln ( "<title>Image Display</title>" );
	imgwin.document.writeln ( "</head>" );
	imgwin.document.writeln ( "<body>" );
	imgwin.document.writeln ( '<div align="center" valign="middle">' );
	imgwin.document.write   ( '<img src="' + imagename + '" border="0" ');
	imgwin.document.write   ( 'height="' + height + '" width="' + width );
	imgwin.document.writeln ( '" />' );
	imgwin.document.write   ( '<a href="javascript:window.close()"> ' );
	imgwin.document.writeln ( 'Click here to close</a>' );
	imgwin.document.writeln ( "</div>" );
	imgwin.document.writeln ( "</body>" );
	imgwin.document.close ();
//  imgwin.location.replace ( imagename );  
}

