// browser detection
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

// opens a popup window centered in user's screen
function popCenter (page, name, w, h, scroll) {
	 var winl = (screen.width - w) / 2;
	 var wint = (screen.height - h) / 2;
	 winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',';
	 win = window.open(page, name, winprops);
	 win.focus();
}

// rollover function for GIF images
function changeImage(which) { 
	myImgSrc = document.getElementById(which);
	buttonStatus = myImgSrc.src.substring(myImgSrc.src.length -6, myImgSrc.src.length -4);
	if (buttonStatus == 'of') myImgSrc.src = myImgSrc.src.substring(myImgSrc.src.length -6,0) + 'on.gif';
	else if (buttonStatus == 'in') myImgSrc.src = myImgSrc.src.substring(myImgSrc.src.length -6,0) + 'in.gif';
	else myImgSrc.src = myImgSrc.src.substring(myImgSrc.src.length -6,0) + 'of.gif';
}

// show & hide a layer
function DisplayLayer(LayerChoice) {
	if (ie4) {
		if(document.all[LayerChoice].style.display == "none") {
			document.all[LayerChoice].style.display = "block";
		}
		else {
			document.all[LayerChoice].style.display = "none";
		}
	}
	if (ns4) {
		if(document.layers[LayerChoice].display == "hide") {
			document.layers[LayerChoice].display = "Show";
		}
		else {
			document.layers[LayerChoice].display = "hide";
		}
	}
	if (ns6) {
		if(document.getElementById([LayerChoice]).style.display == "none") {
			document.getElementById([LayerChoice]).style.display = "block";
		}
		else {
			document.getElementById([LayerChoice]).style.display = "none";
		}
	}
}

// hide submenu3 (if it's opened) when you show submenu4
function closeMenuSection3() {
	if (ie4) 
		{ document.all['menuSection3'].style.display = "none"; }
	if (ns4) 
		{ document.layers['menuSection3'].display = "hide"; }
	if (ns6) 
		{ document.getElementById(['menuSection3']).style.display = "none"; }
}

// hide submenu4 (if it's opened) when you show submenu3
function closeMenuSection4() {
	if (ie4) 
		{ document.all['menuSection4'].style.display = "none"; }
	if (ns4) 
		{ document.layers['menuSection4'].display = "hide"; }
	if (ns6) 
		{ document.getElementById(['menuSection4']).style.display = "none"; }
}