<!--//--><![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 f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function popOpen(id) {
	var topOffset = 1;
	setSize(topOffset);
	// pw = pw + document.documentElement.scrollLeft;
	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 = f_clientWidth() + 'px';
	// overShade.style.height = f_clientHeight() + 'px';
	overShade.style.height = '100%';
	overShade.style.paddingTop = topPad + 'px';
	overShade.style.left = f_scrollLeft() + 'px';
	overShade.style.display = 'block';
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/)) {
		coverSelects(overShade);
	}
}

function popClose(id) {
	var fObj = document.getElementById(id);
	fObj.style.display = "";
	//end Added by Sarun
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/)) {
		document.getElementById("popup-cover").outerHTML = "";
	}
}

function popOpenFlash(id) {
	var topOffset = 1;
	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';
	fo.write(tempID); // moved from customFunctions.cfc to reinitiate the original flash
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/)) {
		coverSelects(overShade);
	}
}
function popCloseFlash(id) {
	
	//Added by Sarun to correct IE problem where Flash won't stop playing after popup is closed
	// Solved by loading an empty flash into the original flash memory
	// The original flash will be reloaded in popOpen
	var flashObj = document.getElementById(id);
	fooo.write(tempID); //replace the original flash with an empty one to stop the original flash
	flashObj.style.display = "";
	//end Added by Sarun
	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
}
