// START tab script
// Adapted from "Javascript + CSS + DOM Magic" by Makiko Itoh

// define variables for "if n4 (Netscape 4), if IE (IE 4.x), 
// and if n6 (if Netscape 6/W3C-DOM compliant)"

var n4, ie, n6;

// detect browser support for certain key objects/methods 
// and assemble a custom document object

var doc,doc2,doc3,sty;

if (document.layers) {
	doc = "document.";
	doc2 = ".document.";
	doc3 = "";
	sty = "";
	n4 = true;
} else if (document.all) {
	doc = "document.all.";
	doc2 = "";
	doc3 = "";
	sty = ".style";
	ie = true;
} else if (document.getElementById) {
	doc = "document.getElementById('";
	doc2 ="')";
	doc3 ="')";
	sty = "').style";
	n6 = true;
}

// display block or none DIV element

function blocknone(divname,state) {
	if (!n4) {
		divObj = eval (doc + divname + sty);
	}
	else {
		divObj = eval (doc + divname);
	}
	divObj.display = state;
}

// variables that hold the value of the currently active (open) menu

var active_submenu1 = null;
var active_submenu2 = null;
var active_menuelem = null;
var active_topelem = null;

// function closes all active menus and turns back to 'off' state

function closeallmenus() {
	if (active_submenu1 != null) {
		blocknone(active_submenu1,'none');
	}
	if (active_submenu2 != null) {
		blocknone(active_submenu1,'none');
	}
}

// the menu close timeout variable

var menu_close_timeout = 0;

// stop all timeout functions (stops menus from closing)

function stopall(tertmenuflag) {
	clearTimeout(menu_close_timeout);
}

// function controls submenus

function controlsubmenu(submenu1,submenu2) {
	stopall();
	closeallmenus();
	if (submenu1 != null) {
		blocknone(submenu1,'block');
		active_submenu1 = submenu1;
	}
	if (submenu2 != null) {
		blocknone(submenu2,'block');
		active_submenu2 = submenu2;
	} 
}