function buttonHover(state, obj) {
	obj.src = "images/btn_" + obj.name + "_" + state + ".gif"; 	// change image source
	obj.style.cursor = "hand";										// change to image cursor type
}

function toggleRow(ID, obj) {
	var txtMgrID = "mgr" + ID
	var objMgrID = document.all(txtMgrID);
	//alert(txtMgrID)

	objMgrID[1].style.display == "block" ? txtDisplayStyle = "none" : txtDisplayStyle = "block";
	objMgrID[1].style.display == "block" ? obj.src = "images/btn_expand_off.gif" : obj.src = "images/btn_collapse_off.gif"; 

	for (i=0; i<objMgrID.length; i++) {
		if (objMgrID[i].id == txtMgrID) objMgrID[i].style.display = txtDisplayStyle;
	}

}

function toggleSearch(searchState) {
	if (searchState=="on") {
		document.all('search_collapsed').style.display="none";
		document.all('search_expanded').style.display="block";
	} else {
		document.all('search_collapsed').style.display="block";
		document.all('search_expanded').style.display="none";
	}
}

function toggleReportChain(chainState) {
		if (chainState=="on") {
			document.all('people').style.display="block"
		} else {
			document.all('people').style.display="none"
		}
}

function viewEmployee(ID,action){
	// open requested document in a window devoted to this employee:
	var newWin = window.open('' + action + '.htm','ER'+ID,'width=700,height=600,resizable');		
	newWin.focus();
}

function viewPrint(ID,page) {
	window.open(''+page+'.htm','print'+ID)								// open separate print window
}

function viewSearchPopup() {
	var newWin = window.open('/common/search.jsp','search','width=400,height=350');
	newWin.focus();
}

function showHelp() {
	window.resizeTo(950,window.document.documentElement.clientHeight+31) 	// resize window
	document.all['bottomarea'].style.width='680px';						// resize main content area
    instructions.filters.item(0).Apply();								// setup filter
	instructions.style.display = "block";								// indicate what the filter should do: "block" display
	instructions.filters.item(0).Play()									// run the filter
	document.cookie = "inst=block"
}

function hideHelp() {
	window.resizeTo(712,window.document.documentElement.clientHeight+31);
	document.all['bottomarea'].style.width = window.document.documentElement.clientWidth-10;
	instructions.style.display="none";
	document.cookie = "inst=none"	
}