// JavaScript Document
	var currentSection="";
	var tempData="";
	function showSection(sectionName){
		document.getElementById(sectionName+"Label").style.display = "block";
		tempData = document.getElementById("animatedButtons").style.background;
		document.getElementById("animatedButtons").style.background = "none";
		currentSection = sectionName+"Label";
	}
	function clearSection(){
		document.getElementById(currentSection).style.display = "none";
		document.getElementById("animatedButtons").style.background = "url('images/buttonsAnimated.gif') top right no-repeat";
		tempData = "";
		currentSection="";
	}
	
	function showMap(){
		document.getElementById('screenDarkener').style.display='block';
		document.getElementById('mapOverlay').style.display='block';
		if(document.getElementById('flashContent')) document.getElementById('flashContent').style.display='none';
	}
	function hideMap(){
		document.getElementById('mapOverlay').style.display='none';
		document.getElementById('screenDarkener').style.display='none';
		if(document.getElementById('flashContent')) document.getElementById('flashContent').style.display='block';
	}
	
	function showBlurb(){
		document.getElementById('screenDarkener').style.display='block';
		document.getElementById('blurbOverlay').style.display='block';
		if(document.getElementById('flashContent')) document.getElementById('flashContent').style.display='none';
	}
	function showBlurb2(){
		document.getElementById('screenDarkener').style.display='block';
		document.getElementById('blurbOverlay2').style.display='block';
		if(document.getElementById('flashContent')) document.getElementById('flashContent').style.display='none';
	}
	function hideBlurb(){
		document.getElementById('blurbOverlay').style.display='none';
		//document.getElementById('blurbOverlay2').style.display='none';
		document.getElementById('screenDarkener').style.display='none';
		if(document.getElementById('flashContent')) document.getElementById('flashContent').style.display='block';
	}
	
	
	//SCHEDULER FUNCTIONS
	var cellHighlighted = false;
	var storedBorder = null;
	function highlightCell(el){
		if(!cellHighlighted){
			storedBgColor = el.style.backgroundColor;
			storedBorderColor = el.style.borderColor;
			storedColor = el.style.color;
			el.style.backgroundColor = "#ffffff";
			el.style.borderColor = "#888888"
			el.style.color = "#990000";
			el.style.cursor = "pointer";
			cellHighlighted = true;
		}
		else{
			el.style.backgroundColor = storedBgColor;
			el.style.borderColor = storedBorderColor;
			el.style.color = storedColor;
			storedBgColor = null;
			storedBorderColor = null;
			el.style.cursor = "normal";
			cellHighlighted = false;
		}
	}
	
	function gotoDay(thisDate){
		location.href="sched.php?date="+thisDate;
	}
	
	function gotoBook(thisId){
		location.href="sched.php?bookingId="+thisId;
	}
	
	function clearBook(thisId){
		if(confirm("Are you sure you want to clear this booking?"))	location.href="sched.php?clearBook="+thisId;
	}
	
	function checkFields(){
		
		if(document.bookingForm.clientFname.value == "" || document.bookingForm.clientLname.value == "" || document.bookingForm.clientcontact.value == "" || document.bookingForm.clientEmail.value == ""){
			alert("Sorry, but you must complete all fields to book a June Session!");
			return false;
		}
		
		else {return true;}
	}
