IE4=!!document.all
W3C=DOM=!!document.getElementById
NS4=!!document.layers

function t_getelement(id){
	return W3C?document.getElementById(id):
		IE4?document.all[id]:
		NS4?document[id]:false;
}

function show(layernavn) {
var el = t_getelement(layernavn);
if(el)
	el.style.visibility="visible";
else
	document.layers[layernavn].visibility = "show";		
}

function hide(layernavn) {
var el = t_getelement(layernavn);
if(el)
	el.style.visibility="hidden";
else
	document.layers[layernavn].visibility = "hide";
}


function validEmail(email) {
	invalidChars = " /:,;"
	if (email == "") {
	    return false
	}

	for (i=0; i<invalidChars.length; i++) {
	    badChar = invalidChars.charAt(i)
	    if (email.indexOf (badChar,0) != -1) {
	        return false
	    }
	}  // for (i=o.. 
	
	atPos = email.indexOf ("@",1)
	
	if (atPos == -1) {
	    return false
	}
	
	if ( email.indexOf ("@", atPos+1) != -1) {
	    return false
	}
	periodPos = email.indexOf (".", atPos)
	
	if ( periodPos == -1) {
	    return false
	}
	
	if ( periodPos+3 > email.length)    {
	    return false
	}
	return true
}  // validEmail 

startList = function() {
	// only MSIE supports document.all
	if (document.all) {
		// Get all the list items within the menu
		navRoot = document.getElementById("mainMenu");
		/*
			if there is more than one ITEM in the mainMenu Unordered List,
			loop through the List to see if there is any List Item.
		*/
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			/*
				if there is more List Item (LI) when on mouseover action,
				use CSS style "#mainMenu li.over ul" to display for IE browser.
			*/
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				//else use CSS style "#mainMenu li:hover ul" to display for other browsers.
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

//when the page is loaded on to the browser, if it is Internet Explorer, the javascript is runned and starts processing the webpage.
window.onload=startList;