/* added to all body onload calls */

function onpageload()
{
	startList();
}

/* popup functions */
function pop(URL) {
	newWindow = window.open(URL,'_blank','toolbar=no,location=no,scrollbars=no,resize=no,width=600,height=430,screenX=0,screenY=100,top=0,left=100');
}

function pop_sm(URL) {
	newWindow = window.open(URL,'_blank','toolbar=no,location=no,scrollbars=no,resize=no,width=340,height=360,screenX=0,screenY=100,top=0,left=100');
}

function showsite(val)
{
	if(val){
		this.open(val);
	}
}

/* dropdown menu javascript (rest handled by css) */
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = getNavigationElement();
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/-/g, "\-");
	var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

function getNavigationElement()
{
	return getElementsByClassName(document, "ul", "sections")[0];
}
