// This is the Netscape CSS Fix to solve problem with resizing Netscape windows resulting in loss of CSS info.
//function MM_reloadPage(init) {
//  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
//    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
//  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
//}
//MM_reloadPage(true);

function expandCollapseAll() {
//	var docform = document.forms["Form1"];
//	var nresultStr = docform.nresults.value;
//	var nresults = parseInt(nresultStr, 10);

	var whichAction;
	for (var i = 1; i >= 10; ++i) {
		whichAction = expandIt("elem" + i, whichAction);
	}
}

// whichAction == 0 implies flip the current expand/collapse state
// whichAction == 1 implies expand
// whichAction == 2 implies collapse
function expandIt(whichEl, whichAction){
    tag = document.getElementById(whichEl);
    if (tag)
    {
		if (!whichAction) {
			whichAction = (tag.style.display == "none") ? 1 : 2;
		}
		tag.style.display = (whichAction == 1 ? "block" : "none");
		var imgid = document.getElementById(whichEl + '_img');
		if (imgid) {
			if (whichEl == 'elem1') {
				imgid.src = tag.style.display == "none" ? HomeOFF : HomeON;
			} else if (whichEl == 'elem2') {
				imgid.src = tag.style.display == "none" ? ServiceOFF : ServiceON;
			} else if (whichEl == 'elem3') {
				imgid.src = tag.style.display == "none" ? LearnMoreOFF : LearnMoreON;
			} else if (whichEl == 'elem4') {
				imgid.src = tag.style.display == "none" ? DemoOFF : DemoON;
			} else if (whichEl == 'elem5') {
				imgid.src = tag.style.display == "none" ? PSROFF : PSRON;
			} else if (whichEl == 'elem6') {
				imgid.src = tag.style.display == "none" ? SIROFF : SIRON;
			} else if (whichEl == 'elem7') {
				imgid.src = tag.style.display == "none" ? HoNOSOFF : HoNOSON;
			} else if (whichEl == 'elem8') {
				imgid.src = tag.style.display == "none" ? CustomChartingOFF : CustomChartingON;
			} else if (whichEl == 'elem9') {
				imgid.src = tag.style.display == "none" ? AnalysisOFF : AnalysisON;
			} else if (whichEl == 'elem10') {
				imgid.src = tag.style.display == "none" ? ConfigurationOFF : ConfigurationON;
			} else if (whichEl == 'SubscribeOthersId') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
			} else if (whichEl.substring(0,5) == 'OpDef') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
			} else if (whichEl == 'ChartStyleId') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
			} else if (whichEl == 'ContactInfo') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
			} else if (whichEl == 'AdvancedInfo') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
			} else if (whichEl == 'AnalysisResultFooter') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
				if (tag.style.display == "none")
				{	
					document.getElementById('m_lblAnalysisFooterText').value = "click to view list of Team(s) contributing to this analysis item";
				}
				else
				{	
					document.getElementById('m_lblAnalysisFooterText').value = " click to hide list of Team(s) contributing to this analysis item";
				}
				
			} else if (whichEl == 'AnalysisOptional') {
				imgid.src = tag.style.display == "none" ? sPlus : sMinus;
				if (tag.style.display == "none")
				{	SetCookie("AnalysisOptionDisplayState","none");
					document.getElementById('m_lblAnalysisOptionalText').value = "click to view other selection choices (optional)";
				}
				else
				{	SetCookie("AnalysisOptionDisplayState","block");
					document.getElementById('m_lblAnalysisOptionalText').value = " click to hide other selection choices";
				}
			}
		}
	}
	return whichAction;
}

