jQuery(document).ready(function($){var shake="No";$('#message').hide();$('#contact input[type=text], #contact input[type=email], #contact select, #contact textarea').each(function(){$(this).after('<mark class="validate"></mark>');});$('#comments, #name, #subject').focusout(function(){if(!$(this).val())
$(this).addClass('error').parent().find('mark').removeClass('valid').addClass('error');else
$(this).removeClass('error').parent().find('mark').removeClass('error').addClass('valid');});$('#email').focusout(function(){if(!$(this).val()||!isEmail($(this).val()))
$(this).addClass('error').parent().find('mark').removeClass('valid').addClass('error');else
$(this).removeClass('error').parent().find('mark').removeClass('error').addClass('valid');});$('#submit').click(function(){$("#message").slideUp(200,function(){$('#message').hide();$('#email').triggerHandler("focusout");$('#comments').triggerHandler("focusout");$('#name').triggerHandler("focusout");$('#subject').triggerHandler("focusout");});});$('#contactform').submit(function(){if($('#contact mark.error').size()>0){if(shake=="Yes"){$('#contact').effect('shake',{times:2},75);}
return false;}
var action=$(this).attr('action');$('#submit').after('<span class="black"><i class="fa-li fa fa-spinner fa-spin"></i></span>').attr('disabled','disabled');$.post(action,$('#contactform').serialize(),function(data){$('#message').html(data);$('#message').slideDown();$('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});$('#contactform #submit').removeAttr('disabled');if(data.match('success')!=null)$('#contactform #submit').attr("disabled",true);});return false;});function isEmail(emailAddress){var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return pattern.test(emailAddress);}
function isNumeric(input){return(input- 0)==input&&input.length>0;}});