function enableDropDown(elementId) {
	var navRoot = document.getElementById(elementId);
	for (i = 0; i < navRoot.childNodes.length; i++) {
		var menuItem = navRoot.childNodes[i];
		if (menuItem.nodeName == "LI") {
			menuItem.onmouseover = function() {
				this.image.src = '/images/' + this.image.id + '_over.png';
				this.className = "over";
			}
			menuItem.onmouseout = function() {
				this.image.src = '/images/' + this.image.id + '.png';
				this.className = "";
			}

			for (j = 0; j < menuItem.childNodes.length; j++) {
				var pullDownOrLink = menuItem.childNodes[j];
				if (pullDownOrLink.nodeName == "UL") {
					var pullDown = pullDownOrLink;
					for (k = 0; k < pullDown.childNodes.length; k++) {
						var pullDownItem = pullDown.childNodes[k]; // li
						if (pullDownItem.childNodes.length > 0) {
							var pullDownItemLink = pullDownItem.childNodes[0];
							pullDownItemLink.menuItem = menuItem;

							pullDownItemLink.onmouseover = function() {
								this.menuItem.image.src = '/images/' + this.menuItem.id + '_over.png';
							}

							pullDownItemLink.onmouseout = function() {
								this.menuItem.image.src = '/images/' + this.menuItem.id + '.png';
							}
						}
					}
				}
				if (pullDownOrLink.nodeName == "A") {
					var link = pullDownOrLink;
					if (link.childNodes.length > 0) {
						if (link.childNodes[0].nodeName == "IMG") {
							menuItem.image = link.childNodes[0];
						}
					}
				}
			}
		}
	}
}

function popup(pageUrl, width, height) {
	var left = screen.width / 2 - width / 2;
	var top = screen.height / 2 - height / 2;
	
	window.open(pageUrl, '', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ",scrollbars=yes,resizable=no");
}

function popupNS(pageUrl, width, height) {
	var left = screen.width / 2 - width / 2;
	var top = screen.height / 2 - height / 2;
	
	window.open(pageUrl, '', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ",scrollbars=no,resizable=no");
}

function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i = 0; i < anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank"; 
		}
	}
}
