function init_menu(){

	if (document.all){ // users browser is IE
		for(i = 0; i < document.all('navMenu').all.length; i++){//for each item within 'navMenu'
			if(document.all('navMenu').all[i].tagName.toUpperCase() == 'UL'){ //if the element is a menu body
				document.all('navMenu').all[i].style.display = 'none';// hide it
			}
		}
	} else if (document.getElementsByTagName && document.getElementById){ // user browser is mozilla
		var oContainer = document.getElementById('navMenu').getElementsByTagName('ul');// set collection of elements within 'navMenu'
		for(i = 0; i < oContainer.length; i++){ //for each element within 'b2bMenu'
			oContainer[i].style.display = 'none';//hide
		}
	}
	//.oOo.
	var strLocation = window.location.toString();
	if (strLocation.toLowerCase().indexOf('/people/') > 0){handler('people')};
	if (strLocation.toLowerCase().indexOf('/franchising/') > 0){handler('franchising')};
	if (strLocation.toLowerCase().indexOf('/property_planning/') > 0){handler('property')};
	if (strLocation.toLowerCase().indexOf('/investor/') > 0){handler('investor')};
	if (strLocation.toLowerCase().indexOf('/media_centre/') > 0){handler('media')};
	//.oOo.
}

function handler(identifier){
	if (document.all){ // then this browser is ie
		if(document.all[identifier].style.display == 'none'){ // if this element is hidden
			for(i = 0; i < document.all('navMenu').all.length; i++){//for each elem within 'navMenu'
				if(document.all('navMenu').all[i].tagName.toUpperCase() == 'UL'){ //if the item is a menu body
					document.all('navMenu').all[i].style.display = 'none';// hide
				}
			}
			if (document.all(identifier).parentElement.parentElement.getAttribute('id') != 'navMenu'){  //use parent node twice for 'ul/li'
				//this is a sub menu
					var tmpIdentifier = identifier
					document.all(tmpIdentifier).style.display = 'block';
					while (document.all(tmpIdentifier).parentElement.parentElement.getAttribute('id') != 'navMenu'){
						tmpIdentifier = document.all(tmpIdentifier).parentElement.parentElement.getAttribute('id');
						document.all(tmpIdentifier).style.display = 'block';
					}
			}else{
				document.all(identifier).style.display = '';
			}
		}else{ //if the div clicked is shown
			document.all[identifier].style.display = 'none'; //close
		}
	} else if (document.getElementById){ //then this browser is mozilla
		var oContainer = document.getElementById('navMenu').getElementsByTagName('ul');// set collection of elems within 'navMenu'
		if(document.getElementById(identifier).style.display == 'none'){ // if this element is hidden
			document.getElementById(identifier).style.display = 'block';
			//first close all men u items
			for(i = 0; i < oContainer.length; i++){ //for each item within 'navMenu'
				if(oContainer[i].tagName.toUpperCase() == 'UL'){// if the item is another menu body
					oContainer[i].style.display = 'none';//hide
				}
			}
			//then open the item thats been clicked
			if (document.getElementById(identifier).parentNode.parentNode.getAttribute('id') != 'navMenu'){  //use parent node twice for 'ul/li'
				//this is a sub menu
					var tmpIdentifier = identifier;
					document.getElementById(tmpIdentifier).style.display = 'block';
					while (document.getElementById(tmpIdentifier).parentNode.parentNode.getAttribute('id') != 'navMenu'){
						tmpIdentifier = document.getElementById(tmpIdentifier).parentNode.parentNode.getAttribute('id');
						document.getElementById(tmpIdentifier).style.display = 'block';
					}
			}else{//this is the daddy menu item
				document.getElementById(identifier).style.display = 'block';	//make the clicked item visible
			}
		}else{ //if the div clicked is shown
			document.getElementById(identifier).style.display = 'none'
		}
	}
}