

var serverName, onPowerWatch, isSecure, browser;

function setupPageVars() {
	
	serverName = "SHE-";
	onPowerWatch = getCookie("onPowerWatch");
	isSecure = "off".toUpperCase() == "ON";
	browser = "";
}

function getCookie(name) {
	var dcookie = document.cookie; 
	var cname = name + "=";
	var clen = dcookie.length;
	var cbegin = 0;
	while (cbegin < clen) {
		var vbegin = cbegin + cname.length;
		if (dcookie.substring(cbegin, vbegin) == cname) { 
			var vend = dcookie.indexOf (";", vbegin);
			if (vend == -1) vend = clen;
			return unescape(dcookie.substring(vbegin, vend));
		}
		cbegin = dcookie.indexOf(" ", cbegin) + 1;
		if (cbegin == 0) break;
	}
	return null;
}

function doPopup() {
	if (onPowerWatch == 0 || onPowerWatch == null) return;
	
	var cvalue = getCookie("popupPowerWatch");
	var expdate = new Date();
	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000)); 
	if (cvalue == null || parseInt(cvalue) == 0) {
		document.cookie = "popupPowerWatch=1; path=/";
		var popupPW = window.open('/popup/popupPowerWatch2.cfm','popupPowerWatch','width=265,height=350');
		popupPW.focus();
	}
}
setupPageVars();
doPopup();

// begin aquifer information popup.
// Note: this block is also located in /include/popupHomepages.asp

function aquiferPopup() {
	
	if (document.location.href.indexOf("aquifer") > 0) {
		document.cookie = "aquifer = 1; path=/";
		return;
	}
	
	var cvalue = getCookie("aquifer");
	// Adjust the winopts as needed to size and define window features.
	var winopts = "width=265,height=350,scrollbars=0,toolbar=0,resizable=0";
	if (cvalue == null || parseInt(cvalue) == 0) {
		var popAquifer = window.open('/riversrec/aquifer/popup.cfm', 'popAquifer', winopts);		
		if (popAquifer) {
			popAquifer.focus();
			document.cookie = "aquifer=1; path=/";
		} else { // popup has been blocked by the browser or another tool. 
			var msg = "The Idaho Power Web site has attempted to open a new\r\n"
					+ "browser window to provide you with valuable information\r\n"
					+ "that may directly influence the cost of energy to our \r\n"
					+ "customers.\r\n\r\nWe strongly recommend that you view this\r\n"
					+ "information so you can be more informed regarding issues\r\n"
					+ "that can have a direct impact on your energy costs.\r\n\r\n"
					+ "Click \"OK\" to view this information\r\n"
					+ "otherwise click \"Cancel\"\r\n";
			//if (confirm(msg)) {
			//	document.location.href = "http://www.idahopower.com/riversrec/aquifer";
			//}		
		}
	}
}
// Comment out the line below when no longer needed.
//aquiferPopup();
// End aquifer information popup.
// No Flash

function checkpg() {
	var cvalue = getCookie("aquifer");

	if ((location.href.toLowerCase().indexOf('/energycenter/powerwatch/info.cfm')<0) && (cvalue == null || parseInt(cvalue) == 0)) {
	  self.focus();
	}
}


self.name='ipco';

function imgOn(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "On.src");
	}
}

function imgOff(imgName) {
   if (document.images) {
       document[imgName].src = eval(imgName + "Off.src");
   }
}

function searchIt() {
	if (document.searchForm.ipcosearchterm.value.length<3) {
		alert('Please type keywords to search for.');
		document.searchForm.keywords.focus();
	} else {
		document.searchForm.submit();
	}
}

function search() {
	if (document.searchForm.ipcosearchterm.value.length<3) {
		alert('Please type keywords to search for.');
		document.searchForm.keywords.focus();
		return false;
	}
	return true;
}

if (document.images) {            // Active Images
	imgRoot='/images/global/header';

	imgA1On = new Image();
	imgA4On = new Image();
	imgB1On = new Image();
	imgB4On = new Image();
	imgB5On = new Image();
	imgB6On = new Image();
	imgB7On = new Image();
	imgCcustomerserviceOn = new Image();
	imgCenergycenterOn = new Image();
	imgCnewsroomOn = new Image();
	imgCriversrecOn = new Image();
	imgCaboutusOn = new Image();

	imgA1Off = new Image();
	imgA4Off = new Image();
	imgB1Off = new Image();
	imgB4Off = new Image();
	imgB5Off = new Image();
	imgB6Off = new Image();
	imgB7Off = new Image();
	imgCcustomerserviceOff = new Image();
	imgCenergycenterOff = new Image();
	imgCnewsroomOff = new Image();
	imgCriversrecOff = new Image();
	imgCaboutusOff = new Image();

	imgA1On.src = imgRoot + 'A1On.jpg';
	imgA4On.src = imgRoot + 'A4On.jpg';
	imgB1On.src = imgRoot + 'B1On.jpg';
	imgB4On.src = imgRoot + 'B4On.jpg';
	imgB5On.src = imgRoot + 'B5On.jpg';
	imgB6On.src = imgRoot + 'B6On.jpg';
	imgB7On.src = imgRoot + 'B7On.jpg';
	imgCcustomerserviceOn.src = imgRoot + 'CcustomerserviceOn.jpg';
	imgCenergycenterOn.src = imgRoot + 'CenergycenterOn.jpg';
	imgCnewsroomOn.src = imgRoot + 'CnewsroomOn.jpg';
	imgCriversrecOn.src = imgRoot + 'CriversrecOn.jpg';
	imgCaboutusOn.src = imgRoot + 'CaboutusOn.jpg';

	imgA1Off.src = imgRoot + 'A1.jpg';
	imgA4Off.src = imgRoot + 'A4.jpg';
	imgB1Off.src = imgRoot + 'B1.jpg';
	imgB4Off.src = imgRoot + 'B4.jpg';
	imgB5Off.src = imgRoot + 'B5.jpg';
	imgB6Off.src = imgRoot + 'B6.jpg';
	imgB7Off.src = imgRoot + 'B7.jpg';
	imgCcustomerserviceOff.src = imgRoot + 'CcustomerserviceOff.jpg';
	imgCenergycenterOff.src = imgRoot + 'CenergycenterOff.jpg';
	imgCnewsroomOff.src = imgRoot + 'CnewsroomOff.jpg';
	imgCriversrecOff.src = imgRoot + 'CriversrecOff.jpg';
	imgCaboutusOff.src = imgRoot + 'CaboutusOff.jpg';
}


var here = window.self.location.pathname.toLowerCase();

document.writeln('<form name="searchForm" action="/search/search.cfm" method="post" onSubmit="return search();">');
document.writeln('  <table border="0" cellpadding="0" cellspacing="0">');
document.writeln('  <tr>');
document.writeln('    <td width="158" height="27"><a href="/" onmouseover="imgOn(\'imgB1\');imgOn(\'imgA1\');" onmouseout="imgOff(\'imgB1\');imgOff(\'imgA1\');"><img name="imgA1" border="0" src="/images/global/headerA1.jpg" width="158" height="27"></a></td>');
document.writeln('    <td width="400" height="27" bgcolor="#009999"><img border="0" src="/images/global/headerA2.jpg"></td>');
document.writeln('    <td height="27" width="55" bgcolor="#009999"><img border="0" src="/images/global/headerA3.jpg"></td>');
document.write('    <td height="27" width="92" bgcolor="#009999"><input type="text" name="ipcosearchterm" size=18"');
if (browser == "IE") {
	document.write('10');
} else {
	document.write('5');
}
document.write('" class="searchField"></td>\r\n');
document.writeln('    <td height="27" width="333" align="right" bgcolor="#009999"><a href="javascript:searchIt();" onmouseover="imgOn(\'imgA4\');" onmouseout="imgOff(\'imgA4\');"><img name="imgA4" border="0" align="right" src="/images/global/headerA4.jpg"></a></td>');
document.writeln('    <td height="27" bgcolor="#009999" width="42">&nbsp;</td>');
document.writeln('    <td height="27" bgcolor="#009999" width="100%">&nbsp;</td>');
document.writeln('  </tr>');
document.writeln('</table>');
document.writeln('<table border="0" cellpadding="0" cellspacing="0">');
document.writeln('  <tr>');
document.writeln('    <td width="165" height="85" rowspan="2"><a href="/" onmouseover="imgOn(\'imgB1\');imgOn(\'imgA1\');" onmouseout="imgOff(\'imgB1\');imgOff(\'imgA1\');"><img name="imgB1" border="0" src="/images/global/headerB1.jpg"></a></td>');

document.write('    <td width="400" height="85" rowspan="2" bgcolor="#009999"><img border="0" src="/images/global/headerB2');
if (here.indexOf('/customerservice/')>=0) {
	document.write('customerservice');
} else if (here.indexOf('/energycenter/')>=0) {
	document.write('energycenter');
} else if (here.indexOf('/newsroom/')>=0) {
	document.write('newsroom');
} else if (here.indexOf('/riversrec/')>=0) {
	document.write('riversrec');
} else if (here.indexOf('/aboutus/')>=0) {
	document.write('aboutus');
}
document.writeln('.jpg"></td>');

document.writeln('    <td width="27" height="85" bgcolor="#009999"><img border="0" src="/images/global/headerB3.jpg"></td>');
document.writeln('    <td width="24" height="85" bgcolor="#009999"><a href="/" onmouseover="imgOn(\'imgB4\');" onmouseout="imgOff(\'imgB4\');"><img name="imgB4" border="0" src="/images/global/headerB4.jpg"></a></td>');
document.writeln('    <td width="23" height="85" bgcolor="#009999"><a href="http://www.idacorpinc.com" target="_blank" onmouseover="imgOn(\'imgB5\');" onmouseout="imgOff(\'imgB5\');"><img name="imgB5" border="0" src="/images/global/headerB5.jpg"></a></td>');
document.writeln('    <td width="23" height="85" bgcolor="#009999"><a href="/sitemap.asp" onmouseover="imgOn(\'imgB6\');" onmouseout="imgOff(\'imgB6\');"><img name="imgB6" border="0" src="/images/global/headerB6.jpg"></a></td>');
document.writeln('    <td width="24" height="85" bgcolor="#009999"><a href="/forms/customerservice/contactus.htm" onmouseover="imgOn(\'imgB7\');" onmouseout="imgOff(\'imgB7\');"><img name="imgB7" border="0" src="/images/global/headerB7.jpg"></a></td>');
document.writeln('    <td height="85" bgcolor="#009999" width="101"><img border="0" src="/images/global/headerB8.jpg"></td>');
document.writeln('    <td height="85" bgcolor="#009999" width="100%" colspan="2">&nbsp;</td>');
document.writeln('  </tr>');
document.writeln('</table>');
document.writeln('<table border="0" cellpadding="0" cellspacing="0">');
document.writeln('  <tr>');
document.writeln('    <td height="27" width="158">&nbsp;</td>');
document.write('    <td height="27" bgcolor="#009999" width="130"><a href="/customerservice"');
if (here.indexOf('/customerservice/')==-1) {
	document.write(' onmouseover="imgOn(\'imgCcustomerservice\');" onmouseout="imgOff(\'imgCcustomerservice\');"');
}
document.write('><img border="0" src="/images/global/headerCcustomerserviceO');
if (here.indexOf('/customerservice/')>=0) {
	document.write('n.jpg" name="imgCcustomerservice');
} else {
	document.write('ff.jpg" name="imgCcustomerservice');
}
document.writeln('" width="130" height="27"></a></td>');
document.write('    <td height="27" bgcolor="#009999" width="110"><a href="/energycenter"');
if (here.indexOf('/energycenter/')==-1) {
	document.write(' onmouseover="imgOn(\'imgCenergycenter\');" onmouseout="imgOff(\'imgCenergycenter\');"');
}
document.write('><img border="0" src="/images/global/headerCenergycenterO');
if (here.indexOf('/energycenter/')>=0) {
	document.write('n.jpg" name="imgCenergycenter');
} else {
	document.write('ff.jpg" name="imgCenergycenter');
}
document.writeln('" width="110" height="27"></a></td>');
document.write('    <td height="27" bgcolor="#009999" width="88"><a href="/newsroom"');
if (here.indexOf('/newsroom/')==-1) {
	document.write(' onmouseover="imgOn(\'imgCnewsroom\');" onmouseout="imgOff(\'imgCnewsroom\');"');
}
document.write('><img border="0" src="/images/global/headerCnewsroomO');
if (here.indexOf('/newsroom/')>=0) {
	document.write('n.jpg" name="imgCnewsroom');
} else {
	document.write('ff.jpg" name="imgCnewsroom');
}
document.writeln('" width="88" height="27"></a></td>');
document.write('    <td height="27" bgcolor="#009999" width="138"><a href="/riversrec"');
if (here.indexOf('/riversrec/')==-1) {
	document.write(' onmouseover="imgOn(\'imgCriversrec\');" onmouseout="imgOff(\'imgCriversrec\');"');
}
document.write('><img border="0" src="/images/global/headerCriversrecO');
if (here.indexOf('/riversrec/')>=0) {
	document.write('n.jpg" name="imgCriversrec');
} else {
	document.write('ff.jpg" name="imgCriversrec');
}
document.writeln('" width="138" height="27"></a></td>');
document.write('    <td height="27" bgcolor="#009999" width="89"><a href="/aboutus"');
if (here.indexOf('/aboutus/')==-1) {
	document.write(' onmouseover="imgOn(\'imgCaboutus\');" onmouseout="imgOff(\'imgCaboutus\');"');
}
document.write('><img border="0" src="/images/global/headerCaboutusO');
if (here.indexOf('/aboutus/')>=0) {
	document.write('n.jpg" name="imgCaboutus');
} else {
	document.write('ff.jpg" name="imgCaboutus');
}
document.writeln('" width="89" height="27"></a></td>');
document.writeln('  </tr>');
document.writeln('</table>');
document.writeln('</form>');


if (here.indexOf('/forms/')>=0) {
	hereStart=here.indexOf('/forms/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}

} else if (here.indexOf('/customerservice/')>=0) {
	hereStart=here.indexOf('/customerservice/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}
} else if (here.indexOf('/energycenter/')>=0) {
	hereStart=here.indexOf('/energycenter/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}
} else if (here.indexOf('/newsroom/')>=0) {
	hereStart=here.indexOf('/newsroom/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}
} else if (here.indexOf('/riversrec/')>=0) {
	hereStart=here.indexOf('/riversrec/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}
} else if (here.indexOf('/aboutus/')>=0) {
	hereStart=here.indexOf('/aboutus/');
	if (hereStart>0) {
		here=here.substr(hereStart,here.length-hereStart)
	}
}
if (window.self.location.href.indexOf('?')>0) {
	here+=window.self.location.href.substring(window.self.location.href.indexOf('?'),window.self.location.href.length).toLowerCase();
}


headerText=document.title;
titleStart=headerText.lastIndexOf(' - ')
if (titleStart>=0) {
	headerText=headerText.substring((titleStart+3), headerText.length)
}

document.writeln('<table border="0" cellpadding="0" cellspacing="0" width="780">');

document.write('  <tr><td width="158" height="50">&nbsp; </td><td width="622" height="50" valign="bottom"><h1><font color="#009999">'+headerText+'</font></h1></td></tr></table>');

document.write('<SCRIPT LANGUAGE="JavaScript1.2" SRC="/js/menu.asp?url='+escape(here)+'" TYPE="text/javascript"></SCRIPT>');

// End No Flash






