var defaultMenu = "";

function MenuItem(label,href,id,displayClass,options){
	this.initMenuItem(label,href,id,displayClass,options);
}

function MenuItem_Initialize (label,href,id,displayClass,options) {
	this.label = label;
	this.href = href;
	this.id = id;
	this.active = 0;
	this.displayClass = displayClass;
	this.options = options;
}

function MenuItem_SetActive(first) {
	this.active = "Y";

	/* We are not highlighting the active menu item, so
 	 * don't change the class of it
 	 *
	if (first) 
		this.displayClass = " class=\"selectnone\" ";
	else 
		this.displayClass = " class=\"select\" ";	
	*
	*/
}

function MenuItem_ClearActive() {
	this.active = "N";
	this.displayClass = "";
}


MenuItem.prototype.initMenuItem = MenuItem_Initialize;
MenuItem.prototype.setActive = MenuItem_SetActive;
MenuItem.prototype.clearActive = MenuItem_ClearActive;


//---------------------------------------------------------------------------

function Menu(label,href,id,displayClass, options){
	this.initMenu(label,href,id,displayClass, options);
}

function Menu_Initialize(label,href,id,displayClass, options){
	this.label = label;
	this.href = href;
	this.id = id;
	this.menuItems = new Array();
	this.displayClass = displayClass;
	this.active = false;
	this.options = options;
}

function Menu_AddMenuItem (label,href,id,options) {
	if (this.menuItems.length == 0) 
		this.menuItems[0] = new MenuItem(label,href,id,"class=\"none\"",options);
	else
		this.menuItems[this.menuItems.length] = new MenuItem(label,href,id,"", options);
}

function Menu_PrintMenu (){
	var temp = new String();
	
	// start the actual dropdown menu structure
	temp += "<ul class='" + (this.options.menuStyleClass != null ? this.options.menuStyleClass : '') + "'>";
	
	for ( var i=0; i<this.menuItems.length; i++ ){
		var itemOptions = this.menuItems[i].options;
		
		if( itemOptions.headerText != null )
		{
			temp += "<li class='" + (itemOptions.headerStyleClass != null ? itemOptions.headerStyleClass : '') 
					+ "'>" + itemOptions.headerText + "</li>";
		}

		if( (itemOptions.startColumn != null && itemOptions.startColumn == true) || (itemOptions.startRow != null && itemOptions.startRow == true ) )
		{
		
			if( itemOptions.columnStyleClass != null || itemOptions.rowStyleClass != null ){
				temp += "<li class='" + (itemOptions.columnStyleClass != null ? itemOptions.columnStyleClass : '') + (itemOptions.rowStyleClass != null ? itemOptions.rowStyleClass : '') + "'>";
			}else{
				temp += "<li>";
			}
			
			if( itemOptions.columnTitle != null )
				temp += "<h4>" + itemOptions.columnTitle + "</h4>"
			
			var listId = '';
			if( itemOptions.isCollapseable != null && itemOptions.isCollapseable == true ){
				listId = " class ='accordion'";
				usesAccordion = true;
			}
			
			temp += "<ol" + listId + ">";			// start a list to contain the actual elements
		}

		if( itemOptions.rowHeaderText != null )
		{
			temp += "<li style='" + (itemOptions.rowHeaderStyle != null ? itemOptions.rowHeaderStyle : '') 
					+ "' class='" + (itemOptions.rowHeaderStyleClass != null ? itemOptions.rowHeaderStyleClass : '') 
					+ "'>" + itemOptions.rowHeaderText + "</li>";
		}
		if( itemOptions.subListHeaderText != null )
		{
			var subListHeader = itemOptions.subListHeaderText;
			if( itemOptions.subListHeaderTextLink != null )
			{
				subListHeader = "	<a style='" + (itemOptions.subListHeaderTextLinkStyle != null ? itemOptions.subListHeaderTextLinkStyle : '') + "' class='" + (itemOptions.subListHeaderTextLinkStyleClass != null ? itemOptions.subListHeaderTextLinkStyleClass : '')  + "' href='" + itemOptions.subListHeaderTextLink + "'>" + itemOptions.subListHeaderText + "</a>";
			}
			
			temp += "<li style='" + (itemOptions.subListHeaderStyle != null ? itemOptions.subListHeaderStyle : '') 
					+ "' class='" + (itemOptions.subListHeaderStyleClass != null ? itemOptions.subListHeaderStyleClass : '') 
					+ "'>" + subListHeader;
		}
		
		if( itemOptions.startSubList == true && itemOptions.subListHeaderText == null)
			temp += "<li>";
		
		if( itemOptions.startSubList == true )
		{
		
			temp += "<ol 	style='" + (itemOptions.subListStyle != null ? itemOptions.subListStyle : '') 
				 + "'			class='" + (itemOptions.subListStyleClass != null ? itemOptions.subListStyleClass : '') 
				 + "'>";
		}
		
		temp += "<li style='" + (itemOptions.elementStyle != null ? itemOptions.elementStyle : '') + "' class='" + (itemOptions.elementStyleClass != null ? itemOptions.elementStyleClass : '')  + "'>";
		if( this.menuItems[i].href != 'nolink' ) {
			temp += "	<a style='" + (itemOptions.linkStyle != null ? itemOptions.linkStyle : '') + "' class='" + (itemOptions.linkStyleClass != null ? itemOptions.linkStyleClass : '')  + "' href='" + this.menuItems[i].href + "'>" + this.menuItems[i].label + "</a>";
		} else {
			temp += "	<div style='" + (itemOptions.linkStyle != null ? itemOptions.linkStyle : '') + "' class='" + (itemOptions.linkStyleClass != null ? itemOptions.linkStyleClass : '')  + "'>" + this.menuItems[i].label + "</div>";
		}
		temp += "</li>";

		if( itemOptions.endSubList == true )
		{
			temp += "</ol></li>";
		}

		if( ( itemOptions.endColumn != null && itemOptions.endColumn == true ) || (itemOptions.endRow != null && itemOptions.endRow == true ) )
		{
			temp += "</ol>";	// close out whatever list containing the internal elements
			temp += "</li>";	// finally close the actual (row or column) we are drawing
		}
	}
	
	temp += "</ul>";  // finally end the dropdown menu structure
	
	return temp;
}

function Menu_SetActive(label,first){
	/* We are not highlighting the active menu item, so
 	 * don't change the class of it
 	 *
	if (first) 
		this.displayClass = " class=\"selectnone\" ";
	else 	
		this.displayClass = " class=\"select\" ";
	*
	*/

	for (var i=0;i<this.menuItems.length;i++) {
		if (this.menuItems[i].label == label) {
			this.menuItems[i].setActive(i==0);
			this.active = true;
		}
	}
}

function Menu_SetActiveId(id,first){
	/* We are not highlighting the active menu item, so
 	 * don't change the class of it
 	 *
	if (first) 
		this.displayClass = " class=\"selectnone\" ";
	else 	
		this.displayClass = " class=\"select\" ";
	*
	*/

	for (var i=0;i<this.menuItems.length;i++) {
		if (this.menuItems[i].id == id) {
			this.menuItems[i].setActive(i==0);
			this.active = true;
		}
	}
}

function Menu_SetDisplayClass(displayClass){
	this.displayClass = displayClass;
}

function Menu_SetOptions( options ){
	this.options = options;
}

Menu.prototype.initMenu = Menu_Initialize;
Menu.prototype.add = Menu_AddMenuItem;
Menu.prototype.print = Menu_PrintMenu;
Menu.prototype.setActive = Menu_SetActive;
Menu.prototype.setActiveId = Menu_SetActiveId;
Menu.prototype.setDisplayClass = Menu_SetDisplayClass;

//---------------------------------------------------------------------------

function MainMenu(){
	this.initMainMenu();
}

function MainMenu_Initialize(){
	this.defaultMenu = "";
	this.menu = new Array();
	this.active = "N";
	this.options = {};
}

function MainMenu_Add(label,href,id,displayClass, options){
	if (this.menu.length == 0) 
		this.menu[0] = new Menu(label,href,id,"none " + displayClass, options);
	else
		this.menu[this.menu.length] = new Menu(label,href,id,displayClass, options);	
	
	return this.menu[this.menu.length -1];
};

function MainMenu_SetActive(menu,secMenu){
	for (var i=0; i<this.menu.length; i++){
		if ( this.menu[i].label == menu) {
			this.defaultMenu = this.menu[i];
			this.active = i;
			this.menu[i].setActive(secMenu,i==0);
		}
	}
}

function MainMenu_SetActiveId(id,secId){
	for (var i=0; i<this.menu.length; i++){
		if (this.menu[i].id == id) {
			this.defaultMenu = this.menu[i];
			this.active = i;
			this.menu[i].setActiveId(secId,i==0);
		}
	}
}

function MainMenu_getDefault(){
	return this.active;
}

function MainMenu_PrintMenu(){
	var temp = new String();
	usesAccordion = false;

	temp = temp + "<a href=\"/\"><img id=\"headerLogo\" src=\"" + menuHost + "/images/tessco_logo.png\"></a>";
	
	temp = temp + "<ul>";

	for ( var i=0; i<this.menu.length; i++ ) {
		temp = temp + "<li id=\"" + this.menu[i].options.menuTabId + "\" class=\"" + this.menu[i].displayClass + "\">";

		if ( this.menu[i].href != '' ) {
			temp = temp + "<a href=\"" + this.menu[i].href + "\">";
		} else {
			temp = temp + "<a href=\"#\">";
		}
	
		temp = temp + "<div class=\"top_nav_tab_name\">&nbsp;</div>";

		temp = temp + "</a>";

		temp = temp + this.menu[i].print();

		temp = temp + "</li>";
	}

	temp = temp + "</ul>";

	if ( document.getElementById("top_nav_menu") != null ) {
		document.getElementById("top_nav_menu").innerHTML = temp;
		jqueryslidemenu.buildmenu("top_nav_menu", arrowimages);	

		// support for the accordion effect - requires the jquery ui script file
		//if( usesAccordion ){
		//	jQuery('.accordion').accordion( { event: 'mouseover', autoHeight: false, active:false } );
		//}
	}
}

function MainMenu_PrintSecondaryMenu(m){
	if (this.menu[m])
		return this.menu[m].print();
	else
		return "";
}

MainMenu.prototype.initMainMenu = MainMenu_Initialize;
MainMenu.prototype.add = MainMenu_Add;
MainMenu.prototype.setActive = MainMenu_SetActive;
MainMenu.prototype.setActiveId = MainMenu_SetActiveId;
MainMenu.prototype.getDefault = MainMenu_getDefault;
MainMenu.prototype.print = MainMenu_PrintMenu;
MainMenu.prototype.printSecondaryMenu = MainMenu_PrintSecondaryMenu;

//---------------------------------------------------------------------------

function Footer(){
this.init();
}

function Footer_Initialize() {
	this.faq = "";
	this.help = "";
	this.bmlContent = "";	
}

function Footer_SetFAQs(faq){
	this.faq = faq;
}

function Footer_SetHelp(help){
	this.help = help;
}

function Footer_SetBMLContent(bmlContent) {
	this.bmlContent = bmlContent;
}

function Footer_Print() {
	if( this.faq != null && this.faq.length > 0 && document.getElementById( "footerlinkfaq" ) ) {
		document.getElementById( "footerlinkfaq" ).href=this.faq;
	}
	
	if( this.help != null && this.help.length > 0 && document.getElementById( "footerlinkhelp" ) ) {
		document.getElementById( "footerlinkhelp" ).href=this.help;
	}
	
	if( menuHost != null && menuHost.length > 0 ) {
		footerDiv = document.getElementById( "footer" );
		if( footerDiv ) {
			footerLinks = footerDiv.getElementsByTagName( 'a' );
			if( footerLinks ) {
				for( var index = 0; index < footerLinks.length; index++ ) {
					if( footerLinks[index].href.indexOf( '/' ) == 0 ) {
						footerLinks[index].href=menuHost+footerLinks[index].href;
					} else if ( footerLinks[index].href.indexOf( window.location.protocol + '//' + window.location.hostname ) == 0 ) {
						footerLinks[index].href=menuHost+footerLinks[index].href.substring( (window.location.protocol + '//' + window.location.hostname).length );
					}
				}
			}
		}
	}
}

Footer.prototype.init = Footer_Initialize;
Footer.prototype.setFAQs = Footer_SetFAQs;
Footer.prototype.setHelp = Footer_SetHelp;
Footer.prototype.setBMLContent = Footer_SetBMLContent;
Footer.prototype.print = Footer_Print;

//---------------------------------------------------------------------------

var timeOutID = 0;

function setMenu(m){
	clearTimer();
	document.getElementById("secondaryMenu").innerHTML = menu.printSecondaryMenu(m);
}

function startTimer(){
	if (timeOutID == 0) {
		window.clearTimeout(timeOutID);
	}
	timeOutID = window.setTimeout("resetMenu()",5000);
}

function clearTimer(){
	window.clearTimeout(timeOutID);
	timeOutId = 0;
}

function resetMenu(){
	setMenu(menu.getDefault());
}

function setAccountLine(text){
document.getElementById("mastheadLine").innerHTML = text.split("'").join("\'");
}

function defineMenu() 
{
	var options_template = {
		menuClass				: '',

		// the following options are meant for menuItems, NOT entire menus

		startSubList 			: false,		// starts the beginning of a sublist, inclusive.  must be used with endSubList
		endSubList 				: false,		// ends the current sublist, inclusive.  must be used with startSubList
		subListHeaderText		: null,			// text for the sublist header to render
		subListHeaderStyle		: '',			// style override for sublist header 
		subListHeaderStyleClass	: '',			// class for sublist header 
		subListStyle			: '',			// sublist (<ol>) style override
		subListStyleClass		: '',			// sublist (<ol>) class
		elementStyle			: '',			// sublist element (<li>) style override
		elementStyleClass		: '',			// sublist element (<li>) class
		linkStyle				: '',			// individual link (<a>) style override
		linkStyleClass			: '',			// individual link (<a>) class
		columnTitle				: '',			// column title, can be used on menus with 1->many columns
		columnStyleClass		: '',			// column style class
		columnStyle				: '',			// column style override
		startColumn				: false,		// starts the first/next column, must be used for any multi-column menu and in conjunction with endColumn
		endColumn				: false,		// ends the current column, must be used in conjunction with startColumn
		startRow				: false,		// starts a new row (doesnt do anything more than creates a new <ol>)
		endRow					: false,		// ends the current row (closes our current row <ol>)
		rowStyle				: '',			// row-layout style class
		rowStyleClass			: '',			// row-layout style override
		rowHeaderText			: '',			// text for a row header to render
		rowHeaderStyle			: '',			// row header style override
		rowHeaderStyleClass		: '',			// row header style class 
		headerStyleClass		: '',			// header style override
		headerText				: '',			// text for a header to render
		isCollapseable			: false,
		menuTabId 				: ""
	};

	var options = { };
	start = new Date().getTime();
	/////////////////////////////WELCOME///////////////////////////////////
	options = { menuStyleClass : "top_nav_tab1_menuStyle", menuTabId : "top_nav_tab1" };
	m = menu.add("", menuHost+"/",1,'open_right', options );	

	m.add("Log In/Log Out",menuHost+"/logon/logonLogout.do",86, options );
	/*
	if ( menuIsLoggedIn != 'true' ) {
		m.add( "Register/Buy", menuHost+"/registration/initregistration.jsp", 0 );
	}
	*/
	
	m.add("Create an Account",menuHost+"/yts/partner/become_customer/welcome.html",83, options );
	m.add("About TESSCO",menuHost+"/yts/corporate/index.html",84, options );	
	m.add("Contact Us",menuHost+"/yts/customerservice/contact/index.html",85, options );				  			  
	/////////////////////////////WELCOME///////////////////////////////////
	
	/////////////////////////////CUSTOMERS SERVED/////////////////////////
	
	options = { menuStyleClass : "top_nav_tab2_menuStyle", menuTabId : "top_nav_tab2" };
	var m = menu.add( "", menuHost + "/yts/industry/index.html", 0,'open_right', options  );

	// start the first column 
	options = { startColumn: true, columnStyleClass : "columnStyle21" };
	m.add( "Carriers/ISPs/Tower", menuHost + "/yts/industry/isp/index.html", 0, options  );
	options = {};
	m.add( "Program Managers and Contractors",  menuHost +  "/yts/industry/tower/index.html", 0, options  );
	options = { endColumn : true };		
	m.add( "Self Maintained End Users", menuHost +  "/yts/industry/smu/index.html", 0, options  );

	// second column under this menu
	options = { startColumn: true, columnStyleClass : "columnStyle22" };
	m.add( "Manufacturers", menuHost +  "/yts/industry/manufacturer/index.html", 0, options  );	
	options = {};
	m.add( "Service and Repair Organizations", menuHost +  "/yts/industry/service_repair/index.html", 0, options  );
	options = { endColumn : true };
	m.add( "Technicians", menuHost +  "/yts/industry/technician/index.html", 0, options  );		
	
	// third column under this menu
	options = { startColumn: true, columnStyleClass : "columnStyle23" };
	m.add( "Government", menuHost +  "/yts/industry/government/index.html", 0, options  );
	options = {};
	m.add( "Retailers", menuHost +  "/yts/industry/retailer/index.html", 0, options  );
	options = { endColumn : true };
	m.add( "Value-Added Resellers/Dealers", menuHost +  "/yts/industry/var/index.html", 0, options  );

	/////////////////////////////CUSTOMERS SERVED/////////////////////////
	
	/////////////////////////////SYSTEMS & APPLICATIONS///////////////////
	options = { menuStyleClass : "top_nav_tab3_menuStyle", menuTabId : "top_nav_tab3" };
	var m = menu.add( "", menuHost + "/yts/systems_applications/index.html", 0,'open_right', options );
	m.add( "Public Carrier Networks", menuHost + "/yts/systems_applications/public_carrier_networks/index.html", 0, options );		
	m.add( "Private Outdoor Networks",  menuHost + "/yts/systems_applications/private_outdoor_networks/index.html", 0, options );		
	m.add( "Private Indoor Networks", menuHost + "/yts/systems_applications/private_indoor_networks/index.html", 0, options );
	m.add( "Critical Communications", menuHost + "/yts/systems_applications/critical_communications/index.html", 0, options );
	m.add( "Physical Security", menuHost + "/yts/systems_applications/physical_security/index.html", 0, options );
	m.add( "Mobile Device Accessories", menuHost + "/yts/systems_applications/mobile_device_accessories/index.html", 0, options );
	m.add( "Remote Monitoring Control", menuHost + "/yts/systems_applications/remote_monitoring_control/index.html", 0, options );

	/////////////////////////////SYSTEMS & APPLICATIONS///////////////////


	/////////////////////////////PRODUCTS OFFERED///////////////////
	options = { menuStyleClass : "top_nav_tab4_menuStyle", menuTabId : "top_nav_tab4" };
	var m = menu.add("",menuHost+"/products/productHierarchy.do",81,'open_right', options );
	
	///////////////NETWORK SYSTEMS - Column 1///////////////
	options = { startColumn:true, columnTitle:"Network Systems", columnStyleClass : "columnStyle41", elementStyleClass:"subListElement"};
	m.add("Distributed Antenna Systems &amp;<br>Bi-Directional Amplifiers",menuHost+"/products/productHierarchy.do?tabId=33013",33013, options );
	options = { elementStyleClass:"subListElement" };
	m.add("Broadband Radios",menuHost+"/products/productHierarchy.do?tabId=33012",33012, options );
	m.add("Network Equipment",menuHost+"/products/productHierarchy.do?tabId=33007",33007, options );
	options = { endColumn:true};
	m.add("Physical Security Systems",menuHost+"/products/productHierarchy.do?tabId=32134",32134, options );


	///////////////BASE STATION INFRASTRUCTURE - Column 2///////////////
	options = { startColumn:true, columnTitle:"Base Station Infrastructure", columnStyleClass : "columnStyle42"};
	m.add("Towers &amp; Site Hardware",menuHost+"/products/productHierarchy.do?tabId=33009",33009, options );
	options = { };
	m.add("Enclosures &amp; Cable Management",menuHost+"/products/productHierarchy.do?tabId=32162",32162, options );
	m.add("Grounding &amp; Arrestors",menuHost+"/products/productHierarchy.do?tabId=32170",32170, options );
	m.add("Cable, Connectors &amp; Jumpers",menuHost+"/products/productHierarchy.do?tabId=33022",33022, options );
	m.add("Base Station Antennas",menuHost+"/products/productHierarchy.do?tabId=33011",33011, options );
	options = { endColumn:true };	
	m.add("Power Systems",menuHost+"/products/productHierarchy.do?tabId=6",6, options );

	
	/////////////// INSTALLATION TEST & MAINTENANCE - Column 3 ///////////////
	//Test Equipment
	options = { startColumn:true, columnTitle:"Installation Test &amp; Maintenance", columnStyleClass : "columnStyle43"};
	m.add("Test Equipment",menuHost+"/products/productHierarchy.do?tabId=9",9, options );
	options = { };
	m.add("Tools",menuHost+"/products/productHierarchy.do?tabId=33019",33019, options );
	m.add("Installation Supplies",menuHost+"/products/productHierarchy.do?tabId=25",25, options );
	m.add("Safety Equipment &amp; Supplies",menuHost+"/products/productHierarchy.do?tabId=33023",33023, options );
	m.add("Device Repair Parts",menuHost+"/products/productHierarchy.do?tabId=21",21, options );
	
	//TRAINING & SERVICES	
	options = { endColumn:true, headerText:"<h4>Training &amp; Services</h4>",headerStyleClass:"tns_supertab"};
	m.add("Training &amp; Education",menuHost+"/products/productHierarchy.do?tabId=32127",32127, options );
	
	
	///////////////MOBILE DEVICES & ACCESSORIES - Column 4///////////////
	//Batteries & Chargers
	options = { startColumn:true, columnTitle:"Mobile Devices &amp; Accessories", columnStyleClass : "columnStyle44"};
	m.add("Batteries &amp; Chargers",menuHost+"/products/productHierarchy.do?tabId=33020",33020, options );
	options = { };
	m.add("Cases &amp; Protection",menuHost+"/products/productHierarchy.do?tabId=33018",33018, options );
	m.add("Memory &amp; Data",menuHost+"/products/productHierarchy.do?tabId=33021",33021, options );
	m.add("Corded Headsets, Car Kits, &amp; Mounts",menuHost+"/products/productHierarchy.do?tabId=33016",33016, options );
	m.add("Bluetooth Enabled Devices",menuHost+"/products/productHierarchy.do?tabId=33014",33014, options );
	m.add("Audio &amp; Music Accessories",menuHost+"/products/productHierarchy.do?tabId=33024",33024, options );
	m.add("Two-Way Radios &amp; Accessories",menuHost+"/products/productHierarchy.do?tabId=33015",33015, options );	
	m.add("Mobile Antennas &amp; Amplifiers",menuHost+"/products/productHierarchy.do?tabId=33010",33010, options );
	options = { endColumn:true };
	m.add("Vehicle Mounts",menuHost+"/products/productHierarchy.do?tabId=33008",33008, options );
	

	//Bottom Row
	options = { startRow : true, rowStyleClass : "rowStyle",
		startSubList:true, subListStyleClass:"subList", elementStyleClass:"subListElement", linkStyleClass:"subListLink",isCollapseable:false};	
	m.add("All Brands &amp; Manufacturers",menuHost+"/yts/partner/manufacturer_list/index.html",41, options );
	options = { elementStyleClass:"subListElement", linkStyleClass:"subListLink"};
	m.add("GSA",menuHost+"/products/productHierarchy.do?pplan=GSA",42, options );
	m.add("Outlet",menuHost+"/products/outlet/productHierarchy.do",43, options );
	m.add("What's New",menuHost+"/yts/industry/whats_new/new_featured_products.html",44, options );
	options = { endRow:true, endSubList:true, elementStyleClass:"subListElement", linkStyleClass:"subListLink"};
	
	/////////////////////////////PRODUCTS OFFERED///////////////////
	
	/////////////////////////////SUPPORT///////////////////
	options = { menuStyleClass : "top_nav_tab5_menuStyle", menuTabId : "top_nav_tab5" };
	var m = menu.add( "",menuHost+"/yts/customerservice/index.html",0,'open_left', options );

	//My Account
	var accountLink = "";
	var eprisePage = self.location.href.indexOf( "/yts" ) != -1 || self.location.href.indexOf( "phoenix.zhtml" ) != -1;
	
	//eprisePage = true;
	
	options = { menuStyleClass : "top_nav_tab5_menuStyle", linkStyleClass : "nolink" };
	m.add( "Call 800-472-7373", 'nolink', 0, options );
	
	options = { menuStyleClass : "top_nav_tab5_menuStyle" };
	m.add( "Email", 'mailto:cs@tessco.com', 0, options );
	m.add( "Customer Service", '/yts/customerservice/index.html', 0, options );
	
	// my account should not be displayed if we are supposed to hide the account link
	// it should always be displayed for eprise pages
	if ( eprisePage || menuAccountLink == 'DISPLAY' ) {
		accountLink = menuHost+'/account/getAccountInfo.do';
		m.add("My Account",accountLink,0, options );
	}
	/////////////////////////////SUPPORT///////////////////

}

function isUserLoggedIn() {
	
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
		return 'false';
	}
	
    xmlhttp.open('GET', "/logon/loggedin.jsp", false);
	xmlhttp.send()
	return xmlhttp.responseText.replace(/^\s*/, "").replace(/\s*$/, "");  //trim results
}

var menuHost = "";
var menuIsLoggedIn = false; //isUserLoggedIn();

try {
	menuHost = menuRootURL;
} 
catch( e ) {
	menuHost = "";
}

var menu = new MainMenu("menu");
defineMenu();

var footer = new Footer();


