// JavaScript Document

var imagesNormal = new Array("images/homeButton.jpg", "images/newHousesButton.jpg", "images/renovationsButton.jpg", "images/decksAndLandscapingButton.jpg", "images/projectManagementButton.jpg");
var imagesOver = new Array("images/homeButtonOver.jpg", "images/newHousesButtonOver.jpg", "images/renovationsButtonOver.jpg", "images/decksAndLandscapingButtonOver.jpg", "images/projectManagementButtonOver.jpg");
//var imagesDown = new Array("images/homeButtonDown.gif", "images/guestRoomsButtonDown.gif", "images/facilitiesButtonDown.gif", "images/contactUsButtonDown.gif");
	function changeOver(imageIndex){
		document.images[imageIndex+1].src = imagesOver[imageIndex];	
	}
	function changeBack(imageIndex){
		document.images[imageIndex+1].src = imagesNormal[imageIndex];
	}

function checkData(){
	var name = document.getElementById("name"); 
	var email = document.getElementById("email");
	var phone = document.getElementById("phone");
	
	
	if(name.value == "" || !isNaN(name.value)){  //check to see if field is empty or is a number
		alert("Please enter your name");
		name.focus();	//not valid, so set focus to correct field
		return false;  //stops the form being submitted
	}
	
	//you only get here if the name is valid
	else if (email.value == ""){  //check if email field is empty
		alert("Please enter your email");
		email.focus();  //set focus to email
		return false;	
	}
	
	
	//you only get here if the name is valid and an email address has been entered
	else if (phone.value == "" || isNaN(phone.value)){  //check if phone field is empty or not a number
		alert("Please enter your phone number");
		phone.focus();  //set focus to phone
		return false;	
	}
	
	
		return true;	//allows form to be submitted	

}

