function initialize () {
	document.oncontextmenu = new Function ("return false");
}

function showMenu ( id ) {

	switch ( id ) {
		case "about":
			document.getElementById ( "popup_menu" ).style.left = "210px";
			document.getElementById ( "popup_menu" ).innerHTML = "<p class='menu_text' id='index' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>About Us</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='company_profile' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Company Profile</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='core_beliefs' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Core Beliefs</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='mission_statement' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Mission Statement</p>";
			break;
		case "news":
			document.getElementById ( "popup_menu" ).style.left = "330px";
			document.getElementById ( "popup_menu" ).innerHTML = "<p class='menu_text' id='latest' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Latest</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='projects_complete' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Projects Complete</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>"
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='community_investment' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Community Investment</p>";
			break;
		case "downloads":
			document.getElementById ( "popup_menu" ).style.left = "448px";
			document.getElementById ( "popup_menu" ).innerHTML = "<p class='menu_text' id='health_safety' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Health & Safety</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='quality' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Quality</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='environmental' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Environmental</p>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<hr class='ruler'/>";
			document.getElementById ( "popup_menu" ).innerHTML = document.getElementById ( "popup_menu" ).innerHTML + "<p class='menu_text' id='equal_opportunities' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Equal Opportunities</p>"
			break;
		case "careers":
			document.getElementById ( "popup_menu" ).style.left = "566px";
			document.getElementById ( "popup_menu" ).innerHTML = "<p class='menu_text' id='current_opportunities' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>Current Opportunites</p>";
			break;
		case "contact":
			document.getElementById ( "popup_menu" ).style.left = "640px";
			document.getElementById ( "popup_menu" ).innerHTML = "<p class='menu_text' id='general_enquiries' onmouseover='showMenuHilight ( this.id )' onmouseout='hideMenuHilight ( this.id )' onmousedown='showPage ( this.id )'>General Enquiries</p>";
			break;
		default:
			break;
	}

 	document.getElementById ( "popup_menu" ).style.display = "block";
}

function hideMenu ( id ) {
 	document.getElementById ( "popup_menu" ).style.display = "none";
}


function showMenuHilight ( id ) {
	document.getElementById ( id ).className = "menu_text_hilight";
}

function hideMenuHilight ( id ) {
	document.getElementById ( id ).className = "menu_text";
}

function showPage ( id ) {
	var hrefSplit = window.location.href.split("/");
	var urlSplit  = hrefSplit.slice(0, hrefSplit.length-1);
	
	var action="";
	for (var i=0; i<urlSplit.length; i++) {
		action=action+urlSplit[i] + '/';
	}


	if (id == "health_safety" || id == "quality" || id == "environmental" || id == "equal_opportunities" || id == "applicaton_form") {
		id = "downloads";
	}

	var form = document.getElementById('myForm');
	    form.action=action + id + '.htm';
	    form.method='GET';
	    form.target='_self';
	    form.submit();
}
