var description = navigator.userAgent;

//If client machine is running IE6 give menu links as simple text links (no drop down menu)

if ( description.match(/MSIE 6.0/) )
{
	LinksString = 
	'(1) <a href="http://campionconcerns.org.uk/AboutCampionConcerns.html">Campion Concerns</a>, ' +
	'(2) <a href="http://campionconcerns.org.uk/InTheBeginning.html">In the Beginning</a>, ' +
	'(3) <a href="http://campionconcerns.org.uk/FirstApplication.html">First Application</a>, ' +
	'(4) <a href="http://campionconcerns.org.uk/SecondApplication.html">Second Application</a>, ' +
	'(5) <a href="http://campionconcerns.org.uk/newsletters/index.html">Newsletters</a>, ' +
	'(6) <a href="http://campionconcerns.org.uk/blackbook/">Black Book</a>, ' +
	'(7) <a href="http://campionconcerns.org.uk/yellowbook/">Yellow Book</a>, ' +
	'(8) <a href="http://campionconcerns.org.uk/CC%20Evidence/evidence.html">White Book</a>, ' +
	'(9) <a href="http://campionconcerns.org.uk/links.html">Links</a>, ' +
	'(10) <a href="http://campionconcerns.org.uk/contact.html">Contact Us</a>, ' +
	'(11) <a href="http://campionconcerns.org.uk/planningdept.html">Planning Dept</a>, ' +
	'(12) <a href="http://campionconcerns.org.uk/wardcouncillors.html">Ward Councillors</a>, ' +
	'(13) <a href="http://campionconcerns.org.uk/index.php">Homepage</a>, ';

	document.write("<p class='medium'>" + LinksString + "</p>");

}
else
{
	//This bit hides the drop down menu when the mouse moves outside of the prescribe area

	function track(evnt)
	{
		if (!evnt) 
		{ evnt=window.event; var x = evnt.x; var y = evnt.y; }
		else
		//{ var x = evnt.pageX; var y = evnt.pageY; }
		{var x = evnt.clientX; var y = evnt.clientY; }

		if ( ( (x<49 || x>130) && (y<=20) ) ||  ((x<49 || x>210) && (y>21) ) || (y<3) || (y>200))
		document.getElementById("menu1").style.visibility = "hidden";

		if ( ( (x<179 || x>280) && (y<=20) ) || ( (x<179 || x>340) && (y>21) ) || (y<3) || (y>145))
		document.getElementById("menu2").style.visibility = "hidden";

		if ( ( (x<319 || x>450) && (y<=20) ) || ( (x<319 || x>480) && (y>21) ) || (y<3) || (y>145))
		document.getElementById("menu3").style.visibility = "hidden";

		if ( ( (x<499 || x>610) && (y<=20) ) || ( (x<499 || x>660) && (y>21) ) || (y<3) || (y>130)) 
		document.getElementById("menu4").style.visibility = "hidden";
	}

	
	//Get feedback from MouseOver event and reveal the corresponding menu
	document.onmousemove = track;


	function reveal(menu)
	{
		if (menu == 1) document.getElementById("menu1").style.visibility = "visible";
		if (menu == 2) document.getElementById("menu2").style.visibility = "visible";
		if (menu == 3) document.getElementById("menu3").style.visibility = "visible";
		if (menu == 4) document.getElementById("menu4").style.visibility = "visible";
	}

	//Generate MouseOver events. Reveal appropriate drop-down menu.
	menustring = '<span id="bar">'+
	'<span style="position:absolute; left:50px"><a href = "javascript://" onmouseover="reveal(1)">Background</a></span>'+
	'<span style="position:absolute; left:180px"><a href = "javascript://" onmouseover="reveal(2)">Our materials</a> </span>'+
	'<span style="position:absolute; left:320px"><a href = "javascript://" onmouseover="reveal(3)">Current Application</a> </span>'+
	'<span style="position:absolute; left:500px"><a href = "javascript://" onmouseover="reveal(4)">Contacts/Links</a> </span>';


	//Sarcastic comment for people who try to return to the Homepage when they are on it!
	if (window.location.href == "http://campionconcerns.org.uk/index.php")
	{
	menustring = menustring +
	'<span style="position:absolute; left:650px"><a href = "http://campionconcerns.org.uk/index.php" title="This IS the homepage!">'+
	'Homepage</a> </span>' +
	'</span>';
	}
	else
	{
	menustring = menustring +
	'<span style="position:absolute; left:650px"><a href = "http://campionconcerns.org.uk/index.php" title="Click to return to Homepage">'+
	'Homepage</a> </span>' +
	'</span>';
	}
	
	//Set up the items in the drop down menus. The MenuStyle Class ensures that they are hidden by default.
	menustring=menustring +

	'<span class="MenuStyle" id="menu1" style="left:45px; height:160px">' +
	'<a href="http://campionconcerns.org.uk/AboutCampionConcerns.html"> Campion Concerns</a><br>' +
	'<a href="http://campionconcerns.org.uk/InTheBeginning.html"> In the beginning</a><br>' +
	'<a href="http://campionconcerns.org.uk/AfterConsultation.html"> \'Consultation\'</a><br>' +
	'<a href="http://campionconcerns.org.uk/FirstApplication.html"> First application</a><br>' +
	'<a href="http://campionconcerns.org.uk/SecondApplication.html"> Second application</a><br>' +
	'<a href="http://campionconcerns.org.uk/PublicInquiry.html"> Public Inquiry</a><br>' +
	'<a href="http://campionconcerns.org.uk/SiteViews.html"> Site views</a><br>' +
	'<a href="http://campionconcerns.org.uk/DesignIssues.html"> Design Issues</a>' +
	'</span>' +

	'<span class="MenuStyle" id="menu2" style="left:175px; height:120px">' +
	'<a href="http://campionconcerns.org.uk/newsletters/index.html"> Newsletters</a><br>' +
	'<a href="http://campionconcerns.org.uk/blackbook/"> 1st application</a><br>' +
	'<a href="http://campionconcerns.org.uk/yellowbook/"> 2nd application</a><br>' +
	'<a href="http://campionconcerns.org.uk/CC%20Evidence/evidence.html"> 1st Public Inquiry</a><br>' +
	'<a href="http://campionconcerns.org.uk/greenbook/"> 3rd application</a><br>' +
	'<a href="http://campionconcerns.org.uk/application4/application4.html"> 4th application</a>' +
	'</span>' +

	'<span class="MenuStyle" id="menu3" style="left:315px; height:120px">' +
	'<a href="http://campionconcerns.org.uk/application4/index.html">Documentation</a><br>' +
	'<a href="http://campionconcerns.org.uk/application4/CampionResponseToApp4_B.pdf">Consultation response</a><br>' +
	'<a href="http://campionconcerns.org.uk/application4/CCMG_LetterToIBAC.pdf">Letter to councillors</a><br>' +
	'<a href="http://campionconcerns.org.uk/application4/PlanningMeetings.html">Planning Meetings</a><br>' +
	'<a href="http://campionconcerns.org.uk/application4/LettersApp4.html"> Letters</a><br>' +
	'<a href="http://campionconcerns.org.uk/application3/YourViews/YourViews.php"> Your views</a>' +
	'</span>' +
	
	'<span class="MenuStyle" id="menu4" style="left:495px;  height:100px">' +
	'<a href="http://campionconcerns.org.uk/links.html"> Useful Links</a><br>' +
	'<a href="http://campionconcerns.org.uk/contact.html"> Contact us</a><br>' +
	'<a href="http://campionconcerns.org.uk/planningdept.html"> Planning Department</a><br>' +
	'<a href="http://campionconcerns.org.uk/wardcouncillors.html"> Ward Councillors</a><br>' +
	'<a href="http://campionconcerns.org.uk/JTP.html">Contact JTP</a>' + 
	'</span>';

	//Write the hidden menus into the html.
	document.write(menustring);
}


