(function($){$(document).ready(function(){if(window.jBox){new jBox('Modal',{attach:'.vdz_cb_btn, .vdz_cb_widget_btn',content:$('#vdz_cb'),});} var $vdz_cb_phone=$("#vdz_cb_phone");var vdz_cb_phone_mask=$vdz_cb_phone.data('mask')||"(999) 999-99-99";if(($vdz_cb_phone.data('mask_off')==undefined)||($vdz_cb_phone.data('mask_off')=='on')){$("#vdz_cb_phone").mask(vdz_cb_phone_mask);} $('#vdz_cb_form').on('submit',function(e){e.preventDefault();$('#vdz_cb_unsver div').hide();$.ajax({type:'POST',url:window.vdz_cb.ajax_url,data:$(this).serialize(),success:function(response){var content=$.parseJSON(response);if(content.status=='success') {$("#vdz_cb_form").trigger('reset').slideUp();$('#vdz_cb_unsver .success').show();var obj_form={hitType:'event',eventCategory:'VDZ_Callback',eventAction:'Send',eventLabel:'Send_VDZ_Callback',};var send=false;if(window.gtag){gtag('event',obj_form.eventAction,{'event_category':obj_form.eventCategory,'event_action':obj_form.eventAction,'event_label':obj_form.eventLabel});send=true;} if(!send){if(window.ga){ga('send',obj_form);send=true;}}}else{$('#vdz_cb_unsver .warning').show();}},error:function(data,textStatus,jqXHR){$('#vdz_cb_unsver .warning').show();}})});});})(jQuery);