$(function(){
    $('input').hints();


});

$.fn.hints = function(){
    return this.each(function(){
	var value = $(this).val();
	$(this).blur(function(){
		    if($(this).val() == ''){
		    $(this).val(value);
		    }
	});
	$(this).focus(function(){$(this).val(''); });
	
    });
};

function validateForm(stateVal) {
    
	if(stateVal == 0){ alert('A STATE must be selected'); return false;}
	
	var oFrm = document.getElementById('frmContact');

	var fName = $('#FirstName').val().toLowerCase();
	var lName = $('#LastName').val().toLowerCase();
	var address= $('#Address').val().toLowerCase();
	var city = $('#City').val().toLowerCase();
	var agree = $('#agree:checked').length;

	var oFld, txt;
	
	oFld = oFrm.Email;
	txt = "Email Address";
	if (!strCheck(oFld, txt)) return false;
	if (!emailCheck(oFld, txt)) return false;
	
	oFld = oFrm.Phone;
	txt = "Phone Number";
	if (!strCheck(oFld, txt)) return false;
	if (!phoneCheckFull(oFld, txt)) return false;
	
	oFld = oFrm.ZipCode;
	txt = "Zip Code";
	if (!checkZIPCode(oFld)) return false;
    
	if(fName == '' || fName == 'first name'){ alert('A First Name must be entered'); return false;}
	if(lName == '' || lName == 'last name'){ alert('A Last Name must be entered'); return false;}
	if(address == '' || address == 'address'){ alert('An Address must be entered'); return false;}
	if(city == '' || city == 'city'){ alert('A City must be entered'); return false;}
	if(agree == null || agree == 0){ alert('You must agree to the Terms and Conditions below.'); return false;}
};