// JavaScript Document

function imgPopup(url,alt){
    var imgPopup=window.open('','imgPopup','height=50,width=50,toolbar=no,scrollbars=no,resizable=yes,menubar=no,status=no,directories=no,location=no,50,50');
    imgPopup.document.open();
    imgPopup.document.writeln('<html><head><title>image</title> \n <style type="text/css"> \n a{color:#3f3479;} p#caption{background-color:#eeeeee;text-align: left;padding-left: 10px;padding-right: 10px;}  \n body {font-family: Tahoma, Arial, Helvetica, sans-serif;text-align: center;} \n p {font-size: 70%;margin-top: 0px;padding-top: 0.5em;padding-bottom: 1em;} \n img {display: block; margin-right: auto; margin-left: auto;} \n  p.close {text-align: center; margin-bottom: 0px;        width: 5em;        float: right;        color: #FFFFFF;           padding: 3px;        font-weight: normal;}  \n </style> \n </head> \n <body>');
   imgPopup.document.writeln('<img src="' + url + '" alt="' + alt + '" id="lrgimage" />');
   imgPopup.document.writeln(' \n<p class="close"><a href="javascript:window.close();">Close</a></p> \n </body> \n </html>');
   imgPopup.document.title=alt;
   var bigImage=imgPopup.document.getElementById('lrgimage');
   var captiontxt=imgPopup.document.getElementById('caption');
   //1st resize for explorer
   var newwidth=bigImage.width+60;
   if(!newwidth){newwidth=490;}
   var newheight=imgPopup.document.body.scrollHeight+40;
   imgPopup.resizeTo(newwidth,newheight);
   imgPopup.window.focus;
                                                
   bigImage.onload = function ()
   //for firefox
       {
       newwidth=bigImage.width+40;
       newheight=imgPopup.document.body.scrollHeight+100;
       imgPopup.resizeTo(newwidth,newheight);
       imgPopup.window.focus;
       }
   window.onload = function ()
   //for firefox
       {
       newwidth=bigImage.width+40;
       newheight=imgPopup.document.body.scrollHeight+100;
       imgPopup.resizeTo(newwidth,newheight);
       imgPopup.window.focus;
       }
imgPopup.onblur=imgPopup.window.focus;
}

