$().ready(function() {
	var options = {
		target:        "#result",
		beforeSubmit:  beforeSubmitForm,
		success:       afterSubmitForm
	};

	$.metadata.setType("attr", "validate");
	jQuery("#LoadingcontactForm").hide();

	jQuery("#contactForm").validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit(options);
		}
	});

	function beforeSubmitForm() {
		jQuery('#submitcontactForm').hide();
		jQuery('#LoadingcontactForm').show();
		return true;
	}

	function afterSubmitForm() {
		jQuery('#submitcontactForm').show();
		jQuery('#LoadingcontactForm').hide();
	}

});
