/*====================================================*
  Functions:
    GetEmail  PlaceFooter		MenuMain
 *====================================================*/
/*====================================================*
  Menu: 
	  Brackets contain: text, filename, levels below. 
		Start at 0.
		Divider with text = -
 *====================================================*/
Menu_0   = new Array("HOME",                     "index.php", 0);
Menu_1   = new Array("ABOUT",                    "php/page.php?PageId=3", 4);
Menu_1_0 = new Array("About Trax",               "php/page.php?PageId=3", 0);
Menu_1_1 = new Array("FasTraX",                  "php/page.php?PageId=10", 0);
Menu_1_2 = new Array("Products &amp; Services",  "php/page.php?PageId=9", 0);
Menu_1_3 = new Array("Offshore Manufacturing",   "php/page.php?PageId=11", 0);
Menu_2   = new Array("NEWS",                     "php/newsitems.php?PageId=21", 0);
Menu_3   = new Array("CAPABILITIES",             "php/page.php?PageId=15", 3);
Menu_3_0 = new Array("Material Specifications",  "php/page.php?PageId=15", 0);
Menu_3_1 = new Array("Design Specifications",    "php/page.php?PageId=16", 0);
Menu_3_2 = new Array("Downloads",                "php/page.php?PageId=18", 0);
Menu_4   = new Array("CONTACT",                  "php/contactus.php?PageId=19", 4);
Menu_4_0 = new Array("Contact Us",               "php/contactus.php?PageId=19", 0);
Menu_4_1 = new Array("Request Quotation",        "php/quotation.php?PageId=19", 0);
Menu_4_2 = new Array("Credit Application",       "php/page.php?PageId=20", 0);
Menu_4_3 = new Array("Job Status",               "php/jobstatus.php", 0);

var intFirstLineMenus = 5;

/*====================================================*/
function MenuMain(selected, currentlevel) {
  var strContent  = '';
  var arrMainMenu = '';
	var arrSubMenu  = '';
  var divider   = '';
  var relative  = '';
	var intSecondLineMenus = 0;
	var intFirst = 0;
  
  //Build First Line		
  strContent = '<ul id="navContainer">';
  for(intFirst=0; intFirst<intFirstLineMenus; intFirst++)
  {
    arrMainMenu = eval("Menu_"+intFirst);  
    if (intFirst == 0)
		{strContent += '<li class="navLogo"><img src=\"' + currentlevel + 'images/Logo.jpg\" alt=\"Trax Circuit Board Design\" /></li>';}
    strContent += '<li class="navDiv"><\/li>';

    if (selected == arrMainMenu[0])
      {strContent += '<li class="navMain">' + arrMainMenu[0];}
		else if (arrMainMenu[1] == "")
      {strContent += '<li class="navMain">' + arrMainMenu[0];}
    else
      {strContent += '<li class="navMain"><a title="'+ arrMainMenu[0]+'" href="' + currentlevel + 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 (selected == arrSubMenu[0])
				{strContent += '<li class="navSub">' + arrSubMenu[0] + '</li>';}
 		  else if (arrSubMenu[1] == "-")
				{strContent += '<li class="navDivHorizontal"></li>';}
			else
				{strContent += '<li class="navSub"><a title="'+ arrSubMenu[0]+'" href="' + currentlevel + arrSubMenu[1]+'">'+arrSubMenu[0]+'</a></li>';}
		}
		if (intSecondLineMenus > 0)
		  {strContent += '</ul>';}
    strContent += '</li>';

  } 
  strContent +=  '</ul>';
//	alert(strContent);
  document.write(strContent);
}

//=========================================================================
//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,114,97,120,46,99,111,46,122,97]
var encryptedemail_id10='' //variable to contain encrypted email 
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id10+=String.fromCharCode(emailriddlerarray[i])

document.write('<a href="mailto:'+encryptedemail_id10+'?subject=Email from Trax Website">Email</a>')

}



	

