// variable Declarations
var browser = navigator.appName;
var whichOne = ' ';
var over = 'no';
var ns4 = false;
var ie4 = true;


function init() {
	ns4 = (document.layers)? true:false;
	ie4 = (document.all)? true:false;
}


function on(pic)
// turns previous layer off if any and then turns current layer on (visible)
{
	if (document.images) {
		over = 'yes';
		if (browser == 'Netscape')  {
			if (whichOne != ' ')  {
				eval('document.' + whichOne + 'Menu.visibility = "hidden"');
			}
			eval('document.' + pic + 'Menu.visibility = "visible"');
			whichOne = pic;
			}
		else {
			if (whichOne != ' ')  {
				eval(whichOne + 'Menu.style.visibility = "hidden"');
			}
			eval(pic + 'Menu.style.visibility = "visible"');
			whichOne = pic;
		}
	}
}

// called by onmouseout event handle on images that popup rollovers
// sets over to no and begins the timeout. whichOne is used by on
// so the next div/layer knows which previous div/layer to turn off (hide)
function overChecker(pic) {
	whichOne = pic;
	over = 'no';
	setTimeout("off()", 700);
}

// the reverse of on(). Turns the div called 'whichOne' to hidden (off)
function off()
{
	if (document.images) {
		if (over == 'no')  {
			if (browser == 'Netscape')  {
				eval('document.' + whichOne + 'Menu.visibility = "hidden"');
				}
			else {
				eval(whichOne + 'Menu.style.visibility = "hidden"');
			}
		}
	}
}


function randomImg()
// change randomly the main images 
{
 maxImages= 3; // UPDATE to max num of home images
 i=maxImages * Math.random(1);
 a=Math.ceil(i);
 aImg = new Image();
 aImg.src="images/home/homeFace0" + a + ".jpg";
 document['h23_13'].src = aImg.src;
 i=maxImages * Math.random(1);
 a=Math.ceil(i);
 aImg.src="images/home/homeText0" + a + ".gif";
 document['h23_14'].src = aImg.src;
}

// In netscape we have to reload the whole page on resize so netscape doesnt screw up
// the hidden divs (layers) and munge up various layouts. 
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


