function contactFormResponse(data) { 
    // 'data' is the json object returned from the server 
	
	if (data.success) {
		jAlert(data.msg,data.title);
	}
	else {
		jAlert(data.msg,data.title);
	} 
}


$(document).ready(function() {
	var contact_form = $("#contact_form").validate({
		errorPlacement: function(error, element) {
			error.attr("title",error.html());
			error.html("");
			error.insertAfter(element);
			$(error).tooltip();
		},	
		submitHandler: function(form) {
			$(form).ajaxSubmit({
				  dataType:  'json', 
			      success:   contactFormResponse
			});
		}
	});
});