// JavaScript Document For Contact Us Form
	$(function(){
		// validate form
		$("form").submit(function(){
			var errors = '';
			if ( $("#name").val() == '' || $("#name").val() == $("#name").attr('title') ) {
				errors += 'Enter your name.\n';
			}
			if ( !$("#email").val().match(/^.+@.+/) || $("#email").val() == $("#email").attr('title') ) {
				errors += 'Enter your email address.\n';
			}
			if ( $("#phone").val() == '' || $("#phone").val() == $("#phone").attr('title') ) {
				errors += 'Enter your phone number.\n';
			}
			if ( errors == '' ) return true;
			else {
				alert(errors);
				return false;
			}
		});
		// input pre-population
		$("form input, form textarea").each(function(){
			if ( $(this).val() == '' ) {
				$(this).val( $(this).attr("title") );
			}
			$(this).focus(function(){
				if ( $(this).val() == $(this).attr("title") ) {
					$(this).val('');
				}
			}).blur(function(){
				if ( $(this).val() == '' ) {
					$(this).val($(this).attr("title") );
				}
			});
		});
	});// JavaScript Document
