function bindContact() {
	jQuery("#contactform").submit(function() {
		submitForm()
		return false;
	});
	//capture the return key
	jQuery(".contactform").bind("keydown", function(e) {
		if (e.keyCode == 13) {
			submitForm();
			return false; //prevent default behaviour
		}
	});
	jQuery("#contactsub").click(function() {
		submitForm();
		return false; //prevent default behaviour
	});
	
	jQuery(".button").hover(function () {
			jQuery(this).toggleClass("hover");
		});
}
	
	
function submitForm()
{
		jQuery(".slideUp").slideUp(500);
		jQuery(".slideDown").slideDown(500,function(){
			
			jQuery(".good, .bad").remove();
		
			jQuery.post("contact.php", 
				"ajaxcontactform=yes&ajax=yes&" + jQuery("#contactform").serialize(),
				function(data) {
					

					
					if(data.search("message good") != -1)
					{
						jQuery("#contactform").before(data);
						jQuery("#contactform").remove();
						
						jQuery(".slideDown").slideUp(500, function() {
							
							jQuery(".slideUp").slideDown();
						
						});
					}
					else
					{
						jQuery(".slideDown").slideUp()
						jQuery("#contactform").before(data);
						jQuery(".slideUp").slideDown(500);
					}
		
				});
			
		});
			
		return false;
}
