jQuery(document).ready(function($){
	$(".menu-item").hover(
		function () {
			s = $(this).next().attr("src");
			s = s.replace(/\.gif/, "_over.gif");
			$(this).next().attr("src", s);
		},
		function () {
			s = $(this).next().attr("src");
			s = s.replace(/_over\.gif/, ".gif");
			$(this).next().attr("src", s);
		}									
	);
	
	$("a.button").hover(
		function () {
			s = $(this).prev().css("background-image");
			s = s.replace(/\.gif/, "_over.gif");
			$(this).prev().css("background-image", s);
		},
		function () {
			s = $(this).prev().css("background-image");
			s = s.replace(/_over\.gif/, ".gif");
			$(this).prev().css("background-image", s);
		}									
	);
			   
});



// form validation below
function test_email(addr) {
	valid = /^[.\w-]+@([\w-]+\.)+[a-zA-Z]{2,6}$/;
	return valid.test(addr);
}

function check_form() {
	f = document.forms[0].elements;
	if ( f["first_name"].value.length < 1 || f["last_name"].value.length < 1 ||  !test_email(f["email"].value) || f["phone"].value.length < 1 || f["city"].value.length < 1	|| f["state"].value.length < 1	|| f["country"].value.length < 1) {
		alert("Please complete all required fields and provide a valid email address to continue.");
		return false;
	} else {
		return true;
	}
}




