// document.write("<a href=\"sdump.php\">Session Dump</a>");
myAccountMenu = new Array();

myAccountMenu[0] = ["Messages", "messages.php?page=1"];
myAccountMenu[1] = ["Profiles", "profile_list.php"];
myAccountMenu[2] = ["Account", "accountconfig.php"];

function drawHorizMenu(activeLinkNum)
{
	for (i=0; i <= myAccountMenu.length-1; i++)
	{
		
		if (i+1 == activeLinkNum)
		{
			document.write("<strong>" + myAccountMenu[i][0] + "</strong>");
		}
		else
		{
			document.write("<a href=\"" + myAccountMenu[i][1] + "\" class=\"navlink\">" + myAccountMenu[i][0] + "</a>");
		}
		if (i != myAccountMenu.length-1)
		{
			document.write("&nbsp;|&nbsp;");
		}
	}
}

subMenuCount = 0;
myAccountSubMenu = new Array();
myAccountSubMenu[subMenuCount++] = [0, "Voicemail", "messages.php?page=1"];
myAccountSubMenu[subMenuCount++] = [0, "Folders", "managefolder.php"];

myAccountSubMenu[subMenuCount++] = [1, "Current Profile", "profile_list.php"];
myAccountSubMenu[subMenuCount++] = [1, "Profile List", "profile_list.php"];

myAccountSubMenu[subMenuCount++] = [2, "Account", "accountconfig.php"];
// XXX TBD myAccountSubMenu[subMenuCount++] = [2, "Billing", "billinginfo.php"];
myAccountSubMenu[subMenuCount++] = [2, "Phones", "phones.php"];

// variables coming in are relative to the page (1 based).  In order to make them work for the array you need 
// to subtract 1 (0 based)
function drawHorizSubMenu(activeLinkNum, parentLinkNum)
{
	var arrayLength = 0;
	for (i=0; i < myAccountSubMenu.length; i++)
	{
		if (myAccountSubMenu[i][0] == parentLinkNum-1)
			arrayLength++;
	}
	j=0
	for (i=0; i < myAccountSubMenu.length; i++)
	{
		//alert(arrayLength + " : " + activeLinkNum + " : " + parentLinkNum + " : " + i + " : " + myAccountSubMenu.length);
		if (myAccountSubMenu[i][0] == parentLinkNum-1)
		{
			j++;
			if (j == activeLinkNum)
			{
				document.write("<strong>" + myAccountSubMenu[i][1] + "</strong>");
			}
			else
			{
				document.write("<a href=\"" + myAccountSubMenu[i][2] + "\" class=\"navlink\">" + myAccountSubMenu[i][1] + "</a>");
			}
			if (j < arrayLength)
			{
				document.write("&nbsp;|&nbsp;");
			}
		}
	}
}
