
//Enter the Non-Secure URL address
var NonSecuredURLSite = "http://www.greatpointmortgage.com";

//Get the location includeing the protocolo i.e. https://
SiteProtocol = new String(window.location);

if( NoOffFirstLineMenus > 0 && SiteProtocol.search("https://") > -1 ) ModifyMenuArr( NoOffFirstLineMenus );

//if the site is secure then start changing the menuarr
function ModifyMenuArr(numOfMenu)
{
	for(i=0;i<numOfMenu;i++)
	{
		theMenuArr = eval("Menu"+(i+1));
		theMenuArrString = "Menu"+(i+1);
		theMenuArr[1] =  GetNewLink(theMenuArr[1]);
		
		//check if there is a sub menu
		if( theMenuArr[3] > 0 ) ModifySubMenuArr(theMenuArrString, theMenuArr[3]);
	}	
}

 var tempnum = 0;
function ModifySubMenuArr(numOfMenuArr, numOfSubMenu)
{
	counter = 0;
	tempnum = numOfSubMenu;
	for(j=0;j<tempnum;j++)
	{		
		theSubMenuArr = eval( numOfMenuArr + "_" + (j+1) );
		theSubMenuArr[1] = GetNewLink( theSubMenuArr[1] );		
		if( theSubMenuArr[3] > 0  ) ModifySubMenuArr(numOfMenuArr + "_" + (j+1), theSubMenuArr[3]);
	}
}



function GetNewLink(oldLink)
{
	return NonSecuredURLSite + "/" + oldLink;
}


