(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(H){H.preventDefault();var I=A(this).closest(".contactusFields"),D=A('[name="name"]',I).val(),C=A('[name="email"]',I).val(),F=A('[name="subject"]',I).val(),B=A('[name="other_subject"]',I).val(),G=A('[name="message"]',I).val(),E={};if(A.trim(D).length==0||A.trim(C).length==0||A.trim(F).length==0||A.trim(G).length==0){openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get("please_complete_required_fields"),iconType:"warning"});return false}if(A("#recaptcha_challenge_field").length>0){E.recaptcha_challenge_field=A("#recaptcha_challenge_field").val();E.recaptcha_response_field=A("#recaptcha_response_field").val()}else{E.input=A('[name="humanverify[input]"]').val();E.hash=A('[name="humanverify[hash]"]').val()}A.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/contactus/sendMail",data:({maildata:{name:D,email:C,subject:F,other_subject:B,message:G},hvinput:E}),type:"POST",dataType:"json",success:function(J){if(J.errors){if(J.errors[0]=="humanverify_image_wronganswer"){A(".refresh_imagereg a",I).click()}openAlertDialog({title:vBulletin.phrase.get("contact_us"),message:vBulletin.phrase.get(J.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);