// /* hide / show DIVS / FAQ etc. */
function toggleQuestion(handle){
	if (document.getElementById('question' + handle).className == 'question-background'){ // we need to deactivate the question
		document.getElementById('question' + handle).className = 'question-nobackground';
		document.getElementById('answer' + handle).className = 'answer-hide';					
	}else{
		document.getElementById('question' + handle).className = 'question-background';
		document.getElementById('answer' + handle).className = 'answer-show';
	}
}

// ?
function startList() {
	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", "");}
			}
		}
		navRoot = document.getElementById("nav2");
		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 = function () {
	startList();
	if (location.href.indexOf("contact.asp") > -1 ) {
		selectTabs2();	
		fixDrops2();
	} else {
		//selectTabs();
		fixDrops();
	}
	
}
arrTabs = new Array("business_manager","project_manager","it_professional","community","partner","investor");
arrContactTabs = new Array("contact1","contact2","contact3");
for (i=0;i<arrTabs.length;i++) { //preload the onstates
	img = new Image();
	img.src = "/img/po_nav_sub_"+ arrTabs[i] +"_on.jpg"
}
for (i=0;i<arrContactTabs.length;i++) { //preload the contact tabs
	img = new Image();
	img.src = "/img/po_nav_sub_"+ arrTabs[i] +"_on.jpg"
}
prevId = 0;
function swapDiv(id) {
	//alert("h");
	document.tabs.tabVal.value = id;
	document.images["tab"+prevId].src = "/img/po_nav_sub_"+ arrTabs[prevId] +"_off.jpg";
	document.getElementById("div"+prevId).style.display = "none";
	document.images["tab"+id].src = "/img/po_nav_sub_"+ arrTabs[id] +"_on.jpg";
	document.getElementById("div"+id).style.display = "inline";	
	prevId = id;
}
/*
function swapContactDiv(id) {
	document.tabs.tabVal.value = id;
	document.images["tab"+prevId].src = "http://www.iteligent.com/clients/projectopen/relaunch/img/po_nav_sub_"+ arrContactTabs[prevId] +"_off.gif";
	document.getElementById("div"+prevId).style.display = "none";
	document.images["tab"+id].src = "http://www.iteligent.com/clients/projectopen/relaunch/img/po_nav_sub_"+ arrContactTabs[id] +"_on.gif";
	document.getElementById("div"+id).style.display = "inline";	
	prevId = id;
}*/
function jumpPage(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value
		if (newPage != "") {
			window.location = newPage
		}
}	

function openWin(URL) {
newWindow=window.open(URL,"window","width=400,height=310,status=no,scrollbars=auto,resizable=no,location=0,menubar=0,toolbar=no");
newWindow.focus();
}

function page(){
  if (document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value != "none") { 
	URL = document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value;        
	newWindow=window.open(URL,"window","width=600,height=375,status=yes,scrollbars=yes,resizable=yes,location=1,menubar=1,toolbar=yes");
	newWindow.focus();
   }           
}

function selectTabs() {
	if (document.tabs) {
		if (document.tabs.tabVal.value != "") {swapDiv(document.tabs.tabVal.value)}
	}
}

function selectTabs2() {
	if (document.tabs) {
		if (document.tabs.tabVal.value != "") {swapContactDiv(document.tabs.tabVal.value)}
	}
}
fixDrops = function () {
	if (document.Links) {
		document.Links.Link_select.selectedIndex = 0;
		document.sections.sectionSelect.selectedIndex = 0;
	}
}

fixDrops2 = function () {
	if (document.navs) {
		document.navs.payroll.selectedIndex = 0;
		document.navs.hr.selectedIndex = 0;
		document.navs.time.selectedIndex = 0;
		document.navs.tax.selectedIndex = 0;
		document.navs.benefit.selectedIndex = 0;
		document.navs.screening.selectedIndex = 0;
		document.frmGeneral.HearAbout.selectedIndex = 0;
	}
}


