<!--//--><![CDATA[//><!--

navList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		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", "");
				}
			}
		}
	}
}
window.onload=navList;

//--><!]]>

/* clear field value function: removes the default value onfocus, and adds back if nothing entered */
function fieldClear(obj) {
	if(obj.Val) {
		if (obj.value == '') { 
			obj.value = obj.Val;
			obj.Val = null;
			obj.first = null;
		} 
		else {
			obj.Val = null;
		}
	} else if (!obj.first) { 
		obj.Val = obj.value;
		obj.value = ''; 
		obj.first = 'true';
	} 
}

function popOpen(id) {
	var topOffset = 20;
	setSize(topOffset);
	var overShade = document.getElementById(id);
	var topPad =  pos+topOffset;
	// height-padding = div height
	overShade.style.height = (ph - topPad) + 'px'; /* remove topPad from height */
	overShade.style.width = pw + 'px';
	overShade.style.paddingTop = topPad + 'px';
	overShade.style.display = 'block';
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/)) {
		coverSelects(overShade);
	}
}
function popClose(id) {
	document.getElementById(id).style.display = "";
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/)) {
		document.getElementById("popup-cover").outerHTML = "";
	}
		
}
function setSize(topOffset) { /* sets size of shade */
	if (window.pageYOffset != null) { /* moz and safari */
		pos = window.pageYOffset;
		ph = document.documentElement.scrollHeight;
		pw = document.documentElement.scrollWidth;
		if (document.body.scrollHeight > document.documentElement.scrollHeight) {
			ph = document.body.scrollHeight;
			pw = document.body.scrollWidth;
		}
	} else if (document.documentElement.scrollTop > document.body.scrollTop) { /* ie, catch if Standards compliance mode */
		pos = document.documentElement.scrollTop;
		ph = document.documentElement.scrollHeight;
		pw = document.documentElement.scrollWidth;
		if (document.documentElement.clientHeight > document.documentElement.scrollHeight) {
			ph = document.documentElement.clientHeight;
		}
	} else if (document.body != null) { /* if IE 5.5 */
		pos = document.body.scrollTop;
		ph = document.body.scrollHeight;
		pw = document.body.scrollWidth;
		if (document.documentElement.scrollHeight > document.body.scrollHeight) {
			ph = document.documentElement.scrollHeight;
		}
		ph = ph + pos + topOffset; /* fix box model */
	}
}	

/* covers select form elements with iframe in IE 6&< so they do not show through the popup */
function coverSelects(par) {
		var covHeight = document.body.scrollHeight+"px"; // add the negative margin to the height
		var coverFrame = "<IFRAME id='popup-cover' style='";
		coverFrame = coverFrame + "height:"+covHeight+";' ";
		coverFrame = coverFrame + "src='javascript:false;' frameBorder='0' scrolling='no'></IFRAME>";
		par.insertAdjacentHTML("afterEnd",coverFrame); // create new iframe that is the size of the popup window
}

/* popup window for Email to a friend */
var newWindow = null
function makeNewWindow(theURL,winName,features) { 
		//test to see if window aleady exists
	if (!newWindow || newWindow.closed) {
		newWindow = window.open(theURL,winName,features);
	} else {
		//window exists, so load the proper page and bring it forward
		newWindow = window.open(theURL,winName,features);
		newWindow.location = theURL
		newWindow.focus();
	}
}
