// script by Gil Davis - http://gil.davis.home.att.net
// Browser detection
    var agt=navigator.userAgent.toLowerCase(); 
    var is_major = parseInt(navigator.appVersion); 
    var is_ns = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
              && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
              && (agt.indexOf('webtv')==-1)); 
    var is_ns4up = (is_ns && (is_major >= 4)); 
    var is_ns5up = (is_ns && (is_major >= 5)); 
    var is_ie    = (agt.indexOf("msie") != -1); 
    var is_ie4up = (is_ie  && (is_major >= 4)); 

var ow = (is_ns4up) ? ((is_ns5up) ? 12 : -1) : 10;  // "fudge" factors for width
var oh = (is_ns4up) ? ((is_ns5up) ? 30 : -3) : 29;  //    and height
var x  = 0;
var y  = 0;
var w  = 0;
var h  = 0;

function centerIt() {
  pic.moveTo(x, y);
  pic.focus();
}

function moveIE() {
  pic.resizeTo(w, h);
}

function doPic() {
  _img = pic.document.images.i1;
  w = (screen.availWidth  < _img.width)  ? screen.availWidth  : _img.width  + ow;
  h = (screen.availHeight < _img.height) ? screen.availHeight : _img.height + oh;
  x = Math.round((screen.availWidth  - w) / 2);
  y = Math.round((screen.availHeight - h) / 2);
  if (is_ns4up) 
   {moveIE();
    centerIt();
    if (is_ns5up)
     {pic.document.getElementById("wait").style.visibility = "hidden";}
    else
     {pic.document.wait.visibility = "hide";}
   }
  else
   {
    if (is_ie4up)
     {setTimeout("moveIE()",0);
      setTimeout("centerIt()",0);
      if (document.getElementById)
        {pic.document.getElementById("wait").style.visibility = "hidden";}
      else
        {pic.document.all["wait"].style.visibility = "hidden";}
     }
   }
}

function moveIt() {
  if (is_ns5up) {setTimeout("doPic()",0);} else {doPic();}
}

function openit(file) {
  pic = window.open("","pic","dependent=yes,resizable=yes");
  pic.document.writeln("<HTML><HEAD>");
  pic.document.writeln("<LINK REL='STYLESHEET' HREF='openit.css'>");
  pic.document.writeln("<\/HEAD>");
  pic.document.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 onLoad='opener.moveIt()'>");
  pic.document.writeln("<img name='i1' id='i1' src='" + file + "' border=0>");
  pic.document.writeln("<div id='wait' class='wait'>Picture loading ... please wait</div>");
  pic.document.writeln("<\/body><\/HTML>");
  pic.document.close();
  if(is_ns5up) {pic.onLoad=moveIt();}
}


