$(document).ready(function(){
$("#home").hover( function() { replaceImage('#home', 'images/btn_homeHover.jpg');}, 
function() {replaceImage('#home', 'images/btn_home.jpg'); });  
$("#acreage").hover( function() { replaceImage('#acreage', 'images/btn_acreageHover.jpg');}, 
function() {replaceImage('#acreage', 'images/btn_acreage.jpg'); });
$("#residential").hover( function() { replaceImage('#residential', 'images/btn_residentialHover.jpg');}, 
function() {replaceImage('#residential', 'images/btn_residential.jpg'); });
$("#rentals").hover( function() { replaceImage('#rentals', 'images/btn_rentalsHover.jpg');}, 
function() {replaceImage('#rentals', 'images/btn_rentals.jpg'); });
$("#openhomes").hover( function() { replaceImage('#openhomes', 'images/btn_openhomesHover.jpg');}, 
function() {replaceImage('#openhomes', 'images/btn_openhomes.jpg'); });
$("#sold").hover( function() { replaceImage('#sold', 'images/btn_soldHover.jpg');}, 
function() {replaceImage('#sold', 'images/btn_sold.jpg'); });
$("#contactus").hover( function() { replaceImage('#contactus', 'images/btn_contactusHover.jpg');}, 
function() {replaceImage('#contactus', 'images/btn_contactus.jpg'); });
});


function replaceImage(attr, img){
	$(attr).attr('src', img);
}

function validatePropEnqForm(){
	error = "";
	if (document.getElementById('name').value == ""){
		error += "- Please enter your name\n";
	}
	if (document.getElementById('email').value == ""){
		error += "- Please enter your email\n";
	}
	if (document.getElementById('phone').value == ""){
		error += "- Please enter your phone number\n";
	}
	if (document.getElementById('code').value == ""){
		error += "- Please enter the security code";
	}

	if (error)
	{
		alert(error);
		return false;
	}
	return true;
}



function replacePropImage(image, ref, imageID){
	$('#mainImage').attr('src', image);
	$(".detailsThumbSelected").attr('class', '');
	$("#"+imageID).attr('class', 'detailsThumbSelected');
}


