function addLoadEvent(func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function') { 
		window.onload = func; 
	} else { 
		window.onload = function() { 
			oldonload(); 
			func(); 
		}
	} 
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("globalNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.childNodes.length > 0) {
				for (j=0; j<node.childNodes.length; j++) {
					thisChildNode = node.childNodes[j];
					if (thisChildNode.nodeName=="LI" && thisChildNode.className!="active") {
						thisChildNode.onmouseover=function() {
							this.className+=" over";
						}
						thisChildNode.onmouseout=function() {
							this.className=this.className.replace(" over", "");
						}
					}
				}
			}
		}
	}
}
 
addLoadEvent(startList);


function switchLanguage(whichLanguage) {
	strConfirmText = "You will be re-directed to the home page of the " + whichLanguage + " site. Click OK to continue or Cancel to stay on this page.";
	if (confirm(strConfirmText)) {
		// perform the redirect
		if(whichLanguage == "English") {
			window.location = "/EN/";
		}else if(whichLanguage == "Japanese") {
			window.location = "/JP/";
		}else if(whichLanguage == "French") {
			window.location = "/FR/";
		}else if(whichLanguage == "Portugeuse") {
			window.location = "/PT/";
		}else if(whichLanguage == "Spanish") {
			window.location = "/SP/";
		}
	}
}

function clearSearchContents(whichItem) {
	document.getElementById(whichItem).value = "";
}

function setDefaultSearchContents(whichItem) {
	document.getElementById(whichItem).value = "Search";
}

function toggleItemVisibility(whichItem) {
	if (document.getElementById(whichItem).style.display == "block") {
		document.getElementById(whichItem).style.display = "none";
	} else {
		document.getElementById(whichItem).style.display = "block";
	}
}

function toggleItemIndicator(whichItem) {
	if (whichItem.className == "collapsibleItemLink") {
		whichItem.className = "collapsibleItemActiveLink";
	} else {
		whichItem.className = "collapsibleItemLink";
	}
}