var activeImageArray = new Array();
var inactiveImageArray = new Array();
var activatedMenu;
var highlightedMenu;


var imgDir = "";



	var doc, doc2, doc3, sty;
	var n4, ie, n6;
	var active = null;
	var win_width, win_height; //global size variables
	var centerhor, centerver;//centerpoints

	
	if(document.layers) { //statements that with only be executed in NN 4.x
		//if Nesctape 4
		doc = "document.";
		doc2 = ".document.";
		doc3 = "";
		sty = "";
		n4 = true;
	} else if (document.all) { //statements that will only be executed in IE 4.x and 5.x
		//if IE
		doc = "document.all.";
		doc2 = "";
		doc3 = "";
		sty = ".style";
		ie = true;
	} else 	{//if(document.getElementByID){ //staments that will executed in W3C DOM compliant browsers
		//if DOM compliant
		doc = "document.getElementById('";
		doc2 = "')";
		doc3 = "')";
		sty = "').style";
		n6 = true;
	}
	
	function dimensions() {
		if(n4 || n6){
			win_width = window.innerWidth; //netscape settings;
			win_height = window.innerHeight; 
		} else if(ie) {
			win_width = document.body.clientWidth;
			win_height = document.body.clientHeight;
		}
		
		centerhor = win_width/2;
		centerver = win_height/2;
		
	}
	function placeIt(elem, leftPos, topPos) {
		
		docObj = eval(doc + elem + sty);
		//alert(docObj);
		if(n4 || n6){
			docObj.left = leftPos;
			docObj.top  = topPos;  
		} else if(ie) {
			docObj.pixelLeft = leftPos;
			docObj.pixelTop  = topPos; 
		}
	}
	
	function searchfocus(){
		//docObj = eval(doc + 'searchform' + sty);
		document.searchform[0].focus();
		
		
	}
	function measurewindow(){
		alert('width:     \t\t' + win_width + '\n' +
			'height:    \t\t' + win_height + '\n' +
			'hor center:\t' + centerhor + '\n' + 
			'ver center:\t' + centerver + '\n');
		
		
	}
	function showhide(elem, state) {
	
		docObj = eval(doc + elem + sty);
		
		//docObj.visibility = state;
		docObj.display = state;
	
	}
	
	var active_submenu1 = null;
	var active_submenu2 = null;
	var active_menuelem = null;
	var active_topelem = null;
	
	function closeallmenus() {
		if (active_submenu1 != null){
			//showhide(active_submenu1, 'hidden');
			showhide(active_submenu1, 'none');
		}
		if (active_submenu2 != null){
			//showhide(active_submenu2, 'hidden');
			showhide(active_submenu2, 'none');
		}
	}
	
	//the menu close timeout variable
	var menu_close_timeout = 0;
	
	//delay in msecs until all open menues are closed
	var delay = 300;
	
	//function calls the cloaseallmenus() function after delay
	function closeall() {
		menu_close_timeout = setTimeout('closeallmenus()', delay);
	}
	function closeallnow() {
		menu_close_timeout = setTimeout('closeallmenus()', 100);
	}
	//stop all time functions (stops menus from closing)
	function stopall(){
		clearTimeout(menu_close_timeout);
	}
	function controlsubmenu(submenu1, submenu2){
		stopall();
		closeallmenus();
		if(submenu1 != null) {
			//showhide(submenu1, 'visible');
			showhide(submenu1, 'block');
			active_submenu1 = submenu1;
		}
		if(submenu2 != null) {
			//showhide(submenu2, 'visible');
			showhide(submenu2, 'block');
			active_submenu2 = submenu2;
		}
	}
	
	

function PopUp(url,name,width,height) {
	var winX = 0;
	var winY = 0;
	var w = width;
	var h = height;
	// only set new values if 4.0 browser
	if (parseInt(navigator.appVersion) >= 4) {
		winX = (screen.availWidth - w)*.85;
		winY = (screen.availHeight - h)*.85;
	}
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h + ',left=' + winX + ',top=' + winY);
}



