jQuery(document).ready( function($) {

	var _cForm = $('#contact_form');
	
	_cForm.validate({
		rules: {
			"contact[name]": {
				required: true,
				maxlength: 100
			},
			"contact[surname]": {
				required: true,
				maxlength: 100
			},
			"contact[email]": {
				required: true,
				email: true,
				maxlength: 255
			},
			"contact[object]": {
				required: true,
				maxlength: 255
			},
			"contact[message]": {
				required: true
			}
		},
		messages: {
			"contact[name]": {
				required: "Please enter your name",
				maxlength: "Your name cannot exceed 100 characters"
			},
			"contact[surname]": {
				required: "Please enter your surname",
				maxlength: "Your surname cannot exceed 100 characters"
			},
			"contact[email]": {
				required: "Please enter a valid email",
				maxlength: "Email field cannot exceed 255 characters"
			},
			"contact[object]": {
				required: "Please enter email object",
				maxlength: "Object field cannot exceed 255 characters"
			},
			"contact[message]": {
				required: "Please enter a text message",
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo( element.parents("div.row") );
		}
		/*,
		submitHandler: function(form) {			
			$(form).ajaxSubmit({
				dataType:  'json',
				target: "#result",
				success:   function(data)
				{
					var $_resDiv = $('#result');
					$_resDiv.empty();
					if (data.status) 
					{
						$_resDiv.html('<img src="public/images/logolorenz.jpg" width="208" hight="86" alt="logo Lorenz" /><br /><p class="confirm">'+data.message+'</p><br /><br />');
						_cForm.clearForm();
						$('#cb_appointment').attr('checked', true);
						$('#cb_agree').attr('checked', true);
					}
					else
						$_resDiv.html('<img src="public/images/logolorenz.jpg" width="208" hight="86" alt="logo Lorenz" /><br /><p class="error">'+data.message+'</p><br /><br />');
				}
			});
		}    */

	});		

})

