

 

//--------START -- JavaScript COMMON Menu Functions------------
//-----------------------------------------------------------------------------

//-- Highlight Top Section
//-----------------------------------
var strTopSubHead = "";
function HighlightTopSubHead()
{
	var HeadNum = "";


	if (strTopSubHead == "" | strTopSubHead == "None")
	{
		if (strCurrSectionID=="CheckMyData")
		{
		    HeadNum = "2";
		}
	}
	else
	{
		HeadNum = strTopSubHead.substring(8 , strTopSubHead.length-1);
	}
	
	//alert(HeadNum);
	if ( HeadNum == "" )
	{
		return;
	}

	var strStyleClass="Section"+HeadNum;
	var strObjID = "TopSection"+HeadNum;
	if (strObjID != "")
	{
		var objMenuItem = document.getElementById(strObjID);
		if (objMenuItem)
		{
			objMenuItem.className = strStyleClass+"Select";
		}
	}
}



//--------Default Level setting
var MenuLevelsLimit = 4; //-- this means levels 1--to--4 (4 levels)

//--------These variables are in the function MarkSelectedMenuItem() which will hightlight the menu corresponding to the selected page
var URLpos1=0; var URLpos2=0; 
var strPageID="";
var strCurrPageID=""; ////---- these variables (strCurrPageID and strCurrSectionID)  will be set in the HeaderContent of the Webcontent-form
var strCurrSectionID="";
var strSelectedMenuID = "";
var strSelectedMenuClass = "";

//-----------MarkSelectedMenuItem() ------------------
function MarkSelectedMenuItem()
{
	//alert(strSelectedMenuID);
	if (strSelectedMenuID != "")
	{
		var objMenuItem = document.getElementById(strSelectedMenuID);
		if (objMenuItem)
		{
			objMenuItem.className = strSelectedMenuClass+"Select";
		}
	}
}

function GetSectionIndexVals(secID)
{
	var aryIndexVals = new Array();
	var s=0;
	for (s=1; s<arySection.length; s++)
	{
		if (secID == arySection[s] )
		{
			aryIndexVals[0] = arySectionStart[s];
			aryIndexVals[1] = arySectionEnd[s];
			aryIndexVals[2] = s;
			break;
		}
	}
return aryIndexVals;
}

function GetLinkURLid(strURL)
{
	//-------getting the menu-id of the current content web page to highlight the menu item
	var URLpos1=0;
	var URLpos2=0;
	var strPageID = "";
	strURL=strURL.toUpperCase();

	URLpos1= strURL.indexOf("VWGETDOC/");
	if (URLpos1 > 0 )
	{
		URLpos2= strURL.length;
		strPageID = strURL.substring(URLpos1+9,URLpos2);
	}
	else
	{
		URLpos1= strURL.indexOf(".NSF/");
		URLpos2= strURL.indexOf("?OPEN");
		if (URLpos2 <= 0 )
		{
			URLpos2= strURL.length;
		}
		if (URLpos1 > 0 && URLpos2 > 0 )
		{
			strPageID = strURL.substring(URLpos1+5,URLpos2);
		}
	}
	return strPageID;
}

function HighlightTopHeadSection()
{

	//var flag="NO";
	var TopSec=0;

	if (aryTopSection)
	{
		if (aryTopSection.length)
		{
			var s=0;
			for (s=0; s<aryTopSection.length; s++)
			{
				if (aryTopSection[s].toUpperCase() == strCurrSectionID.toUpperCase())
				{
					TopSec=s+1;
					break;
				}
			}  // end for
		}
	}

	if (TopSec <= 0 )
	{
		//TopLinkPID1  //TopLinkPID2  //TopLinkPID3
		var winURL = window.top.location.href;	
		var strPageID = GetLinkURLid( winURL.toString() );
		//if (strCurrPageID.toUpperCase() == strPageID.toUpperCase() ) 
		//{
			if (strCurrPageID.toUpperCase()==TopLinkPID1.toUpperCase()) { TopSec=1;}
			else if (strCurrPageID.toUpperCase()==TopLinkPID2.toUpperCase()) { TopSec=2;}		
			else if (strCurrPageID.toUpperCase()==TopLinkPID3.toUpperCase()) { TopSec=3;}		
		//}

		if (strCurrSectionID=="CheckMyData") { TopSec=2;}		
	}

	var strStyleClass="Section"+TopSec;
	var strObjID = "TopSection"+TopSec;
	if (strObjID != "")
	{
		var objMenuItem = document.getElementById(strObjID);
		if (objMenuItem)
		{
			objMenuItem.className = strStyleClass+"Select";
		}
	}

}


function HighlightTopSectionLink()
{

	//var flag="NO";
	var TopSec=0;

	if (aryTopSection)
	{
		if (aryTopSection.length)
		{
			var s=0;
			for (s=0; s<aryTopSection.length; s++)
			{
				if (aryTopSection[s].toUpperCase() == strCurrSectionID.toUpperCase())
				{
					TopSec=s+1;
					break;
				}
			}  // end for
		}
	}

	if (TopSec >= 1 )
	{
		//var strStyleClass="Section"+TopSec;
		var strStyleClass="selected";
		var strObjID = "TopSection"+TopSec;
		if (strObjID != "")
		{
			var objMenuItem = document.getElementById(strObjID);
			if (objMenuItem)
			{
				//objMenuItem.className = strStyleClass+"Select";
				objMenuItem.className = strStyleClass;
			}
		}
	}
}




//-----------ShowChildIndex(ParentPageID) ------------------
function ShowChildIndex(strParentID)
{
	if (strParentID == "" )  {return; }

	if (aryParentID) 		
	{ 
		if (aryParentID.length<=0) {return; }

		var start = aryParentID.indexOf( strParentID );
		if (start >= 1 )
		{
			if (aryLabel) 
			{ 
				if (aryLabel.length<=0) {return; }
				
				var c =1;
				start = start+1;
				for (c=start; c<aryLabel.length; c++) 
				{		
					if ( strParentID == aryParentID[c] )
					{
					document.write('<DIV ID="menu'+c+'" class="mLevel'+ aryLevel[c] +'"><A HREF="'+ aryURL[c] +'" target="'+ aryTarget[c] +'">'+ aryLabel[c] +'</A></DIV>'); 
					}
				}
	 		}
		}
	}
	else
	{
		alert("CMS - Default Menu NOT updated. Tools --> Update Web Nav");
	}
}

//-----------------END Common functions JS--------------------------------------------
			 
var aryTopSection = new Array(); aryTopSection[0]="C91DF3C5311E9D148025726600463D13JJAB-6XJGZH";  aryTopSection[1]="38CB33C289C2427D802572680037BE87JJAB-6XLDWK";  aryTopSection[2]="D6C690D9F60F743C8025704D0050513FJJAB-6ERK6B"; 
