// 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) ? -1 : 10;  // "fudge" factors for width
var oh = (is_ns4up) ? -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() {
  w = (screen.availWidth  < pic.document.images.i1.width)  ? screen.availWidth  : pic.document.images.i1.width  + ow;
  h = (screen.availHeight < pic.document.images.i1.height) ? screen.availHeight : pic.document.images.i1.height + oh;
  pic.resizeTo(w, h);
  x = Math.round((screen.availWidth  - w) / 2);
  y = Math.round((screen.availHeight - h) / 2);
}

function moveIt() {
  if (is_ns4up) 
   {moveIE();
//    w = (screen.availWidth  < pic.document.images.i1.width)  ? screen.availWidth  : pic.document.images.i1.width  + ow;
//    h = (screen.availHeight < pic.document.images.i1.height) ? screen.availHeight : pic.document.images.i1.height + oh;
//    pic.resizeTo(w, h);
//    x = Math.round((screen.availWidth  - w) / 2);
//    y = Math.round((screen.availHeight - h) / 2);
    centerIt();
   }
  else
   {
    if (is_ie4up)
     {
      setTimeout("moveIE()",0);
      setTimeout("centerIt()",0);
     }
   }
}

function openit(file) {
  pic = window.open("","pic","dependent=yes");
  pic.document.writeln("<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0>");
  pic.document.writeln("<img name='i1' src='" + file + "' border=0 onLoad='opener.moveIt()'>");
  pic.document.writeln("</body>");
  pic.document.close();
}



