function view_image(img, description, border)
{  
  if (!(border)) {
    border=0;
  }
  
  newwindow=window.open("about:blank", "image", ",width=630,height=425,location=NO,directories=NO,scrollbars=NO,status=NO,toolbar=NO,resizable=YES,menubar=NO");

  // Create new document to be written into
  newdocument=newwindow.document;

  // Create HTML
  newdocument.writeln('<HTML>');
  
  newdocument.writeln('<HEAD>');
  newdocument.writeln('<TITLE>'+description+'</TITLE>');
  newdocument.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
  newdocument.writeln('<link rel="stylesheet" href="style.css" type="text/css">');

  newdocument.writeln('<SCRIPT LANGUAGE="javascript">');
  newdocument.writeln('<!--');  
  newdocument.writeln('function best_fit(border)'); 
  newdocument.writeln('{'); 
  newdocument.writeln('  // Initialise according to browser'); 
  newdocument.writeln('  if (parseInt(navigator.appVersion.charAt(0))>=4){'); 
  newdocument.writeln('    var isNN=(navigator.appName=="Netscape")?1:0;'); 
  newdocument.writeln('    var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;'); 
  newdocument.writeln('  }'); 
  newdocument.writeln('  // Get amount you have to change window from current size to image size (with border)'); 
  newdocument.writeln('  if (isIE) {'); 
  newdocument.writeln('    dwidth=document.images[0].width-document.body.clientWidth+border*2;'); 
  newdocument.writeln('    dheight=document.images[0].height-document.body.clientHeight+border*2;'); 
  newdocument.writeln('  }'); 
  newdocument.writeln('  else {'); 
  newdocument.writeln('    dwidth=document.images[0].width-window.innerWidth+border*2;'); 
  newdocument.writeln('    dheight=document.images[0].height-window.innerHeight+border*2;'); 
  newdocument.writeln('  }'); 
  newdocument.writeln('  // Resize window accurately'); 
  newdocument.writeln('  window.resizeBy(dwidth,dheight);'); 
  newdocument.writeln('}');   
  newdocument.writeln('-->');  
  newdocument.writeln('</SCRIPT>'); 

  newdocument.writeln('</HEAD>');

//  newdocument.writeln('<BODY ONLOAD="best_fit('+border+')" BACKGROUND="../../images/background.gif">');
  newdocument.writeln('<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" ONLOAD="best_fit('+border+')">');
  
  newdocument.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="630" height="425">');
newdocument.writeln('<param name="movie" value="'+img+'" />');
 newdocument.writeln('<param name="quality" value="high" />');
  newdocument.writeln('<embed src="'+img+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="630" height="425">');
newdocument.writeln('</embed>');
newdocument.writeln('</object>');
  newdocument.writeln('</BODY>');
  
  newdocument.writeln('</HTML>');

  // Close stream (tells page it's finished)
  newdocument.close();
  
  // Makes sure popup has focus, not this page
  if (window.focus) newwindow.focus();
}

function best_fit(border)
{
  // Initialise according to browser
  if (parseInt(navigator.appVersion.charAt(0))>=4){
    var isNN=(navigator.appName=="Netscape")?1:0;
    var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
  }

  // Get amount you have to change window from current size to image size (with border)
  if (isIE) {
    dwidth=document.images[0].width-document.body.clientWidth+border*0;
    dheight=document.images[0].height-document.body.clientHeight+border*0;
  }
  else {
    dwidth=document.images[0].width-window.innerWidth+border*0;
    dheight=document.images[0].height-window.innerHeight+border*0;
  }

  // Resize window accurately
  window.resizeBy(dwidth,dheight);
}
