(function(A){window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=A.merge(window.vBulletin.phrase.precache,["please_complete_required_fields","nosubject","bademail","contact_us","sentfeedback"]);A(document).ready(function(){A("form.contactusForm").submit(function(E){E.preventDefault();var I=A(this).closest(".contactusFields"),C=A('[name="name"]',I).val(),F=A('[name="email"]',I).val(),G=A('[name="subject"]',I).val(),H=A('[name="other_subject"]',I).val(),J=A('[name="message"]',I).val(),D=A('[name="humanverify[input]"]').val(),B=A('[name="humanverify[hash]"]').val();if(A.trim(C).length==0||A.trim(F).length==0||A.trim(G).length==0||A.trim(J).length==0){openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get("please_complete_required_fields"),iconType:"warning"});return false}A.ajax({url:pageData.baseurl+"/index.php/ajax/api/contactus/sendMail",data:({maildata:{name:C,email:F,subject:G,other_subject:H,message:J},hvinput:{input:D,hash:B}}),type:"POST",dataType:"json",success:function(K){if(K.errors){if(K.errors[0]=="humanverify_image_wronganswer"){A(".refresh_imagereg a",I).click()}openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get(K.errors[0]),iconType:"error"})}else{openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get("sentfeedback"),onAfterClose:function(){window.location.href=pageData.baseurl}})}},error:function(){openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}});return false})})})(jQuery);