// JavaScript Document

// CMshowAndHide combines CMshowLayer and CMhideLayer
// The point is to generate a function prevents adjacent menus from interfering with one another
// Arg 1: The layer to be revealed
// Arg 2: The number of milliseconds before that happens
// Arg 3: the layer above this one that needs to be hidden
// Arg 4: the layer below this one that needs to be hidden
// *Some browsers (notably the browser engine in Adobe Contribute CS3)
// will not allow NULL arguments and will throw errors.
function CMshowAndHide(showIt, waitForIt, hideAbove, hideBelow) {
	if (document.layers) {
		showCommand = "document." + showIt + ".display = 'block'";
		hideCommandA = "document." + hideAbove + ".display = 'none'";
		hideCommandB = "document." + hideBelow + ".display = 'none'";
	} else if (document.all) {
		showCommand="document.all." + showIt + ".style.display='block';";
		hideCommandA="document.all." + hideAbove + ".style.display='none';";
		hideCommandB="document.all." + hideBelow + ".style.display='none';";
	} else if (document.getElementById) {
		showCommand = "document.getElementById('" + showIt + "').style.display = 'block'";
		hideCommandA = "document.getElementById('" + hideAbove + "').style.display = 'none'";
		hideCommandB = "document.getElementById('" + hideBelow + "').style.display = 'none'";
	}
	if (hideAbove != '') {
		eval(hideCommandA);
	}
	if (hideBelow != '') {
		eval(hideCommandB);
	}
	setTimeout("eval(showCommand)", waitForIt);
}

// CMhshowLayer
// This function simply changes the display of the specified element to block
// Arg 1: The element to be revealed
// Arg 2: The number of milliseconds before that happens
function CMshowLayer(showIt, waitForIt) {
	if (document.layers) {
		hideCommand = "document." + showIt + ".display = 'block'";
	} else if (document.all) {
		hideCommand="document.all." + showIt + ".style.display='block';";
	} else if (document.getElementById) {
		hideCommand = "document.getElementById('" + showIt + "').style.display = 'block'";
	}
	setTimeout("eval(hideCommand)", waitForIt);
}

// CMhideLayer
// This function simply changes the display of the specified element to HIDDEN
// Arg 1: The element to be hidden
// Arg 2: The number of milliseconds before that happens
function CMhideLayer(hideIt, waitForIt) {
	if (document.layers) {
		hideCommand = "document." + hideIt + ".display = 'none'";
	} else if (document.all) {
		hideCommand="document.all." + hideIt + ".style.display='none';";
	} else if (document.getElementById) {
		hideCommand = "document.getElementById('" + hideIt + "').style.display = 'none'";
	}
	setTimeout("eval(hideCommand)", waitForIt);
}