

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// START Top Nav Rollover Scripts

Nav1Off = new Image()
Nav1Off.src = "http://www.tenaska.com/images/aboutus_off.gif"
Nav1On = new Image()
Nav1On.src = "http://www.tenaska.com/images/aboutus_on.gif"

Nav2Off = new Image()
Nav2Off.src = "http://www.tenaska.com/images/powergeneration_off.gif"
Nav2On = new Image()
Nav2On.src = "http://www.tenaska.com/images/powergeneration_on.gif"

Nav3Off = new Image()
Nav3Off.src = "http://www.tenaska.com/images/energymarketing_off.gif"
Nav3On = new Image()
Nav3On.src = "http://www.tenaska.com/images/energymarketing_on.gif"

Nav4Off = new Image()
Nav4Off.src = "http://www.tenaska.com/images/fundmanagement_off.gif"
Nav4On = new Image()
Nav4On.src = "http://www.tenaska.com/images/fundmanagement_on.gif"

Nav5Off = new Image()
Nav5Off.src = "http://www.tenaska.com/images/news_off.gif"
Nav5On = new Image()
Nav5On.src = "http://www.tenaska.com/images/news_on.gif"

Nav6Off = new Image()
Nav6Off.src = "http://www.tenaska.com/images/community_off.gif"
Nav6On = new Image()
Nav6On.src = "http://www.tenaska.com/images/community_on.gif"

function rollover(whichimg,overimg) {
	eval('document.images["' + whichimg + '"].src = ' + overimg + '.src');
}

// END Top Nav Rollover Scripts

// START Drop Down Menus

function show(id) {
	if (id == "subnav1"){clearTimeout(timeoutID1)}
	else if (id == "subnav2"){clearTimeout(timeoutID2)}
	else if (id == "subnav3"){clearTimeout(timeoutID3)}
	else if (id == "subnav4"){clearTimeout(timeoutID4)}
	else if (id == "subnav5"){clearTimeout(timeoutID5)}
	else if (id == "subnav6"){clearTimeout(timeoutID6)}
	if (ns4) document.layers[id].visibility = "show"
	else if (ie4) document.all[id].style.visibility = "visible"
	else if(!document.all && document.getElementById) document.getElementById(id).style.visibility = "visible"
}

var timeoutID1 = 0
var timeoutID2 = 0
var timeoutID3 = 0
var timeoutID4 = 0
var timeoutID5 = 0
var timeoutID6 = 0

function hide(num) {
	if (num == 1){timeoutID1 = setTimeout("hide2('subnav1')",800)}
	else if (num == 2){timeoutID2 = setTimeout("hide2('subnav2')",800)}
	else if (num == 3){timeoutID3 = setTimeout("hide2('subnav3')",800)}
	else if (num == 4){timeoutID4 = setTimeout("hide2('subnav4')",800)}
	else if (num == 5){timeoutID5 = setTimeout("hide2('subnav5')",800)}
	else if (num == 6){timeoutID6 = setTimeout("hide2('subnav6')",800)}
}

function hide2(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else if (ie4) document.all[id].style.visibility = "hidden"
	else if(!document.all && document.getElementById) document.getElementById(id).style.visibility = "hidden"
	if (id == "subnav1")
		{if (document.nav1.src.indexOf('_at') == -1)
			{rollover('nav1','Nav1Off')}
		}
	if (id == "subnav2")
		{if (document.nav2.src.indexOf('_at') == -1)
			{rollover('nav2','Nav2Off')}
		}
	if (id == "subnav3")
		{if (document.nav3.src.indexOf('_at') == -1)
			{rollover('nav3','Nav3Off')}
		}
	if (id == "subnav4")
		{if (document.nav4.src.indexOf('_at') == -1)
			{rollover('nav4','Nav4Off')}
		}
	if (id == "subnav5")
		{if (document.nav5.src.indexOf('_at') == -1)
			{rollover('nav5','Nav5Off')}
		}
	if (id == "subnav6")
		{if (document.nav6.src.indexOf('_at') == -1)
			{rollover('nav6','Nav6Off')}
		}
}

// END Drop Down Menus

function open_print(gohere) {
    window.open(gohere, "print", config="height=400,width=500,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

function open_email(gohere) {
    window.open(gohere, "email", config="height=475,width=500,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

function open_faq(gohere) {
    window.open(gohere, "faq", config="height=475,width=500,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes,top=0,left=0")
}

// START Telescoping Functions

function showItem(id) {
	document.getElementById("item"+id).className = "itemList_expanded";
	document.getElementById("plus"+id).className = "hideBtn";
	document.getElementById("minus"+id).className = "showBtn";
}
function hideItem(id) {
	document.getElementById("item"+id).className = "itemList_collapsed";
	document.getElementById("plus"+id).className = "showBtn";
	document.getElementById("minus"+id).className = "hideBtn";
}

// END Telescoping Functions

/* Some additional JavaScript */

function gotosite()
{
    var URL = document.gotoform.New_URL.options[document.gotoform.New_URL.selectedIndex].value; window.location.href = URL;
}
function findStaffMember()
{
    var URL = document.staff_member_form.New_URL.options[document.staff_member_form.New_URL.selectedIndex].value; window.location.href = URL;
}
function findStaffDepartment()
{
    var URL = document.staff_department_form.New_URL.options[document.staff_department_form.New_URL.selectedIndex].value; window.location.href = URL;
}

function toggle_display(display_area) {
    if (document.getElementById(display_area)) { 
        var display_element = document.getElementById(display_area);
        display_element.style.display = display_element.style.display == "none" ? "block":"none"; 
    }
}

function show_block(block)
{
	//alert(block);
	document.getElementById(block).style.display = "block";
}

/*
------------------------------------------------
PVII Equal CSS Columns scripts -Version 2
Copyright (c) 2005 Project Seven Development
www.projectseven.com
Version: 2.1.0
------------------------------------------------
*/
function P7_colH2(){ //v2.1.0 by PVII-www.projectseven.com
	var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
		for(i=1;i<dA.length;i+=2){dA[i+1].style.paddingBottom='';}for(i=1;i<dA.length;i+=2){
			oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=1;i<dA.length;i+=2){oh=dA[i].offsetHeight;
			if(oh<h){np=h-oh;if(!an&&dA[0]==1){P7_eqA2(dA[i+1].id,0,np);}else{
				dA[i+1].style.paddingBottom=np+"px";}}}document.p7eqa=1;
				document.p7eqth=document.body.offsetHeight;
				document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT2(){ //v2.1.0 by PVII-www.projectseven.com
	if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}
function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com
	var c,e,el;if(document.getElementById){document.p7eqc=new Array();
	document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
	c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
	if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
		document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
		setInterval("P7_eqT2()",10);}
}
function P7_eqA2(el,p,pt){ //v2.1.0 by PVII-www.projectseven.com
	var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
	g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
	setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);}
}

function P7_equalCols3(){ //v2.1.0 by PVII-www.projectseven.com
	var c,e,el;if(document.getElementById){document.p7eqc=new Array();
	document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
	c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
	if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
		document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
		setInterval("P7_eqT2()",10);}
}
