	//initiate validator on load 
	$(function() {
			var defaults = {
			recievedMsg : 'Thank you for your message, we will contact as you soon as possible.',
			notRecievedMsg : 'Sorry but your message could not be sent, try again later',
		};
		// validate contact form on keyup and submit
		$("#contactForm").validate({
			//set the rules for the fild names
			rules: {
				name: {
					required: true,
					minlength: 2
				},
				email: {
					required: true,
					email: true
				},
				comment: {
					required: true
				}
			},
			//set messages to appear inline
			messages: {
				name: "",
				email: "",
				comment: ""
			},
			submitHandler: function() {
				//trigger ajax to email me
				$('#contact-form').hide();
				$.get('http://www.harisvision.com/wp-content/themes/demis/mail.php', {name:$('#name').val(), email:$('#email').val(), comment:$('#comment').val()},
					function(data){
						if( data == 'success') {
							$('#callback').show().append(defaults.recievedMsg);
						} else {
							$('#callback').show().append(defaults.notRecievedMsg);
						}
					});						
				return false;	
			}
		});
		
});

	$(function() {
		var defa = {
			reMsg : 'Thank you for your message, we will contact as you soon as possible.',
			notMsg : 'Sorry but your message could not be sent, try again later',
		};
		// validate contact form on keyup and submit
		$("#contactMail").validate({
			//set the rules for the fild names
			rules: {
				name: {
					required: true,
					minlength: 2
				},
				email: {
					required: true,
					email: true
				},
				comment: {
					required: true
				}
			},
			//set messages to appear inline
			messages: {
				name: "",
				email: "",
				comment: ""
			},
			submitHandler: function() {
				//trigger ajax to email me
				$('#contactMail').hide();
				$.get('http://www.harisvision.com/wp-content/themes/demis/mails.php', {name:$('#name').val(), phone:$('#phone').val(), email:$('#email').val(), comment:$('#comment').val()},
					function(data){
						if( data == 'success') {
							$('#callbackmail').show().append(defa.reMsg);
						} else {
							$('#callbackmail').show().append(defa.notMsg);
						}
					});						
				return false;	
			}
		});
		
});
