<!--//--><![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 winpopup(url)
{
	var newwindow=window.open(url,'3dspinner','height=500,width=650');
	if (window.focus) {newwindow.focus()}
}

function popUp(argURL, argWIDTH, argHEIGHT) {
	 var winArg, popWin;
	 if (!argWIDTH) argWIDTH = '500';
	 if (!argHEIGHT) argHEIGHT = '500'; 
	 winArgs='width='+argWIDTH+',height='+argHEIGHT+',titlebar=0,toolbar=0,location=0,menubar=0,';
	 winArgs +='scrollbars=0,resizable=1,channelmode=0,directories=0,status=0,screenX=20,screenY=20,top=20,left=20';
	 popWin = window.open(argURL,'', winArgs, true);
}

function popOpen(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'; 	
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/) && !navigator.userAgent.match('Opera')) { 
		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/) && !navigator.userAgent.match('Opera')) {
		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/) && !navigator.userAgent.match('Opera')) {
		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/) && !navigator.userAgent.match('Opera')) {
		document.getElementById("popup-cover").outerHTML = "";
	}	
}

function popOpenFlashHowto(id,flashid) {
	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';
	window[flashid].write(flashid); // moved from customFunctions.cfc to reinitiate the original flash
	
	if (document.all && !navigator.appVersion.match(/MSIE 7.0/) && !navigator.userAgent.match('Opera')) {
		coverSelects(overShade);
	}
}

function popCloseFlashHowto(id,flashidd) {
	//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(flashidd); //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/) && !navigator.userAgent.match('Opera')) {
		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
}
