$(document).ready(function(){

	var fname = $('#firstname');
	var lname = $("#lastname");
	var email = $("#email");
	var phone = $("#phone");
	var msg = $("#message");
	
	fname.focusin(function (){ if($(this).val() == 'First Name...') $(this).val(''); });
	fname.focusout(function (){ if($(this).val() == '') $(this).val('First Name...'); });
	
	lname.focusin(function (){ if($(this).val() == 'Last Name...') $(this).val(''); });
	lname.focusout(function (){ if($(this).val() == '') $(this).val('Last Name...'); });
	
	email.focusin(function (){ if($(this).val() == 'Email Address...') $(this).val(''); });
	email.focusout(function (){ if($(this).val() == '') $(this).val('Email Address...'); });
	
	phone.focusin(function (){  if($(this).val() == 'Phone Number...') $(this).val(''); });
	phone.focusout(function (){ if($(this).val() == '') $(this).val('Phone Number...'); });
	
	msg.focusin(function (){  if($(this).val() == 'Your Message...') $(this).val(''); });
	msg.focusout(function (){ if($(this).val() == '') $(this).val('Your Message...'); });

	$('#contact-form').submit(function() {
	
		if(fname.val() == '' || fname.val() == 'First Name...') {
			alert('Please enter a firstname!');
			return false;
		}
		
		if(lname.val() == '' || lname.val() == 'Last Name...') {
			alert('Please enter a lastname!');
			return false;
		}
		
		if(email.val() == '' || email.val() == 'Email Address...') {
			alert('Please enter an email!');
			return false;
		}
		
		if(msg.val() == '' || msg.val() == 'Your Message...') {
			alert('Please enter a message!');
			return false;
		}
		
		return true;
	});
	
	$('#register-form').submit(function() {
	
		if(fname.val() == '' || fname.val() == 'First Name...') {
			alert('Please enter a firstname!');
			return false;
		}
		
		if(lname.val() == '' || lname.val() == 'Last Name...') {
			alert('Please enter a lastname!');
			return false;
		}
		
		if(email.val() == '' || email.val() == 'Email Address...') {
			alert('Please enter an email!');
			return false;
		}
		
		if(msg.val() == '' || msg.val() == 'Your Message...') {
			alert('Please enter a message!');
			return false;
		}
		
		return true;
	});
	
});
