	var pageName	= (window.location.pathname.split('/')).pop()
		
	function getNav(){
		// works out the page the site has loaded, and returns a reference to the menu element in the array
		var index	= 0
		var query	= new Querystring()
		var page	= query.get('page')
		
		if(page == null){
			page	= query.get('searchtype')
			}

		switch(page){
			// sales
				case 'sales':
				case 'sg_buying.html':
				case 'sg_selling.html':
				case 'sell.html':
					index = 1;
					break;
			
			// rentals
				case 'rentals':
				case 'sg_letting.html':
				case 'sg_renting.html':
					index = 2;
					break;
				
			// services
				case 'block.html':
				case 'corporate.html':
				case 'letservices.html':
				case 'individual.html':
				case 'overseas.html':
				case 'services.html':
					index = 3;
					break;
			
			// company
				case 'company.html':
					index = 4;
					break;
			
			// links
				case 'travel.html':
				case 'utilities.html':
					index = 5;
					break;
			
			// contact
				case 'contact.html':
				case 'form-block.html':
				case 'form-individual.html':
				case 'form-finance.html':
				case 'form-solicitors.html':
				case 'form-register.html':
				case 'mailFail.html':
				case 'mailSuccess.html':
					index = 6;
					break;
					
			// other
				case 'testimonial.html':
				case 'glossary.html':
				case 'postcode.html':
				case 'stampduty.html':
					break;
					
				default:
			}
	
		return index;
		}
		
	function initNav(index){
		// put all the navigation elements in an array for future access
			var arrNav		= new Array()
			for(var i = 1; i <= 6 ; i++){
				arrNav[i] = document.getElementById('nav_'+ i)
				}
			
				
		// get the correct menu element to show
			if(index == undefined){
				index = getNav()
				}
				
		// update gfx
			//alert(index)
			if(index > 0){
				arrNav[index].src = '../images/nav_on_'+index+'.gif'
				}
			
		}
