//var options = {
//	target: '#success',
//	beforeSubmit: submitcontactform,
//	success: showResponse
//};

//$("#contact").ajaxForm(options);

/*function submitcontactform(formData, jqForm, options){
	var queryString = $.param(formData); 
	alert('About to submit: \n\n' + queryString);
	return true;
}
function showResponse(responseText, statusText, xhr, $form){
	alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 
			        '\n\nThe output div should have already been updated with the responseText.');
}*/
$(document).ready(function(){
	var contact = {
		submitContactForm: function(){
		//alert($(this).serialize());
		var data = $("#contact").serialize();
		$.post("/contact",
			data,
			function(responseData){
			$("#contact").slideUp('slow').html('');
			//var responseArray = responseData.split('|');
			//var name = responseArray[0];
			//var email = responseArray[1];
			if(responseData == 'success'){
				$("#success").html('Thanks for contacting KellPro!<br>Your message has been successfully sent! We will try to respond as quickly as possible! Thank you!').fadeIn('slow');
			}
			else{
				$("#success").html('Something went wrong, please try again later!').fadeIn('fast');
			}
		});
		return false;
		}
	}
	$("#contactsubmit").live("click",contact.submitContactForm);
});

