var img = new Array();
var imgPrefix = "images/nav/But";

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}
function flip() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<flip.arguments.length; i+=2) {
      document['img-'+flip.arguments[i]].src =
        img[flip.arguments[i]+flip.arguments[i+1]].src;
    }
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    for (var i=0; i<nav.length; i++) {
      img[nav[i]+'0'] = newImage(imgPrefix+nav[i]+'0.gif');
      img[nav[i]+'1'] = newImage(imgPrefix+nav[i]+'1.gif');
    }
    preloadFlag = true;
  }
}

function go(page) { window.location=page; }

function goOtherWindow(url) {
  window.open(url,'RedElink').focus();  
}

var pwin = null;
function popkit(id,w,h) {
  ww = w+365; wh = h+10; if (pwin) pwin.close();
  pwin = window.open("/popkit.php?kit="+id+"&h="+h+"&w="+w,
    'popkit','top=5,left=5,width='+ww+',height='+wh+','
    + 'resizeable=no,scrollbars=no,menubar=no,' 
    + 'status=no,toolbar=no');
}

var ewin = null;
function popquake()
{   if (ewin) ewin.close();
    ewin = window.open("/earthquake.php",null,'width=439,height=458,resizeable=no,scrollbars=no,menubar=no,status=no,toolbar=no');
}

var swin = null;
function survey()
{   if (swin) swin.close();
    if (visitor_is_leaving)
    {
      swin = window.open("/survey.php",null,'width=675,height=458,resizeable=no,scrollbars=no,menubar=no,status=no,toolbar=no');
    }
}

var mwin = null;
function popmessg()
{   if (mwin) mwin.close();
    mwin = window.open("/message.php",null,'width=600,height=200,resizeable=no,scrollbars=no,menubar=no,status=no,toolbar=no');
}

function popWin(url, name, features) {
	window.open(url, name, features);
}

function popupWindow2(url, srl, wid, hgt) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+srl+',resizable=yes,copyhistory=no,width='+wid+',height='+hgt+',top=75,left=75')
}

function showThis(pic,name,w,h,show) {
	//document.name.src=pic;document.name.width=w;document.name.height=h;
	//name.style.src=pic;name.style.width=w;name.style.height=h;

	var URL = "show";

	document.images[name].src = pic;
	document.images[name].width = w;
	document.images[name].height = h;
}

var arrTemp=self.location.href.split("?"); 
var picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
var NS = (navigator.appName=="Netscape")?true:false; 

function FitPic() { 
    iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
    iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
    iWidth = document.images[0].width - iWidth; 
    iHeight = document.images[0].height - iHeight; 
    window.resizeBy(iWidth, iHeight+50); 
    self.focus(); 
};

n1on = new Image(110, 40);
n1on.src = "images/dontbescared1.gif";
n1off = new Image(110, 40);
n1off.src = "images/dontbescared0.gif";
function on_image(button)
  {document [button].src = eval(button + "on.src");  }
function off_image(button)
  { document [button].src = eval(button + "off.src"); }