
// speeds things up
d = document;

// screen widths
screenW = new Array("800","1024");
screenH = new Array("600","768");

// safe widths
safeW = new Array("800","1008");
safeH = new Array("600","718");

function init()
{
   // get resolution
   wdth = screen.width;
   hght = screen.height;

   // use object detection to determine browser capabilities
   (d.getElementById)?modern=true:modern=false;
   (d.layers)?nn4=true:nn4=false;

   // if netscape 4, show user an alert with the width and height
   if (nn4) alert("Your resolution appears to be " + wdth + " x " + hght);

   // if it's a modern browser, write resolution to span
   if (modern) d.getElementById("res").innerHTML = wdth + " x " + hght;
}

function openIt(loc)
{
   // get resolution again in case user has changed resolutions
   wdth = screen.width;
   hght = screen.height;

   // find position in array for user's width
   // (we'll use the corresponding height to keep the aspect ratio correct)		
   if (wdth == 800)  p = 0;
   if (wdth >= 1024) p = 1;

   // make features string
   ftrs = "width=" + safeW[p] + ",height=" + safeH[p] + ",resizable";

   // open the pop-up window
   window.open(loc,'popup',ftrs);
}

