var newWin;
function newWindow(url, w, h) {
	if (newWin != null && newWin.closed == false) {
		newWin.close();
	}

	newWin = window.open(url,'win','scrollbars=yes,resizable=yes,titlebar=yes,WIDTH='+w+',HEIGHT='+h);
}

function go(url) {
	location.href=url;
}

var CURRENT_NAV_ID;
function hilitePageNav(elementId) {
	CURRENT_NAV_ID = elementId;
	hiliteNav(elementId);
}

function hiliteNav(elementId) {
	var ob;
	if (typeof elementId != "undefined" && elementId != "" && elementId.indexOf("footer") == -1) {
		ob = document.getElementById(elementId);
	} else if (typeof CURRENTOBJ!="undefined") {
		ob = CURRENTOBJ;
	}

	if(typeof ob != "undefined" && ob != null) {
		var children = ob.childNodes;
		
		for(var i=0;i<children.length;i++) {
			var e = children[i];
			if(e.tagName == "IMG") {
			var src = e.src;
			if(src.indexOf("ON.") == -1) {
				var newsrc = src.substr(0,src.length-4) + "ON" + src.substr(src.length-4);
				e.src = newsrc;
			}
			}
		}
	} else {
		return;
	}
	
	showShadow(CURRENTDROPDOWN);
}

function deliteNav() {
	if (typeof CURRENTOBJ!="undefined") {
		if( (typeof CURRENT_NAV_ID == "undefined") || (typeof CURRENT_NAV_ID != "undefined" && CURRENT_NAV_ID != '' && CURRENTOBJ.id != CURRENT_NAV_ID) ) {
			if(CURRENTOBJ.id.indexOf("footer") == -1) {
				var children = CURRENTOBJ.childNodes;
				
				for(var i=0;i<children.length;i++) {
					var e = children[i];
					if(e.tagName == "IMG") {
					var src = e.src;
					if(src.indexOf("ON.") != -1) {
						var newsrc = src.substr(0,src.length-6) + src.substr(src.length-4);
						e.src = newsrc;
					}
					}
				}
			}
		}
	}
	hideShadow();
}

function hideShadow() {
	if (typeof CURRENTDROPDOWN != "undefined") {
		if(typeof CURRENTDROPDOWN.parentNode != "undefined") {
				var nodesToRemove = new Array();
				var children = CURRENTDROPDOWN.parentNode.childNodes;
				for(var i=0;i<children.length;i++) {
					if(children[i].id == 'shadow' || children[i].id == 'shadow1') {
						nodesToRemove.push(children[i]);					
					}
				}
				for(var i=0;i<nodesToRemove.length;i++) {
					CURRENTDROPDOWN.parentNode.removeChild(nodesToRemove[i]);
				}
		}
	}
}

function stripOutChars(field) {
	var val = field.value;
	var newVal = '';
	for(var i=0;i<val.length;i++) {
		var c = val.charAt(i);
		if(c != null) {
			var isChar = isNaN(c);
			if(!isChar && c != ' ' || (c == '.')) {
				newVal += c;
			}
		}
	}
	field.value = newVal;
}

function showShadow(obj) {

	if(typeof obj != "undefined" && typeof obj.style != "undefined") {

		shadow1 = obj.cloneNode(true);
		shadow1.style.left = (parseInt(shadow1.style.left))+2+"px";
		shadow1.style.top = (parseInt(shadow1.style.top))+2+"px";
		shadow1.style.backgroundColor = "black";
		shadow1.style.zIndex=1;
		shadow1.style.backgroundImage="none";
		shadow1.style.filter="alpha(opacity=15)";
		shadow1.style.opacity=".15";
		shadow1.id = "shadow1";

		shadow = obj.cloneNode(true);
		shadow.style.left = (parseInt(shadow.style.left))+1+"px";
		shadow.style.top = (parseInt(shadow.style.top))+1+"px";
		shadow.style.backgroundColor = "black";
		shadow.style.zIndex=2;
		shadow.style.backgroundImage="none";
		shadow.style.filter="alpha(opacity=30)";
		shadow.style.opacity=".3";
		shadow.id = "shadow";

		obj.parentNode.appendChild(shadow1);
		obj.parentNode.appendChild(shadow);

	}

}
