//v1.0 23 aug 2002 chris bassett

if (window.event + "" == "undefined") {
	event = null;
}

function HM_f_PopUp() {
	return false;
}

function HM_f_PopDown() {
	return false;
}

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

HM_PG_MenuWidth = 134;
HM_PG_FontFamily = "arial, helvetica, sans-serif;";
HM_PG_FontSize = 8;
HM_PG_FontBold = 0;
HM_PG_FontItalic = 0;
HM_PG_FontColor = "#202a5c";
HM_PG_FontColorOver = "#FFFFFF";
HM_PG_BGColor = "#FFFFFF";
HM_PG_BGColorOver = "#202a5c";
HM_PG_ItemPadding = 2;
HM_PG_BorderWidth = 1;
HM_PG_BorderColor = "#202a5c";
HM_PG_BorderStyle = "solid";
HM_PG_SeparatorSize = 1;
HM_PG_SeparatorColor = "#0F2864";
HM_PG_ImageSrc = "";
HM_PG_ImageSrcLeft = "HM_More_black_left.gif";
HM_PG_ImageSrcOver = "";
HM_PG_ImageSrcLeftOver = "HM_More_black_left.gif";
HM_PG_ImageSize = 6;
HM_PG_ImageHorizSpace = 0;
HM_PG_ImageVertSpace = 3;
HM_PG_KeepHilite = true; 
HM_PG_ClickStart = 0;
HM_PG_ClickKill = false;
HM_PG_ChildOverlap = 20;
HM_PG_ChildOffset = 10;
HM_PG_ChildPerCentOver = null;
HM_PG_TopSecondsVisible = .5;
HM_PG_StatusDisplayBuild = 0;
HM_PG_StatusDisplayLink = 0;
HM_PG_UponDisplay = null;
HM_PG_UponHide = null;
HM_PG_RightToLeft = 0;
HM_PG_CreateTopOnly = 0;
HM_PG_ShowLinkCursor = 1;
HM_PG_NSFontOver = true;

// Resets nav rollovers to off state. No return value.
// v2.0 13 aug 2002 chris bassett
// now without switch statement
function BI_reset(intCurrentMenu) { //as void
	
	if (intCurrentMenu > 0){
		
		if (Math.floor(intCurrentMenu) == Math.ceil(intCurrentMenu)){
			
			var strNav = 'nav' + (intCurrentMenu);
			var intOriginalImage = 2 * (intCurrentMenu - 1);
			
			document.images[strNav].src = menuImages[intOriginalImage];
			
		}
		
	}

}

//resets all images to default state
//v 1.0 13 august 2020 chris bassett

function BI_setAll(strNavPrefix, intNewMenu){ //as void
	
	
	
	for (i = 1; i <= (menuImages.length / 2); i ++){
		
		var strNavToCall = strNavPrefix + i;
		
		if (i == eval(intNewMenu)){
			
			var intImageSet = (2 * i) - 1;
			
		}else{
			
			var intImageSet = 2 * (i -1);
		
		}
		
		document.images[strNavToCall].src = menuImages[intImageSet];
	}
}

//handles the multiple calls for mouseout actions
// v 1.0 13 aug 2002 chris bassett
function BI_HM_out(intCurrentMenu, strMenuPrefix){ //as void
	
	var strMenuToCall = strMenuPrefix + intCurrentMenu;
	
	currentMenu = intCurrentMenu;
	popDown(strMenuToCall);
	
}

//handles the multiple calls for mouseover actions
//v 1.0 13 aug 2002 chris bassett
function BI_HM_over(intCurrentMenu, intNewMenu, strNavPrefix, strMenuPrefix, strPassThrough){ //as void
	
	var strMenuToCall = strMenuPrefix + intNewMenu;
	
	currentMenu = intCurrentMenu;
	popUp(strMenuToCall, strPassThrough);
	BI_setAll(strNavPrefix, intNewMenu);
	
}

//handles simple single rollovers
//v3.0 23 aug 2002 chris bassett
function BI_singleroll(strName, strImage, strPath){ //as void
	
	//set the default image directory if we didn't get one
	if (strPath == ''){
		strPath = 'images/';
	}
	
	var strMyImage = strPath + strImage;
	document.images[strName].src = strMyImage;
	
}

function newWindow(page) {
	picWindow = window.open( page, 'picWin', 'toolbar=no,location=no,scrollbars=no,width=300,height=200')
}

function newWindow2(page) {
	picWindow = window.open( page, 'picWin', 'toolbar=no,location=no,scrollbars=yes,width=400,height=300')
}



/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}
