function activeNav(button){
		var buttons = document.body.getElementsByTagName("li");
		for(var x = 0; x < buttons.length; x++){
		buttons[x].className = 'up';}
		button.className = 'active';
		}
	

function overNav(button){
		button.style.cursor = 'pointer';
		if (button.className != 'active'){
			button.className = 'over';
		}
		else {button.className = 'active';}
		}

function outNav(button){
		if (button.className != 'active'){
			button.className = 'up';
		}
		else {button.className = 'active';}
		}

function overLink(link){
		if (link.className == 'link'){
			link.className = 'linkup';
		}}

function outLink(link){
		if (link.className == 'linkup'){
			link.className = 'link';
		}}
		

function setActiveNav(button){
		var buttons = document.body.getElementsByTagName("li");
		for(var x = 0; x < buttons.length; x++){
		buttons[x].className = 'up';}
		var activeButton = document.getElementById(button);
		activeButton.className = 'active';
		}

function loadXMLDoc(div,doc)
	{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
  	xmlhttp=new XMLHttpRequest();
  	}
	else
  	{// code for IE6, IE5
  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function()
  	{
  	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    	document.getElementById(div).innerHTML=xmlhttp.responseText;
    	}
  	}
	xmlhttp.open("GET","content/"+doc,true);
	xmlhttp.send();
	}
	


function bookNow(){
		window.open('http://www.booking.com/hotel/gb/the-manor-stoke-on-trent.html?aid=330843;lang=en;pb=1','jav','resizable=yes,scrollbars=yes,toolbar=yes');
	}

function galleryOpen(location){
		var main = document.getElementById('main');
		while(main.firstChild){
		main.removeChild(main.firstChild);
		}
		var root = 'pictures/manorphotos/main/';
		main.innerHTML = "<div id='fancybox'></div><div id='picframe' class='round'><img id='mainImage' class='mainImage round darkshadow' onClick='back();' /></div>";
		document.getElementById('mainImage').src = root+location;
	}
	
function weddingGalleryOpen(location){
		var main = document.getElementById('weddingMain');
		while(main.firstChild){
		main.removeChild(main.firstChild);
		}
		var root = 'pictures/manorphotos/wedding/';
		main.innerHTML = "<div id='fancybox'></div><div id='picframe' class='round'><img id='wedImage' class='mainImage round darkshadow' onClick='wedback();' /></div>";
		document.getElementById('wedImage').src = root+location;
	}


function back(){
		loadXMLDoc('main','gallery.txt');
		}
	
function wedback(){
		loadXMLDoc('main','weddingGallery.txt');
		}

function packback(){
		loadXMLDoc('main','weddings_home.txt');
		}

function showConfirm(form){
		
	if (validateNonEmpty(form["message"])){
		var r=confirm("Confirm Send Mail");
			if (r==true){
  				form.submit();
			}
  			else{
  				alert("Action Cancelled.  Your message was not sent");
  			}
	}
	else{
		alert('You did not include a message.  You must include a message to be sent');
	}
	}



function confirmEvent(form){
		
	if (validateNonEmpty(form["content"])&&
		validateNonEmpty(form["eventTitle"])){
		var r=confirm("Confirm Save");
			if (r==true){
  				form.submit();
			}
  			else{
  				alert("Action Cancelled.  Your Event was not saved");
  			}
	}
	else{
		alert('You are missing some information - You must include a title AND details!');
	}
	}



function confirmEmailSpecials(form){
		
	if (validateNonEmpty(form["email"])&&
		validateNonEmpty(form["name"])){
					form.submit();
	}
	else{
		alert('You did not type in all the details.  Please ensure that you enter both your name and Email address.');
	}
	}

function confirmEmailAdd(form){
		alert('linked');
	if (validateNonEmpty(form["email"])&&
		validateNonEmpty(form["guest"])){
					form.submit();
	}
	else{
		alert('You did not type in all the details.  Please ensure that you enter both your name and Email address.');
	}
	}


function GBform(form){
	if (validateNonEmpty(form["email"])&&
		validateNonEmpty(form["name"])&&
			validateNonEmpty(form["DateStay"])&&
				validateNonEmpty(form["comment"])){
					form.submit();
	}
	else{
		alert('Please complete all sections of the form');
	}
	}		



function signupValidate(form){
		if (validateEmail(form["signupemail"],document.getElementById['signup_help'])){
				form.submit();
	}
	else{
		alert('Please enter a valid email address');
	} 
	}


function changeinfo(id){
	document.getElementById(id).checked=true;
	var j = "change";
	var newstr = j+id;
	document.getElementById(newstr).checked=true;
}


