// ---------------------------------------------------------
// jQuery
// ---------------------------------------------------------


<!-- //last class for footer menu// -->

jQuery(function ($) {
	$(document).ready(function(){
		$(".module-wrapper .one-third:last").addClass("last");	
	});
});


<!-- // Menu Opacity // --> 

jQuery(function ($) {
	$(document).ready(function () {

	    $("#access .menu-header li").hover(
	        function () {
	        	$('ul', this).slideDown(300);
	            $('ul', this).animate({ opacity: "show" }, "slow");
	        },
	        function () {
	            $('ul', this).animate({ opacity: "hide" }, "slow");        
	        }
	    );

	});
});	

function mailpage()
{
	mail_str = "mailto:?subject=Check out the " + document.title;
	mail_str += "&body=I thought you'd like to see " + document.title;
	mail_str += ". You can view it at, " + location.href;
	location.href = mail_str;
}



jQuery(function ($) {
$(document).ready(function() {
	$('form#contactForm').submit(function() {
		$('form#contactForm .error').remove();
		var hasError = false;
		$('.requiredField').each(function() {
			if(jQuery.trim($(this).val()) == '') {
				var labelText = $(this).prev('label').text();
				$(this).parent().append('<span class="error">You forgot to enter your '+labelText+'.</span>');
				hasError = true;
			} else if($(this).hasClass('email')) {
				var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
				if(!emailReg.test(jQuery.trim($(this).val()))) {
					var labelText = $(this).prev('label').text();
					$(this).parent().append('<span class="error">You entered an invalid '+labelText+'.</span>');
					hasError = true;
				}
			}
		});
		if(!hasError) {
			$('form#contactForm li.buttons button').fadeOut('normal', function() {
				$(this).parent().append('<img src="/wp-content/themes/Connection Point Coaching/images/loading.gif" alt="Loading&hellip;" height="31" width="31" />');
			});
			var formInput = $(this).serialize();
			$.post($(this).attr('action'),formInput, function(data){
				$('form#contactForm').slideUp("fast", function() {				   
					$(this).before('<p class="thanks"><strong>Thanks!</strong> Your email was successfully sent. I check my email all the time, so I should be in touch soon.</p>');
				});
			});
		}
		
		return false;
		
	});
});
});

