var giIntervalID1;
var gix = 0;
var screenWidth = screen.width;
var screenHeight = screen.height;
var timeoutID;
var mainTimeout;
var width;

function SetBackgroundImage()
{
  if(screenWidth <= 640)
    width = 640;
  else if(screenWidth <= 800)
    width = 800;
  else if(screenWidth <= 1024)
    width = 1024;
  else if(screenWidth <= 1152)
    width = 1152;
  else if(screenWidth <= 1280)
    width = 1280;
  if(navigator.appName == "Netscape")
    eval("document.getElementById('body').background='images//background" + width + ".jpg'");
  else
    eval("body.background='images//background" + width + ".jpg'");

}  
function SetBannerImage()
{
  if(screenWidth <= 640)
    width = 640;
  else if(screenWidth <= 800)
    width = 800;
  else if(screenWidth <= 1024)
    width = 1024;
  else if(screenWidth <= 1152)
    width = 1152;
  else if(screenWidth <= 1280)
    width = 1280;
  if(navigator.appName == "Netscape")
    eval("document.getElementById('banner1').background='images//background" + width + "r.jpg'");
  else 
    eval("banner1.background='images//background" + width + "r.jpg'");
}

var now = new Date();
var seed = now.getTime() % 0xffffffff;

function GetRandomInt(low,high)
{
  return Random(high - low) + low;
}
function Random(n) 
{
  seed = (0x015a4e35 * seed) % 0x7fffffff;
  if(n == 0)
    return 0;
  else
    return (seed >> 16) % n;
}

////Fade stuff...
dd=document;
NS=(dd.layers)?1:0;
IE=(dd.all)?1:0;
msge='This site best viewed with\nInternet Explorer in 1024x768';
steps=100;
num=0;
r0=255;g0=255;b0=255;
r1=0;g1=0;b1=0;
stepR=Math.floor((r1-r0)/steps);
stepG=Math.floor((g1-g0)/steps);
stepB=Math.floor((b1-b0)/steps);
if (NS) 
{closeIt="document.fadeText.document.close()";} 
else 
{z1="document.all.fadeText.innerText=msge";}
 
hexa=new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
function hex(i){if (i<0)return "00";else if (i>255)return "ff";else return ""+hexa[Math.floor(i/16)]+hexa[i%16]}
function setclr(r,g,b){hr=hex(r);hg=hex(g);hb=hex(b);clr="#"+hr+hg+hb;}
function setob(L){if(NS){obg=dd.layers[L]} else {obg=dd.getElementById(L);obg=obg.style}}
numOfLoops=1;
loopCounter=0;
 
function fadeOut()
{
  num--;
  if(num>=0)
  {
    setclr(r1-stepR*num,g1-stepG*num,b1-stepB*num);
    if (NS)
    {
      document.fadeText.document.write('<p style=\"width:600;font-family:Arial;font-size:14px;color:'+clr+'\">'+msge+'</p>');
      eval(closeIt);
    } 
    else 
    {
      obg.color=clr;
    }
    fadeOutTimer = setTimeout("fadeOut()",50);
  } 
  else 
  {
    clearTimeout(fadeOutTimer);
    loopCounter++;
    if(loopCounter >= numOfLoops)
    {
      clearTimeout(fadeOutTimer);
      clearTimeout(fadeInTimer);
    }
    else
      fadeIn();
  }
}
 
function fadeIn()
{
  num++;
  if(num<=steps)
  {
    setclr(r1-stepR*num,g1-stepG*num,b1-stepB*num);
    if (NS)
    {
      document.fadeText.document.write('<p style=\"width:600;font-family:Arial;font-size:14px;color:'+clr+'\">'+msge+'</p>');
      eval(closeIt);
    } 
    else 
    {
      obg.color=clr;
      if (IE)
        eval(z1);
    }
    fadeInTimer = setTimeout("fadeIn()",50);
  }
  else 
  {
    clearTimeout(fadeInTimer);
    fadeOut();
  }
}
// End fade stuff

// ZOOM STUFF...
var mapLoaded = 3;

function Zoom(direction)
{
  if(direction == "in")
//  if(inout[0].checked)
  {
    if(mapLoaded >= 1)
    {
      mapLoaded--;
    }
  }
  else if(direction == "out")
  //else if(inout[1].checked)
  {
    if(mapLoaded <= 11)
    {
      mapLoaded++;
    }
  }
  if(NS)
    eval("document.mapImage.src = 'images//map" + mapLoaded + "_3d.gif'");
  else
    eval("mapImage.src = 'images//map" + mapLoaded + "_3d.gif'");
  //output1.innerHTML = "mapImage.src = 'images//map_" + mapLoaded + ".gif'";
}