/* 
All Scripts in this file: copyright 2006
*/

var site_check = true;
var NN_check = false;
var page_loaded = false;

if ((using_layers)&&(!NN_check)){
	alert('You are using the older Netscape 4 browser. This site should still be functional, but the appearance of the site may not be as intended.');
	NN_check = true;
}

if (!dhtml) {
  alert('You are using a non-standard or older browser.\n As a result, the layout of this page will not appear correctly, and many DHTML features will not work.\n Upgrade or use a different browser to take advantage of all this page\'s features.')
}

    if (using_layers == 1) {
        origWidth=self.innerWidth;
        origHeight=self.innerHeight;
		
    }
//image preloader

function setLoad() {
	page_loaded = true;
}

    // if using Netscape, reload the page if window size changes
    function reloadPage() {
        if (using_layers == 1) {
            if ((origWidth != self.innerWidth) || 
                (origHeight != self.innerHeight)) {
                self.location.reload();
            }
        }
    }

   if (using_layers == 1) onresize = reloadPage;



function imageswap(pic,inout,nested) {
  if (document.images) {
	if (using_layers == 1) {
      if (inout == 1) {
        document.layers[nested].document.images[pic].src = 'images/'+pic+'_ov.jpg';
	  }
	  else {
	    document.layers[nested].document.images[pic].src = 'images/'+pic+'.jpg';
	  }	  
	}
    else {
	  if (inout == 1) {
	    document.images[pic].src = 'images/'+pic+'_ov.jpg';
	  }
	  else {
	    document.images[pic].src = 'images/'+pic+'.jpg';
	  }
	}
  }
}

 menu_array = new Array();
menu_array[0] = "menu1";
menu_array[1] = "menu2";
menu_array[2] = "menu3";
menu_array[3] = "menu4";
menu_array[4] = "menu5";
menu_array[5] = "menu6";
menu_array[6] = "menu7";

var isactive = false;
var glo_obj = "";	
var htimer;
var parental = "mainbox"

function showhide(obj,onlink) {
  // Forced this to true to work with the randomizer script. (B.K.)
  page_loaded = true;
 
 
 if((dhtml)&&(page_loaded)){
	fixed_obj = getObject(obj,parental,1);
    glo_obj = obj;	
	if (onlink) {

		clearTimeout(htimer);		
		for (i=0; i < menu_array.length; i++) {
			temp_obj = getObject(menu_array[i],parental,1);
			if (temp_obj != null) {
				temp_obj.visibility = "hidden";
			}
		}
		
		if (fixed_obj != null) {
			//tempfixed = String(fixed_obj);
			//alert(tempfixed);
			fixed_obj.visibility = "visible";
		}
		isactive = true

	}

		if (!onlink) {
			isactive=false;
			layerTimer()
		}
    }
}
function layerCheck(flag) {
	if((dhtml)&&(page_loaded)){
		if (flag) {
			//alert('checking layer');
		    isactive = true;
			clearTimeout(htimer);
		}
		else {
			isactive = false;
    		layerTimer();
		}
	}
}
function layerTimer() {
	htimer = setTimeout("hideMenu()",300);
}

function hideMenu() {
	if (!isactive) {
		fixed_obj = getObject(glo_obj,parental,1);
		if (fixed_obj != null) {
			fixed_obj.visibility = "hidden";
		}
	}
}

function changeClass(obj,classn){
	if(page_loaded){
 		obj.className = classn;
	}
} 