/**
 * @author craigkaminsky
 */
$(document).ready(
	function(){
		// setup event admin contact form
		$( '#adminContact' ).ajaxForm(
			{
				url : '/pages/send_message/send_message.json',
				type : 'post',
				dataType : 'json',
				clearForm : true,
				resetForm : true,
				success: function( response, status_text ){
					msg = '<p>There was a problem sending your email. Please try again. Make sure you answered the math equation correctly!</p>';
					if (response.sent) {
						$('#adminContact').hide('slow');
						msg = 'Your email was sent. We typically respond in one to two business days.</p>';
					}
					
					$('#formResults').html( msg );
					$('#formResults').show('slow');
				}
			}
		);
	}
);
