// Begin cascading menu script
// Adapted by Jay Small, smallinitiatives.com
// from "Javascript + CSS + DOM Magic" by Makiko Itoh (good book!).
// For efficiency, SI version removes image rollover functions,
// color switcher functions (handled in CSS instead)
// and functions for menu positioning based on window size.

// 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;

// detecting browser support for certain key objects/methods and 
// assembling 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;
}

// show or hide DIV element

function showhide(divname,state) {
	if (n4) {
		divObj = eval (doc + divname);
	}
	else {
		divObj = eval (doc + divname + sty);
	}
	divObj.visibility = 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;

// variable to flag whether there is an active tertnav menu

var active_tertnavmenu = null;

// function closes all active menus and turns back to 'off' state

function closeallmenus() {
	if (active_submenu1 != null) {
		showhide(active_submenu1,'hidden');
	}
	if (active_submenu2 != null) {
		showhide(active_submenu2,'hidden');
	}
}

// the menu close timeout variable

var menu_close_timeout = 0;

// delay in milliseconds until the open menus are closed

var delay = 400;

// function calls the closeallmenus() function after a delay

function closeall() {
	menu_close_timeout = setTimeout('closeallmenus()',delay);
}

// stop all timeout functions (stops menus from closing)

function stopall(tertmenuflag) {
	clearTimeout(menu_close_timeout);
// if tertmenuflag has a value, it's tertnav menu and should not execute next part
	if ((tertmenuflag == null) && (active_tertnavmenu != null)) {
		showhide(active_tertnavmenu,'hidden');
		active_tertnavmenu = null;
	}
}

// function controls submenus

function controlsubmenu(submenu1,submenu2) {
	stopall();
	closeallmenus();
	if (submenu1 != null) {
		showhide(submenu1,'visible');
		active_submenu1 = submenu1;
	}
	if (submenu2 != null) {
		showhide(submenu2,'visible');
		active_submenu2 = submenu2;
		active_tertnavmenu = submenu2;
	} 
}
// End cascading menu script

// begin marketwatch charts and tools scripts

var qcnURL	= 'http://www.businessjournalism.org/mw/charts/index.cfm'; 
var profileURL 	= 'http://www.businessjournalism.org/mw/profile/index.cfm'; 
var finURL 	= 'http://www.businessjournalism.org/mw/financials/index.cfm'; 
var secURL 	= 'http://www.businessjournalism.org/mw/secfilings/index.cfm';

// End marketwatch charts and tools scripts
