//<!--
// $Id: imgPopup.js,v 1.3 2002/09/24 20:38:10 FLY Exp $

// function: imgPopup() - setups event handlers and starts loading image.
 function imgPopup(imgname){
   // Construct new object
   i = new Image();
   // Setup onerror event handler
   i.onerror =  imgFailed;
   // Setup onload event handler
   i.onload =  imgLoaded;
   // Try to load image
   i.src = "images/"+imgname+"_.jpg";
 }

// function:  imgFailed() - event handler, called if image loading failed.
// Displays error massage and dies.
function  imgFailed(){
 alert("Can't open image from url: "+this.src);
}

// function:  imgLoaded() - event handler, called if image is loaded sucssesfully.
// Opens a new window and dispays the loaded image.
function  imgLoaded(){

 var wind = window.open('','Image','width='+(this.width)+',height='+(this.height));
 wind.document.writeln('<html>');
 wind.document.writeln('<head><title>Click on image to close this window</title></head>');
 wind.document.writeln('<body marginleft=0 margintop=0 leftmargin=0 topmargin=0 onblur="self.focus();">');
 wind.document.writeln('<img name=img src='+this.src+' width='+this.width+' height='+this.height+' alt="click to close"  style=\x22cursor:pointer\x3Bc\\ursor:hand\x22  onclick="self.close();"');
 wind.document.writeln('</body>');
 wind.document.writeln('</html>');
}

//-->

