<!--
//-----START COLLAPSIBLE LIST FUNCTION
var openId = "";
var ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
function toggle( myId )
{
	if (ie4)
	{
		thisId=document.all(myId);
		if (thisId.style.display == "none")
		{
			thisId.style.display = "";
			if (openId != "")
			{
				openId.style.display = "none";
			}
			openId = thisId;
		}
	else
		{
			thisId.style.display = "none";
			openId = "";
		}
	}
}
//-----END COLLAPSIBLE LIST FUNCTION


//-----START QUICKLINKS FORM HANDLER
function formHandler(form)
{
	var URL = document.headerform.site.options[document.headerform.site.selectedIndex].value;
	if (URL != "")
	{
		window.location.href = URL;
	}
}
//-----END QUICKLINKS FORM HANDLER


//***** START DOWNTIME NOTICE CODE *****
	var downtime_bool = false; //change this to true for downtime notice to appear.
	if(downtime_bool) {
		beginPosition = CheckCookie('Downtime');
		if (beginPosition != -1)
		{
			//true
		}
		else
		{
			SetCookie('Downtime','This is a notice of downtime for this server.','/',null,null,null)
			var downtimealert = "Website Maintenance Notice:" + "\n\n"
			downtimealert = downtimealert + "Our website will be temporarily unavailable for planned\n"
			downtimealert = downtimealert + "preventative maintenance from 9 p.m Friday,\n"
			downtimealert = downtimealert + "September 19  to 6 a.m. Sunday, September 21." + "\n\n"
			downtimealert = downtimealert + "We thank you for your patience." + "\n\n"
			alert(downtimealert);
		}
	}
//***** END DOWNTIME NOTICE	CODE *****
//


//-----START NEW_WINDOW CODE
function displayPopup(url, height, width)
{
	properties = "toolbar=0,location=0,menubar=0,scrollbars=1,status=0,resizable=yes,height=" + height;
	properties = properties + ",width=" + width;
	properties = properties + ",left=0,top=0";
	var title = "" + url;
	title = title.substring(1,5);
	popupHandle = window.open(url, title, properties);
	if (popupHandle && popupHandle.open && !popupHandle.closed)
	{
		popupHandle.focus();
	}
	// VARIABLES
	// toolbar			boolean	display a toolbar 
	// location		boolean	display the location text box 
	// directories	boolean 	display the special link buttons 
	// status			boolean	display a status bar 
	// menubar			boolean	display the menus at the top of the window 
	// scrollbars		boolean	display scrollbars if the document is larger than the window 
	// resizeable		boolean	allow the window to be resized 
	// width			integer	the width of the window (in pixels) 
	// height			integer	the height of the window (in pixels) 
	// top				integer	the top position of the window (in pixels) 
	// left			integer	the left position of the window (in pixels) 
}
//-----END NEW_WINDOW CODE

//-----START PAGE COUNT CODE
function CheckPageCount()
{
	beginPosition = CheckCookie('PageCount=1');
	if(beginPosition != -1)
	{
		SetCookie('PageCount','2','/',null,null,null);
		return 2;
	}
	beginPosition = CheckCookie('PageCount=2');
	if(beginPosition != -1)
	{
		SetCookie('PageCount','3','/',null,null,null);
		return 3;
	}
	SetCookie('PageCount','1','/',null,null,null);
	return 1;
}
//-----END PAGE COUNT CODE


//-----START SURVEY CODE
// change to true if survey is not started with traditional page link.
var SurveyON = 'FALSE';
if (SurveyON == 'TRUE') {
	beginPosition = CheckCookie('SESurveyStatus=COMPLETE')
	if (beginPosition != -1)
	{
		//true...survey already completed. DO NOT PROMPT AGAIN.
	}
	else
	{
		beginPosition = CheckCookie('SESurveyStatus=NO')
		if (beginPosition != -1)
		{
			//true...customer already said no to survey.
		}
		else
		{
			pagecount = CheckPageCount();
			if(pagecount == 3)
			{
				remoteStart('/survey/survey.asp');
			}
		}
	}
}

//----- START Dialog Functions -----
var remote = null;
function remoteStart(x)
{
	if (x == "/services/energuidesvcreq.asp") {
		var height = "500";
	}else{
		height = "460";
	}
	remote = eval("window.open('', 'TheRemote','width=500,height=" + height + ",resizable=1')");
	if (remote != null)
	{
		if (remote.opener == null)
		{
			remote.opener = self;
		}
		remote.location.href = x;
		if (remote && remote.open && !remote.closed)
		{
			remote.focus();
		}
	}
}
//----- END Dialog Functions -----
//-----END SURVEY CODE


function saveFocus(pFormName, pControlName, pMulti, pOverrideFocus, pPostBack){
	var name;
	var index;
	/*
	* Note: pMulti can be false or a 1 based index for the control to receive focus.
	* Ideally a 0 based index would be more consistent with JavaScript, but the 1 based
	* index was used to maintain backward compatibility with previous "saveFocus" 
	* versions.
	*/
	if(pMulti){
		index = pMulti - 1;
		name = pControlName + "[" + index  + "]";
	} else {
		name = pControlName;
	}
	if(pPostBack){
		eval("document." + pFormName + ".postback.value = 1");		
	}
	if(name != "" && (eval("document." + pFormName + ".focus.value") == "" || pOverrideFocus)){
		eval("document." + pFormName + ".focus.value = '" + pFormName + "." + name + "'");	
	}
	eval("document." + pFormName + ".scX.value = " + getX());
	eval("document." + pFormName + ".scY.value = " + getY());
	
}

function setFocus(pFormName, pControlName, pMulti){
	var name;
	if(pMulti >= 0){
		name = pControlName + "[" + pMulti + "]";
	} else {
		name = pControlName;
	}
	eval("document." + pFormName + ".focus.value = '" + pFormName + "." + name + "'");	
}

//-->