// Show description divs
function showDiv(div) {
	if (document.getElementById) {
		if (document.getElementById(div)) document.getElementById(div).style.display = "block";
	}
}

// Hide description divs
function hideDiv(div) {
	if (document.getElementById) {
		if (document.getElementById(div)) document.getElementById(div).style.display = "none";
	}
}

// Set up frames on loading new lab
function setLab(div, col) {
	if (top.edgeFrame) {
		if (top.edgeFrame.document.body) {
			if (top.edgeFrame.document.body.style) {
				top.edgeFrame.document.body.style.backgroundColor = col;
			}
		}
	}
	if (top.menuFrame) {
		if (top.menuFrame.hideDiv) {
			top.menuFrame.hideDiv(top.menuFrame.thisDiv);
			if (top.menuFrame.thisDiv != "default") top.menuFrame.hideDiv(top.menuFrame.thisDiv + "More");
			top.menuFrame.hideDiv(top.menuFrame.overDiv);
			top.menuFrame.thisDiv = top.menuFrame.overDiv = div;
			top.menuFrame.showDiv(div);
			if (div != "default") top.menuFrame.showDiv(div + "More");
		}
	}
}

// Lab page Flash-to-JavaScript for status bar links
function lab_DoFSCommand(cmd, args) {
	if (cmd == "statusOn") {
		hideDiv(thisDiv);
		hideDiv(overDiv);
		overDiv = args.split("&")[0];
		showDiv(overDiv);
		if (args == "back") {
			var parent = neaveURL.substr(0, neaveURL.lastIndexOf("/"));
			window.status = parent.substr(0, parent.lastIndexOf("/") + 1);
		}
		else window.status = neaveURL + args.split("&")[1];
	}
	if (cmd == "statusOff") {
		hideDiv(args);
		hideDiv(overDiv);
		showDiv(thisDiv);
		window.status = "";
	}
}

wlh = unescape(window.location.href);
pos = wlh.indexOf("menu_frame.");
neaveURL = (pos == -1) ? wlh : wlh.substr(0, pos);

if (pos != -1) overDiv = thisDiv = "default";

if (navigator.appName.indexOf("Microsoft") != -1) {
	document.write('<script type="text/vbscript">\n' +
	'Sub lab_FSCommand(ByVal cmd, ByVal args)\n' +
	'Call lab_DoFSCommand(cmd, args)\n' +
	'End Sub\n' +
	'</script>\n');
}
