function validation(form) {
      
      
if(form.first_name.value == '') {

alert('Please enter your first name');
form.first_name.focus();
return false;
}


if(form.last_name.value == '') {

alert('Please enter your last name');
form.last_name.focus();
return false;
}

if(form.email.value == '') {

alert('Please enter your email address');
form.email.focus();
return false;
}


if(form.company.value == '') {

alert('Please enter your company');
form.company.focus();
return false;
}

return true;
}


//function piValidate() {
//
//	$("#quote").validate({
//	   rules: {
//		 'first_name': "required",
//		 'email': {
//		   required: true,
//		   email: true
//		 },
//		 'phone': "required"
//	   },
//	   messages: {
//		 'first_name': "Please enter your name",
//		 'email': {
//		   required: "Please enter your e-mail",
//		   email: "Correct e-mail format is name@domain.com"
//		 },
//		 'phone': "Please enter your phone number"
//	   },
//	   errorClass: "pi-invalid",
//	   errorElement: "em",
//	   errorPlacement: function(error, element) {
//			
//			if (element.attr("name") == "first_name") {
//				error.insertBefore(("#first_name_error"));
//			}
//				
//			if (element.attr("name") == "email") {
//				error.insertBefore(("#email_error"));
//			}				
//			
//			if (element.attr("name") == "phone") {
//				error.insertBefore(("#phone_error"));
//			}
//		    
//	   },
//
//	   
//	});
//	
//	return $("#quote").valid();
//	
//}

	function validateGetQuote() {
		
		// Indicator for valid results
		var valid = true;
		
		if ( isEmpty("#c-name") ) {
			
			// Adds a message to the div element used for the name
			$("#first_name_error").html("Please enter your name");

			// Adds an error class to the label element
			$("#label_name").addClass("label-error");
			
			// Shows the div element
			$("#first_name_error").show();
			
			// Set the focuse to the input of the name
			$("#c-name").focus();
			
			// Sets the indicator for valid results
			valid = false;
			
		} else {
			$("#first_name_error").html("");
			$("#label_name").removeClass("label-error");
			$("#first_name_error").hide();
		}
		
		if ( isEmpty("#c-email") ) {
			
			$("#email_error").html("Please enter your e-mail");
			
			$("#label_email").addClass("label-error");
			$("#email_error").show();
			
			// Checks for other errors. If there are errors I have not to focuse an input.
			if (valid) {
				$("#c-email").focus();
			}
			valid = false;
			
		} else {
		
			if ( !validEmail( $("#c-email").val() ) ) {
				$("#email_error").html("Correct e-mail format is name@domain.com");
				
				$("#label_email").addClass("label-error");
				$("#email_error").show();
				
				// Checks for other errors. If there are errors I have not to focuse an input.
				if (valid) {
					$("#c-email").focus();
				}
				valid = false;
			} else {
				$("#email_error").html("");
				$("#label_email").removeClass("label-error");
				$("#email_error").hide();
			}
		}
		
		if ( isEmpty("#c-phone") ) {
			$("#phone_error").html("Please enter your phone number");
			
			$("#label_phone").addClass("label-error");
			$("#phone_error").show();
			
			// Checks for other errors. If there are errors I have not to focuse an input.
			if (valid) {
				$("#c-phone").focus();
			}
			valid = false;
		} else {
			$("#phone_error").html("");
			$("#label_phone").removeClass("label-error");
			$("#phone_error").hide();
		}
		
		return valid;
	}
	
	function isEmpty( id ) {
		
		var value = $(id).val();
		if ( !value ) {
			return true;
		}
		return false;
	}
	
	function validEmail( email ) {
		
		var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(email)) {
			return false
		}
		
		return true;
	}

	/**
	 * Validate the form which in the most pages on the bottom
	 */
	function validateContactUs() {
		
		// Indicator for valid results
		var valid = true;
		
		if ( isEmpty("#f-name") ) {
			
			// Adds a message to the div element used for the name
			$("#f_first_name_error").html("Please enter your name");

			// Adds an error class to the label element
			$("#f_label_name").addClass("label-error");
			
			// Shows the div element
			$("#f_first_name_error").show();
			
			// Set the focuse to the input of the name
			$("#f-name").focus();

			// change name title to red
			$("#nametitle").css("color","#ff0000");
			
			// Sets the indicator for valid results
			valid = false;
			
		} else {
			$("#f_first_name_error").html("");
			$("#f_label_name").removeClass("label-error");
			$("#f_first_name_error").hide();
$("#nametitle").css("color","#000");
		}
		
		if ( isEmpty("#f-email") ) {
			
			$("#f_email_error").html("Please enter your e-mail");
			
			$("#f_label_email").addClass("label-error");
			$("#f_email_error").show();
			
			// change email title to red
			$("span#emailtitle").css("color","#ff0000");

			// Checks for other errors. If there are errors I have not to focuse an input.
			if (valid) {
				$("#f-email").focus();
			}
			valid = false;
			
		} else {
		
			if ( !validEmail( $("#f-email").val() ) ) {
				$("#f_email_error").html("Correct e-mail format is name@domain.com");
				
				$("#f_label_email").addClass("label-error");
				$("#f_email_error").show();
				
				// Checks for other errors. If there are errors I have not to focuse an input.
				if (valid) {
					$("#f-email").focus();
				}
				valid = false;
			} else {
				$("#f_email_error").html("");
				$("#f_label_email").removeClass("label-error");
				$("#f_email_error").hide();
$("#emailtitle").css("color","#000");
			}
		}
		
		if ( isEmpty("#f-phone") ) {
			$("#f_phone_error").html("Please enter your phone number");
			
			$("#f_label_phone").addClass("label-error");
			$("#f_phone_error").show();
			
			// change phone title to red
			$("span#phonetitle").css("color","#ff0000");

			// Checks for other errors. If there are errors I have not to focuse an input.
			if (valid) {
				$("#f-phone").focus();
			}
			valid = false;
		} else {
			$("#f_phone_error").html("");
			$("#f_label_phone").removeClass("label-error");
			$("#f_phone_error").hide();
$("#phonetitle").css("color","#000");
		}
		
		return valid;
	}
