/*======================================================================================*
  Menu: 
	  Brackets contain: Title, filename, levels below, pageid, toppageid. 
		Start at 0.
		Divider with text = -
 *======================================================================================*/
Menu_0   = new Array("Home",            "default.asp",             0, -1, -1);
Menu_1   = new Array("Solutions",       "cms/page.asp?PageId=1",   0,  1,  1);
Menu_2   = new Array("Methods",         "cms/page.asp?PageId=7",   0,  7,  7);
Menu_3   = new Array("Applications",    "cms/page.asp?PageId=8",   0,  8,  8);
Menu_4   = new Array("Partnerships",    "cms/page.asp?PageId=11",  5, 9,   9);
Menu_4_0 = new Array("Strategic",       "cms/page.asp?PageId=11",  0, 11,  9);
Menu_4_1 = new Array("UK",              "cms/page.asp?PageId=12",  0, 12,  9);
Menu_4_2 = new Array("Global",          "cms/page.asp?PageId=13",  0, 13,  9);
Menu_4_3 = new Array("Academic",        "cms/page.asp?PageId=14",  0, 14,  9);
Menu_4_4 = new Array("Our Partners",    "cms/page.asp?PageId=15",  0, 15,  9);
Menu_5   = new Array("About Us",        "cms/page.asp?PageId=16",  4, 10, 10);
Menu_5_0 = new Array("The Company",     "cms/page.asp?PageId=16",  0, 16, 10);
Menu_5_1 = new Array("Senior Team",     "cms/page.asp?PageId=17",  0, 17, 10);
Menu_5_2 = new Array("Editorial Board", "cms/page.asp?PageId=18",  0, 18, 10);
Menu_5_3 = new Array("Clients",         "cms/page.asp?PageId=19",  0, 19, 10);
Menu_5_4 = new Array("News",            "",                        0,  1, 16);
Menu_6   = new Array("Contact Us",      "contact.asp",             0, -1, -1);

var intFirstLineMenus = 7;

/*======================================================================================
   The calling page must know whether it must pass the PageId or the PageTitle. 
   In the case of page.asp it must pass the PageId and ParentPageId
	 In the case of default, contact and news it must pass the PageTitle
  ======================================================================================*/
function MenuMain(strTitle, strRootDir, strTopPageId, strDate) {
  var strContent  = '';
	var strProgress = '';
	var strBackgroundImage = '';
  var arrMainMenu = '';
	var arrSubMenu  = '';
  var divider   = '';
  var relative  = '';
	var intSecondLineMenus = 0;
	var intFirst = 0;
	var boolFirstLineSelected = false;
	var boolIamFirstLineSelected = false;
	var strThisDate = '';
	
	strBackgroundImage = strRootDir + 'images/MenuBarSelected.jpg'; 

  //Build Menu Line		
  strContent += '<div id="menuNavContainer"><center><ul id="menuNavContent">';
  for(intFirst=0; intFirst<intFirstLineMenus; intFirst++)
  {		
    boolFirstLineSelected = false;
		boolIamFirstLineSelected = false;
    arrMainMenu = eval("Menu_"+intFirst); 
	
		//Determine whether first line item selected
		if (arrMainMenu[3] != "-1")
		{strProgress += "a";
			if (strTopPageId == arrMainMenu[3])
			{strProgress += "b";
				 boolFirstLineSelected = true;
			}
		}
		else if (strTitle == arrMainMenu[0])
		{strProgress += "c";
			 boolFirstLineSelected = true;
		}
		
		//Determine whether I am the first line selected
		if ((!strTopPageId) || ((strTopPageId == '0')) && (strTitle == arrMainMenu[0]))
		{
			 boolIamFirstLineSelected = true;
		}
		
   //Build First Line	
    if (intFirst > 0)
      {strContent += '<li class="menuDivVertical"><\/li>';}
    if (boolIamFirstLineSelected)
      {
				strContent += '<li class="menuMain" style="background-image: url(\'' + strBackgroundImage + '\')">';
				strContent += arrMainMenu[0];
			}   
		else if (boolFirstLineSelected)
      {
				strContent += '<li class="menuMain" style="background-image: url(\'' + strBackgroundImage + '\')">';
				strContent += '<a title="'+ arrMainMenu[0]+'" href="'+strRootDir+arrMainMenu[1]+'">' + arrMainMenu[0]+'<\/a>';
			}
		else if (arrMainMenu[1] == "")
      {strContent += '<li class="menuMain">' + arrMainMenu[0];}
    else
      {strContent += '<li class="menuMain"><a title="'+ arrMainMenu[0]+'" href="'+strRootDir+arrMainMenu[1]+'">'+arrMainMenu[0]+'<\/a>';}

    //Build Second Line		
    intSecondLineMenus = arrMainMenu[2];
		if (intSecondLineMenus > 0)
  		{strContent += '<ul>';}
		for (intSecond = 0; intSecond < intSecondLineMenus; intSecond++)
		{
			arrSubMenu = eval("Menu_"+intFirst+"_"+intSecond);
			if (strTitle == arrSubMenu[0])
				{strContent += '<li class="menuSub">' + arrSubMenu[0] + '</li>';}
 		  else if (arrSubMenu[1] == "-")
				{strContent += '<li class="menuDivHorizontal"></li>';}
			else
				{strContent += '<li class="menuSub"><a title="'+ arrSubMenu[0]+'" href="'+strRootDir+arrSubMenu[1]+'">'+arrSubMenu[0]+'</a></li>';}
		}
		if (intSecondLineMenus > 0)
		  {strContent += '</ul>';}
    strContent += '</li>';

  } 
  strContent +=  '</ul></center></div>';
	//alert(strProgress);
  document.write(strContent);
}

//=========================================================================
//Returns the name of the month based on number starting at 0
//=========================================================================
function strGetMonth(intMonth) 
{
	var strReturn = '';
	if (intMonth == 11)
	{ 
	  strReturn = 'December';
	}
	else if (intMonth == 10)
	{ 
	  strReturn = 'November';
	}	
	else if (intMonth == 9)
	{ 
	  strReturn = 'October';
	}	
	else if (intMonth == 8)
	{ 
	  strReturn = 'September';
	}	
	else if (intMonth == 7)
	{ 
	  strReturn = 'August';
	}	
	else if (intMonth == 6)
	{ 
	  strReturn = 'July';
	}	
	else if (intMonth == 5)
	{ 
	  strReturn = 'June';
	}	
	else if (intMonth == 4)
	{ 
	  strReturn = 'May';
	}	
	else if (intMonth == 3)
	{ 
	  strReturn = 'April';
	}	
	else if (intMonth == 2)
	{ 
	  strReturn = 'March';
	}	
	else if (intMonth == 1)
	{ 
	  strReturn = 'February';
	}	
	else 
	{ 
	  strReturn = 'January';
	}	
	return strReturn;
}

//=========================================================================
//Used for dropdown menu
//=========================================================================
function startList() 
{
	if (document.all&&document.getElementById) 
	{
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() 
				{
					this.className+=" over";
				}
				node.onmouseout=function() 
				{
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

/***********************************************
* Encrypt Email script- Please keep notice intact
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/
function GetEmail()
{
var emailriddlerarray=[105,110,102,111,64,116,104,101,119,111,114,107,105,110,103,109,97,110,97,103,101,114,46,99,111,109]
var encryptedemail_id36='' //variable to contain encrypted email 
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id36+=String.fromCharCode(emailriddlerarray[i])

document.write('<a href="mailto:'+encryptedemail_id36+'?subject=Email from TheWorkingManager website">info@theworkingmanager.com</a>')

}

/***********************************************
* Returns footer for every page *
* **********************************************/
/***********************************************
* Returns footer for every page *
* **********************************************/
function getFooter(strRootDir)
{
	var strFooter = '';
	strFooter += '<div class=\"divFooter\">';
  strFooter += '  <div class=\"divFooterContent\">';
  strFooter += '    <div class=\"divFooterLeft\">';
  strFooter += '      <table>';
  strFooter += '        <tr>';
  strFooter += '          <td colspan=\"2\" style=\"height: 7px\"></td>';
  strFooter += '        </tr>';
  strFooter += '        <tr>';
  strFooter += '          <td style=\"text-align: right\"><img src=\"' + strRootDir + '/images/iconPhone.jpg\" width=\"23\" height=\"22\" alt=\"Contact Number\" />';
	strFooter += '</td>';
  strFooter += '          <td>+44 (0)1285 657978</td>';
  strFooter += '        </tr>';
  strFooter += '        <tr>';
  strFooter += '          <td></td>';
  strFooter += '          <td></td>';
  strFooter += '        </tr>';
  strFooter += '        <tr>';
  strFooter += '          <td style=\"text-align: right\"><img src=\"' + strRootDir + '/images/iconMail.jpg\" width=\"23\" height=\"22\" alt=\"Email\" /></td>';
  strFooter += '          <td><script type=\"text/javascript\">GetEmail()</script></td>';
  strFooter += '        </tr>';
  strFooter += '      </table>';
  strFooter += '    </div>';
  strFooter += '    <div class=\"divFooterRight\"><a href=\"' + strRootDir + '/twmclientzone.asp\">Login to Client Zone</a><br />';
  strFooter += '      <a href=\"' + strRootDir + '../statements/privacystatement.asp\">Privacy Statement</a><br />';
  strFooter += '      <a href=\"' + strRootDir + '../statements/copyrightstatement.asp\">Copyright Statement</a> </div>';
  strFooter += '  </div>';
  strFooter += '</div>';
	document.write(strFooter);
}


