//------------------------------ menu script-------------------
if (document.all){oDoc= function(nme){return document.all(nme)}}
if (document.getElementById){oDoc=function(nme){return document.getElementById(nme)}}

//write in code to create innerText property for Mozilla
if (/Mozilla\/5\.0/.test(navigator.userAgent)){
   document.write('<script type="text/javascript" src="scripts/innerText-get-set.js"></sc' + 'ript>');
}


function showLogin(){
// toggle login
oDoc("login").style.display=(oDoc("login").style.display=="block"?"none":"block");

	// if login now showing
	if (oDoc("login").style.display=="block") 
	{
		oDoc("loginLink").innerText="Log in [X]";
		oDoc("loginNav").innerText="Log in [X]";
		oDoc("lbl_msg").style.visibility="hidden";

	}
	else {
		oDoc("loginLink").innerText="Log in";
		oDoc("loginNav").innerText="Log in";
		}
}

function Item(obj){

var submenu="sub"+obj.id;

// ensure login is hidden and [X] cleared
oDoc("login").style.display="none";
oDoc("loginLink").innerText="Log in";
oDoc("loginNav").innerText="Log in";

if (submenu==oCurrentMenu){
// bail out
}else{
		// always clear submenuX
		var oHide = $("#submenuX");  
		oHide.hide("slow");

		
		// if a nav menu has been opened - close it
		if (oCurrentMenu!=""){
			oDoc(oCurrentMenu).style.display="none";
			
		}
		//Then open next menu and set oCurrentMenu to the new nav menu
		
		var oShow = $("#"+submenu);   
		oShow.show("slow");
	
		//set current to value passed in
		oCurrentMenu = submenu
		}
}

function load(page,menu) {
	if (page!="") {oDoc("content").src=page;}//if page set
	//if a nav menu is called set that
		if (menu!=""){

		// clear current nav menu
		if (oCurrentMenu!==""){
		
			oDoc(oCurrentMenu).style.display="none"
		}
		else {oDoc("submenuX").style.display="none"}

		oDoc(menu).style.display="block";
		oCurrentMenu=menu;
		}// if currentMenu
	}// if menu	


function swap(page) {
	top.location="default.aspx?"+page;
}

function menu(newID){
this.id = newID
}
// Initialise for variables used in first page
//----create object to hold ref to submenuX (offers)div

//oOffers=new menu("menuX");

		