$(document).ready(function(){

	$(':input.submitMessage').click(function(){
		var n = $.trim( $(':input[name=name]').val() );
		var e = $.trim( $(':input[name=email]').val() );
		var c = $(':input[name=contact]').attr( '_' + $(':input[name=contact]').val() );
		var m = $.trim( $(':input[name=comments]').val() );
		if( n == '' ) alert('Please enter your name so we can contact you.');
		else if( e == '' || e.indexOf('@') == -1 || e.indexOf('.') == -1 ) alert('Please enter your valid email address to reply to your comments.');
		else if( m == '' ) alert('Your message is blank. Please enter the message you would like to send us.');
		else $.post( '/library/core.cfc?method=mail', { from : e, email : e, to : c, message : m, subject : 'Contact Us (new message from ' + n + ')' }, function(){
			$('div.contactForm').fadeOut('slow', function(){
				alert('Your message has been sent');
			});
		});
	
	});

});