/home/arranoyd/mice/wp-content/plugins/contact-form-maker/js/submission-scripts.min.js
function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var i=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+i).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("<div>").addClass("tooltip-arrow").addClass(t.vertical).addClass(t.horizontal).appendTo(this)}}})}function wd_insert_placeholder(e,t){var i=document.getElementById(e);if(tinyMCE.get(e)&&tinyMCE.get(e).focus(),"none"!=i.style.display)if(i.focus(),document.selection)sel=document.selection.createRange(),sel.text=t;else if(i.selectionStart||"0"==i.selectionStart){var n=i.selectionStart,a=i.selectionEnd;i.value=i.value.substring(0,n)+"{"+t+"}"+i.value.substring(a,i.value.length)}else i.value+="{"+t+"}";else tinyMCE.execCommand("mceInsertContent",!1,"{"+t+"}")}function fm_toggle_postbox(e){jQuery(e).parent(".postbox").toggleClass("closed")}function fm_option_tabs_mail_validation(){return!0}function fm_clear_input_value(e){jQuery("#"+e).val("")}function set_no_items(){jQuery(".colspanchange").attr("colspan",jQuery(".wd-form table.adminlist>thead>tr>th:visible").length+jQuery(".wd-form table.adminlist>thead>tr>td:visible").length)}function search(e){var t=jQuery(e).parents("form");t.attr("action",window.location+"&paged=1&s="+jQuery("input[name='s']").val()),t.submit()}function input_search(e,t){return 13==(e.keyCode?e.keyCode:e.which)&&search(t),!0}function input_pagination(e,t){if(13==(e.keyCode?e.keyCode:e.which)){var i=jQuery(t).parents("form"),n=jQuery(t).val();if(n<=jQuery(t).parents(".pagination-links").data("pages-count")&&0<n){var a=new RegExp("&nonce_fm="+nonce_fm,"g"),r=i.attr("action").replace(a,"").replace(/&paged=(\d+)/,"")+"&paged="+n;i.attr("action",r),location.href=r}}return!0}function fm_select_value(e){e.focus(),e.select()}function fm_doNothing(e){13==(e.keyCode?e.keyCode:e.which?e.which:e.charCode)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}function wd_bulk_action(e){var t=jQuery("select[name='bulk_action']").val();if(-1!=t){if(!jQuery("input[name^='check']").is(":checked"))return void alert(form_maker.select_at_least_one_item);if("delete"==t&&!confirm(form_maker.delete_confirmation))return!1;jQuery("input[name='task']").val(t),jQuery(e).parents("form").submit()}}function fm_ajax_save(e){var t=jQuery("#"+e).action,i=jQuery("#search_value").val(),n=jQuery("#current_id").val(),a=jQuery("#page_number").val(),r=(jQuery("#search_or_not").val(),jQuery("#ids_string").val()),o=jQuery("#image_order_by").val(),l=jQuery("#asc_or_desc").val(),s=jQuery("#ajax_task").val(),d=jQuery("#image_current_id").val();return ids_array=r.split(","),jQuery.ajax({type:"POST",url:t,data:{search_value:i,current_id:n,page_number:a,image_order_by:o,asc_or_desc:l,ids_string:r,task:"ajax_search",ajax_task:s,image_current_id:d,nonce:fm_ajax.ajaxnonce},success:function(e){var t=jQuery(e).find("#images_table").html();jQuery("#images_table").html(t);t=jQuery(e).find("#tablenav-pages").html();jQuery("#tablenav-pages").html(t),jQuery("#show_hide_weights").val("Hide order column"),fm_show_hide_weights(),fm_run_checkbox()}}),!1}function fm_run_checkbox(){jQuery("tbody").children().children(".check-column").find(":checkbox").click(function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!i)return!0;d=jQuery(i).closest("form").find(":checkbox"),f=d.index(i),j=d.index(this),h=jQuery(this).prop("checked"),0<f&&0<j&&f!=j&&d.slice(f,j).prop("checked",function(){return!!jQuery(this).closest("tr").is(":visible")&&h})}i=this;var t=jQuery(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return jQuery(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0==t.length}),!0}),jQuery("thead, tfoot").find(".check-column :checkbox").click(function(e){var t=jQuery(this).prop("checked"),i="undefined"!=typeof toggleWithKeyboard&&toggleWithKeyboard,n=e.shiftKey||i;jQuery(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!jQuery(this).is(":hidden")&&(n?jQuery(this).prop("checked"):!!t)}),jQuery(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!n&&!!t})})}function fm_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function fm_form_submit(e,t,i,n){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function fm_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" field is required."),jQuery("#"+e).attr("style","border-color: #FF0000; border-style: solid; border-width: 1px;"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0)}function fm_show_hide_weights(){var n;"Show order column"==jQuery("#show_hide_weights").val()?(jQuery(".connectedSortable").css("cursor","default"),jQuery("#tbody_arr").find(".handle").hide(0),jQuery("#th_order").show(0),jQuery("#tbody_arr").find(".fm_order").show(0),jQuery("#show_hide_weights").val("Hide order column"),jQuery("#tbody_arr").sortable()&&jQuery("#tbody_arr").sortable("disable")):(jQuery(".connectedSortable").css("cursor","move"),n=jQuery("#page_number")&&""!=jQuery("#page_number").val()&&1!=jQuery("#page_number").val()?20*(jQuery("#page_number").val()-1)+1:1,jQuery("#tbody_arr").sortable({handle:".connectedSortable",connectWith:".connectedSortable",update:function(e,t){jQuery("#draganddrop").attr("style",""),jQuery("#draganddrop").html("<strong><p>Changes made in this table should be saved.</p></strong>");var i=n;jQuery(".fm_order").each(function(e){jQuery(this).find("input").val()&&jQuery(this).find("input").val(i++)})}}),jQuery("#tbody_arr").sortable("enable"),jQuery("#tbody_arr").find(".handle").show(0),jQuery("#tbody_arr").find(".handle").attr("class","handle connectedSortable"),jQuery("#th_order").hide(0),jQuery("#tbody_arr").find(".fm_order").hide(0),jQuery("#show_hide_weights").val("Show order column"))}function fm_popup(e){if(void 0===e)e="";var n,r,o;(n=function(){var e,t,i=jQuery("#TB_window"),n=jQuery(window).height(),a=jQuery(window).width();e=r&&r<a-90?r:a-40,t=o&&o<n-60?o:n-40,i.size()&&(i.width(e).height(t),jQuery("#TB_iframeContent").width(e).height(t-27),i.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),void 0!==document.body.style.maxWidth&&i.css({top:(n-t)/2,"margin-top":"0"}))})(),jQuery(window).resize(function(){n()}),jQuery("a.thickbox-preview"+e).click(function(){tb_click.call(this);var e=jQuery(this).parents(".available-theme").find(".activatelink"),t="",i=jQuery(this).attr("href");return r=(r=i.match(/&width=[0-9]+/))?parseInt(r[0].replace(/[^0-9]+/g,""),10):jQuery(window).width()-120,o=(o=i.match(/&height=[0-9]+/))?parseInt(o[0].replace(/[^0-9]+/g,""),10):jQuery(window).height()-120,t=e.length?' <a href="'+(e.attr("href")||"")+'" target="_top" class="tb-theme-preview-link">'+(e.attr("title")||"")+"</a>":' <span class="tb-theme-preview-link">'+(jQuery(this).attr("title")||"")+"</span>",jQuery("#TB_title").css({"background-color":"#222",color:"#dfdfdf"}),jQuery("#TB_closeAjaxWindow").css({float:"right"}),jQuery("#TB_ajaxWindowTitle").css({float:"left"}).html(t),jQuery("#TB_iframeContent").width("100%"),n(),!1}),jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1})}function bwg_inputs(){jQuery(".fm_int_input").keypress(function(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t)})}function fm_check_isnum(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||58<t)&&46!=t&&45!=t&&(t<65||70<t)&&(t<97||102<t))}function fm_change_payment_method(e){switch(e){case"paypal":jQuery(".fm_payment_option").show(),jQuery(".fm_paypal_option").show(),jQuery(".fm_payment_option_stripe").hide();break;case"stripe":jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").show();break;default:jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").hide()}}function stopRKey(e){var t=(e=e||(event||null)).target?e.target:e.srcElement?e.srcElement:null;if(13==e.keyCode&&("text"==t.type||"search"==t.type))return!1}function fmRemoveHeaderImage(e,t){jQuery("#header_image_url").val(""),jQuery("#header_image").css("background-image",""),jQuery("#header_image").addClass("fm-hide")}function fmOpenMediaUploader(e,t){void 0===t&&(t=!1),e.preventDefault();var i=wp.media({title:"Upload",button:{text:"Add Image"},multiple:!1}).on("select",function(){var e=i.state().get("selection").first().toJSON();jQuery("#header_image_url").val(e.url),jQuery("#header_image").css("background-image",'url("'+e.url+'")'),jQuery("#header_image").css("background-position","center"),jQuery("#header_image").removeClass("fm-hide")}).open();return!1}function fm_toggle_posts(e){jQuery(e).prop("checked")?jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}function fm_toggle_pages(e){jQuery(e).prop("checked")?jQuery(".fm-pages-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-pages-show").removeClass("fm-show").addClass("fm-hide")}function fm_apply_options(e){fm_set_input_value("task",e),document.getElementById("manage_form").submit()}function pp_live_search(e,t,i){var n=e,a=n.val(),r=n.data("post_type");setTimeout(function(){a===n.val()&&jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"manage_fmc",task:"fm_live_search",nonce:fm_ajax.ajaxnonce,pp_live_search:a,pp_post_type:r,pp_full_content:i},beforeSend:function(e){n.css("width","95%"),n.parent().find(".fm-loading").css("display","inline-block")},success:function(e){n.css("width","100%"),n.parent().find(".fm-loading").css("display","none"),n.closest(".fm-pp").find(".pp_search_results").replaceWith(e)},error:function(e){console.log(e)}})},t)}function fm_toggle(e){jQuery(e).parent().next().toggleClass("hide")}function change_tab(e){jQuery(".fm-subscriber-header .fm-button").removeClass("active-button"),jQuery(".fm-subscriber-header ."+e).addClass("active-button"),jQuery(".fm-subscriber-content").hide(),jQuery("."+e+"-tab").show()}function change_form_type(e){jQuery("#fieldset_id").val(e),jQuery(".fm-form-types span").removeClass("active"),jQuery(".fm-form-types").find(".fm-"+e).addClass("active"),jQuery("#type_settings_fieldset .wd-group").removeClass("fm-show").addClass("fm-hide")}function change_hide_show(e){jQuery("."+e+".fm-hide").removeClass("fm-hide").addClass("fm-temporary"),jQuery("."+e+".fm-show").removeClass("fm-show").addClass("fm-hide"),jQuery("."+e+".fm-show-table").removeClass("fm-show-table").addClass("fm-hide"),jQuery("."+e+".fm-temporary").removeClass("fm-temporary").addClass("fm-show"),"fm-embedded"!=e&&(fm_toggle_posts(jQuery(".pp_display_on #pt3")),fm_toggle_pages(jQuery(".pp_display_on #pt4")))}function fm_change_radio_checkbox_text(e){var t=[];t.stripemode=["Test","Live"],t.checkout_mode=["Testmode","Production"],t.mail_mode=["Text","HTML"],t.mail_mode_user=["Text","HTML"],t.value=["1","0"],t.popover_show_on=["Page Exit","Page Load"],t.topbar_position=["Bottom","Top"],t.scrollbox_position=["Left","Right"],jQuery(e).val(t.value[jQuery(e).val()]),jQuery(e).next().val(jQuery(e).val());var i=t[jQuery(e).attr("name")];jQuery(e).find("label").html(i[jQuery(e).val()]),jQuery(e).hasClass("fm-text-yes")?(jQuery(e).removeClass("fm-text-yes").addClass("fm-text-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).removeClass("fm-text-no").addClass("fm-text-yes"),jQuery(e).find("span").animate({right:0},400,function(){}))}function fm_show_hide(e){jQuery("."+e).hasClass("fm-hide")?jQuery("."+e).removeClass("fm-hide").addClass("fm-show"):jQuery("."+e).removeClass("fm-show").addClass("fm-hide")}function fm_delete_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var i=jQuery("#blocked_ips").attr("action");jQuery.ajax({type:"POST",url:i,data:{current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"delete_blocked_ip"},success:function(e){var t=parseInt(jQuery(e).find("#total_for_paging").html());isNaN(t)||(i=i.replace(/(paged=)[^\&]+/,"$1"+t)),jQuery("#blocked_ips").parent(".wrap").load(i+" #blocked_ips",function(){window.history.pushState(null,null,i),0!=jQuery(".updated").length?jQuery(" .updated p strong").html("Items Successfully Deleted"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Deleted.</strong></p></div>").insertBefore("#blocked_ips"),set_no_items()})}})}function fm_save_ip(t){var i=jQuery("#ip"+t).val();url=jQuery("#blocked_ips").attr("action"),jQuery.ajax({type:"POST",url:url,data:{ip:i,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip"},success:function(e){jQuery("#td_ip_"+t).html('<a id="ip'+t+'" class="pointer" title="Edit" onclick="fm_edit_ip('+t+')">'+i+"</a>"),jQuery(".insert, .error").hide(),jQuery("#fm_blocked_ips_message").html("<div class='updated'><strong><p>Items Successfully Inserted.</p></strong></div>"),jQuery("#fm_blocked_ips_message").show()}})}function fm_insert_blocked_ip(){jQuery("#tr .loading").css("display","initial");var e=jQuery("#fm_ip").val(),t=window.location.href;jQuery.ajax({type:"POST",url:t,data:{ip:e,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip",last_id:1},success:function(e){jQuery("#blocked_ips").parent(".wrap").load(t+" #blocked_ips",function(){window.history.pushState(null,null,t),0!=jQuery(".updated").length?jQuery(".updated p strong").html("Items Successfully Saved"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Saved.</strong></p></div>").insertBefore("#blocked_ips")})}})}function fm_edit_ip(e){var t='<input id="ip'+e+'" class="input_th'+e+' ip_input" type="text" onkeypress="if(event.keyCode == 13){ if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); } return fm_check_isnum(event); " value="'+jQuery("#ip"+e).html()+'" name="ip'+e+'"/>';t+='<input type="button" class="button ip_save" style="margin-left: 5px" onclick="if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); return false;" value="Save"><div class="loading">',t+="<img src="+plugin_url+"/images/loading.gif></div>",jQuery("#td_ip_"+e).html(t)}function fm_enter_ip(e){if(13==e.which){if(fm_check_required("fm_ip","IP"))return!1;e.preventDefault(),fm_insert_blocked_ip()}}function fm_update_blocked_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var t=jQuery("#ip"+e).val(),i=window.location.href;jQuery.ajax({type:"POST",url:i,data:{ip:t,current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"update_blocked_ip"},success:function(e){jQuery("#fm-form-admin").load(i+" #blocked_ips",function(){0!=jQuery(".updated").length?(window.history.pushState(null,null,i),jQuery(".updated p strong").html("Items Successfully Updated")):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Updated.</strong></p></div>").insertBefore("#blocked_ips")})}})}function onEnableChange(e,t,i){var n=jQuery("#"+e+" #"+t);"1"==i?n.removeClass("hidden"):n.addClass("hidden")}function show_stats(){var e=jQuery(".fm-statistics .fm_error_sorted_label_key");""!=jQuery("#sorted_label_key").val()?(e.hide(),jQuery(".fm-div_stats-loading").addClass("is-active"),jQuery.ajax({dataType:"json",type:"POST",url:show_stats_url,data:{sorted_label_key:jQuery("#sorted_label_key").val(),startdate:jQuery("#startstats").val(),enddate:jQuery("#endstats").val(),nonce:fm_ajax.ajaxnonce},beforeSend:function(e){},error:function(e){},success:function(e){jQuery(".fm-div_stats-loading").removeClass("is-active"),e.html&&jQuery("#div_stats").html(e.html)}})):e.show()}function fm_loading_show(){jQuery("#fm_loading").show()}function fm_loading_hide(){jQuery("#fm_loading").hide(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items()}function getFormLocalStorage(){var e={};formId=getAllUrlParams().current_id;var t=localStorage.getItem("fm_form"+formId);return null!=t&&(e=jQuery.parseJSON(t)),e}function getAllUrlParams(e){var t=e?e.split("?")[1]:window.location.search.slice(1),i={};if(t)for(var n=(t=t.split("#")[0]).split("&"),a=0;a<n.length;a++){var r=n[a].split("="),o=void 0,l=r[0].replace(/\[\d*\]/,function(e){return o=e.slice(1,-1),""}),s=void 0===r[1]||r[1];l=l.toLowerCase(),s=s.toLowerCase(),i[l]?("string"==typeof i[l]&&(i[l]=[i[l]]),void 0===o?i[l].push(s):i[l][o]=s):i[l]=s}return i}function fm_disabled_uninstall_btn(){jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!0),jQuery(".fm-uninstall-form #check_yes").is(":checked")&&jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!1)}function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function fm_row_handle(e){var t=jQuery(e);t.find(".wdform_row_handle").remove();var i=jQuery('<div class="wdform_row_handle"><span class="fm-ico-draggable"></span><span title="Remove the column" class="page_toolbar fm-ico-delete" onclick="fm_remove_row_popup(this);"></span>'+"<span class=\"add-new-field\" onclick=\"jQuery('#cur_column').removeAttr('id');jQuery(this).parent().parent().attr('id', 'cur_column').val(1);popup_ready(); Enable(); return false;\">"+form_maker_manage.add_new_field+'</span><div class="fm-divider"></div></div>');t.prepend(i),i.after('<div class="fm-section-overlay"></div>')}function sortable_columns(){jQuery("#take").sortable({cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".form_id_tempform_view_img .fm-ico-draggable",items:"> .wdform-page-and-images",axis:"y",update:function(e,t){refresh_page_numbers()}}),jQuery(".wdform_page").sortable({connectWith:".wdform_page",cursor:"move",placeholder:"highlight",tolerance:"pointer",handle:".wdform_row_handle",cancel:".add-new-field, .page_toolbar",items:"> .wdform_section",create:function(e,t){jQuery(e.target).find(".wdform_section").each(function(){fm_row_handle(this)})},start:function(e,t){jQuery(".wdform_row_empty").hide()},stop:function(e,t){fm_rows_refresh(),jQuery(".wdform_row_empty").show()}}),jQuery(".wdform_column").sortable({connectWith:".wdform_column",cursor:"move",placeholder:"highlight",tolerance:"pointer",cancel:".wdform_section_handle",items:"> .wdform_row, #add_field",start:function(e,t){jQuery(".add-new-button").off("click"),jQuery(".wdform_column").removeClass("fm-hidden"),jQuery("#cur_column").removeAttr("id")},stop:function(e,t){return"add_field_cont"!=t.item.parent().attr("id")&&("add_field"==t.item.attr("id")&&"add_field_cont"!=t.item.parent().attr("id")?(nextID=jQuery("#add_field").next(".wdform_row").attr("wdid"),jQuery("#add_field").parent().attr("id","cur_column"),popup_ready(),Enable(),jQuery(".add-new-button").removeAttr("onclick"),!1):(jQuery(".wdform_column:not(#add_field_cont):empty").addClass("fm-hidden"),void fm_columns_refresh()))}})}function all_sortable_events(){fm_rows_refresh(),fm_columns_refresh(),jQuery(".wdform_row, .wdform_tr_section_break").off("hover, touchstart").on("hover, touchstart",function(e){if(!jQuery(this).find(".wdform_arrows").is(":visible"))return jQuery(".wdform_arrows").hide(),jQuery(this).find(".wdform_arrows").show(),e.preventDefault(),!1}).off("mouseleave").on("mouseleave",function(){jQuery(this).find(".wdform_arrows").hide()}),jQuery(".wdform_section_handle, .wdform_row_handle").off("hover, touchstart").on("hover, touchstart",function(e){jQuery(this).parent().addClass("fm-hover")}).off("mouseleave").on("mouseleave",function(){jQuery(this).parent().removeClass("fm-hover")})}function fm_change_radio(e){jQuery(e).hasClass("fm-yes")?(jQuery(e).val("0"),jQuery(e).next().val("0"),jQuery(e).removeClass("fm-yes").addClass("fm-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).val("1"),jQuery(e).next().val("1"),jQuery(e).find("span").animate({right:0},400,function(){jQuery(e).removeClass("fm-no").addClass("fm-yes")})),"mail_verify"==jQuery(e).next().attr("name")&&show_verify_options(1==jQuery(e).val())}function enable_drag(){jQuery(".wdform_column").sortable("enable"),jQuery(".wdform_arrows_advanced").hide(),jQuery(".wdform_field").css("cursor",""),jQuery("#add_field .wdform_field").css("cursor",""),all_sortable_events()}function refresh_(){document.getElementById("counter").value=gen,jQuery(".wdform-page-and-images").each(function(){var e=jQuery(this);e.find("[id^=page_next_]").removeAttr("src"),e.find("[id^=page_previous_]").removeAttr("src"),e.find(".form_id_tempform_view_img").remove()}),jQuery("#take div").removeClass("ui-sortable ui-sortable-disabled ui-sortable-handle"),jQuery("#add_field_cont").remove(),document.getElementById("form_front").value=btoa(encodeURI(document.getElementById("take").innerHTML))}function fm_add_submission_email(e,t,i,n){var a=jQuery("#"+t).val();if(a){var r=jQuery("<p>").attr("class","fm_mail_input").prependTo("#"+i);jQuery("<span>").attr("class","mail_name").text(a).appendTo(r),jQuery("<span>").attr("class","dashicons dashicons-trash").attr("onclick","fm_delete_mail(this, '"+a+"')").attr("title","Delete Email").appendTo(r),jQuery("#"+t).val(""),jQuery("#"+e).val(jQuery("#"+e).val()+a+",")}}function fm_delete_mail(e,t){jQuery(e).parent().remove(),jQuery("#mail").val(jQuery("#mail").val().replace(t+",",""))}function form_maker_options_tabs(e){return jQuery("#fieldset_id").val(e),jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive"),jQuery("#"+e+"_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active"),jQuery(".fm_fieldset_tab").removeClass("active"),jQuery("#"+e).addClass("active"),!1}function set_type(e){switch(e){case"post":document.getElementById("post").removeAttribute("style"),document.getElementById("page").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"page":document.getElementById("page").removeAttribute("style"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none");break;case"custom_text":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").removeAttribute("style"),document.getElementById("url").setAttribute("style","display:none");break;case"url":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").removeAttribute("style");break;case"none":document.getElementById("page").setAttribute("style","display:none"),document.getElementById("post").setAttribute("style","display:none"),document.getElementById("custom_text").setAttribute("style","display:none"),document.getElementById("url").setAttribute("style","display:none")}}function check_isnum(e){var t=e.which||e.keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t&&(t<35||40<t))}function fm_check_email(e){if(document.getElementById(e)&&""!=jQuery("#"+e).val()){for(var t=jQuery("#"+e).val().split(","),i=/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,61}$/,n=0;n<t.length;n++){var a=t[n].replace(/^\s+|\s+$/g,"");if(a&&!i.test(a)&&-1===a.indexOf("{")){if(alert("This is not a valid email address."),jQuery("#submenu li a").hasClass("active")){var r=jQuery("#submenu .active").attr("id");if(void 0!==(l=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id")))if(r!=(s=l.split("_fieldset")[0])){var o=r+"_fieldset";jQuery("#"+o).removeClass("fm_fieldset_active"),jQuery("#"+o).removeClass("fm_fieldset_deactive"),jQuery("#"+l).addClass("fm_fieldset_active"),jQuery("#submenu .active").removeClass("active"),jQuery("#"+s).addClass("active")}}else{var l;if(void 0!==(l=jQuery("#"+e).closest(".fm_fieldset_deactive").attr("id"))){var s=l.split("_fieldset");s=s[0],jQuery("#"+l).removeClass("fm_fieldset_deactive"),jQuery("#"+l).addClass("fm_fieldset_active"),jQuery("#"+s).addClass("active")}}return jQuery("#"+e).css("border","1px solid #FF0000"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0}}jQuery("#"+e).css("border","1px solid #ddd")}return!1}function wdhide(e){document.getElementById(e).style.display="none"}function wdshow(e){document.getElementById(e).style.display="block"}function delete_field_condition(e){var t=e.split("_");document.getElementById("condition"+t[0]).removeChild(document.getElementById("condition_div"+e))}function change_choices(e,t,i,n){switch(e=e.split("_"),global_index=e[0],id=e[1],index=e[2],ids_array=t.split("@@**@@"),types_array=i.split("@@**@@"),params_array=n.split("@@**@@"),types_array[id]){case"type_text":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_number":case"type_phone":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types_array[id]||"type_phone"==types_array[id])var a="return check_isnum_space(event)";else if("type_paypal_price"==types_array[id]||"type_paypal_price_new"==types_array[id])a="return check_isnum_point(event)";else a="";if("SELECT"==document.getElementById("field_value"+global_index+"_"+index).tagName){document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index));var r=document.createElement("input");r.setAttribute("id","field_value"+global_index+"_"+index),r.setAttribute("type","text"),r.setAttribute("value",""),r.setAttribute("class","fm_condition_field_input_value"),r.setAttribute("onKeyPress",a),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(r,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}else document.getElementById("field_value"+global_index+"_"+index).value="",document.getElementById("field_value"+global_index+"_"+index).setAttribute("onKeyPress",a);break;case"type_own_select":case"type_radio":case"type_checkbox":for("type_own_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(l=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),l.setAttribute("class","fm_condition_field_select_value"),"type_checkbox"==types_array[id]&&(l.setAttribute("multiple","multiple"),l.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(o=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),o.setAttribute("value",w_choices_value_array[k]),o.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&l.appendChild(o)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(l,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_paypal_select":case"type_paypal_radio":case"type_paypal_checkbox":case"type_paypal_shipping":for("type_paypal_select"==types_array[id]?w_size=params_array[id].split("*:*w_size*:*"):w_size=params_array[id].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(l=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+index),l.setAttribute("class","fm_condition_field_select_value"),"type_paypal_checkbox"==types_array[id]&&(l.setAttribute("multiple","multiple"),l.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var o;(o=document.createElement("option")).setAttribute("id","choise_"+global_index+"_"+k),o.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),o.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&l.appendChild(o)}document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(l,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index));break;case"type_address":var l;countries=form_maker.countries,(l=document.createElement("select")).setAttribute("id","field_value"+global_index+"_"+m),l.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");l.setAttribute("id","field_value"+global_index+"_"+index),i.setAttribute("value",t),i.innerHTML=t,l.appendChild(i)}),document.getElementById("condition_div"+global_index+"_"+index).removeChild(document.getElementById("field_value"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(l,document.getElementById("delete_condition"+global_index+"_"+index)),document.getElementById("condition_div"+global_index+"_"+index).insertBefore(document.createTextNode(" "),document.getElementById("delete_condition"+global_index+"_"+index))}}function add_condition_fields(n,e,t,a,r){for(ids=e.split("@@**@@"),labels=t.split("@@**@@"),types=a.split("@@**@@"),params=r.split("@@**@@"),i=500;0<=i&&!document.getElementById("condition_div"+n+"_"+i);i--);m=i+1;var o=document.createElement("div");o.setAttribute("id","condition_div"+n+"_"+m);var l=document.createElement("select");for(l.setAttribute("id","field_labels"+n+"_"+m),l.setAttribute("onchange","change_choices(options[selectedIndex].id+'_"+m+"','"+e+"','"+a+"','"+r.replace(/\'/g,"\\'")+"')"),l.setAttribute("class","fm_condition_field_labels"),k=0;k<labels.length;k++)if(ids[k]!=document.getElementById("fields"+n).value){var s=document.createElement("option");s.setAttribute("id",n+"_"+k),s.setAttribute("value",ids[k]),s.innerHTML=labels[k],l.appendChild(s)}o.appendChild(l),o.appendChild(document.createTextNode(" "));var d=document.createElement("select");d.setAttribute("id","is_select"+n+"_"+m),d.setAttribute("class","fm_condition_is_select");var c=document.createElement("option");c.setAttribute("id","is"),c.setAttribute("value","=="),c.innerHTML="is";var u=document.createElement("option");u.setAttribute("id","is_not"),u.setAttribute("value","!="),u.innerHTML="is not";var _=document.createElement("option");_.setAttribute("id","like"),_.setAttribute("value","%"),_.innerHTML="like";var p=document.createElement("option");p.setAttribute("id","not_like"),p.setAttribute("value","!%"),p.innerHTML="not like";var y=document.createElement("option");y.setAttribute("id","empty"),y.setAttribute("value","="),y.innerHTML="empty";var f=document.createElement("option");if(f.setAttribute("id","not_empty"),f.setAttribute("value","!"),f.innerHTML="not empty",d.appendChild(c),d.appendChild(u),d.appendChild(_),d.appendChild(p),d.appendChild(y),d.appendChild(f),o.appendChild(d),o.appendChild(document.createTextNode(" ")),ids[0]!=document.getElementById("fields"+n).value)var h=0;else h=1;switch(types[h]){case"type_text":case"type_star_rating":case"type_password":case"type_textarea":case"type_name":case"type_submitter_mail":case"type_phone":case"type_number":case"type_paypal_price":case"type_paypal_price_new":case"type_spinner":case"type_date_new":case"type_phone_new":if("type_number"==types[h]||"type_phone"==types[h])var v="return check_isnum_space(event)";else if("type_paypal_price"==types[h]||"type_paypal_price_new"==types[h])v="return check_isnum_point(event)";else v="";var g=document.createElement("input");g.setAttribute("id","field_value"+n+"_"+m),g.setAttribute("type","text"),g.setAttribute("value",""),g.setAttribute("class","fm_condition_field_input_value"),g.setAttribute("onKeyPress",v),o.appendChild(g);break;case"type_checkbox":case"type_radio":case"type_own_select":for("type_own_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),-1!==w_size[1].indexOf("*:*w_value_disabled*:*")?(w_value_disabled=w_size[1].split("*:*w_value_disabled*:*"),w_choices_value=w_value_disabled[1].split("*:*w_choices_value*:*"),w_choices_value_array=w_choices_value[0].split("***")):w_choices_value_array=w_choices_array,(j=document.createElement("select")).setAttribute("id","field_value"+n+"_"+m),j.style.cssText="vertical-align: top; width:200px;","type_checkbox"==types[h]&&(j.setAttribute("multiple","multiple"),j.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){(b=document.createElement("option")).setAttribute("id","choise_"+n+"_"+k),b.setAttribute("value",w_choices_value_array[k]),b.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&j.appendChild(b)}o.appendChild(j);break;case"type_paypal_select":case"type_paypal_checkbox":case"type_paypal_radio":case"type_paypal_shipping":for("type_paypal_select"==types[h]?w_size=params[h].split("*:*w_size*:*"):w_size=params[h].split("*:*w_flow*:*"),w_choices=w_size[1].split("*:*w_choices*:*"),w_choices_array=w_choices[0].split("***"),w_choices_price=w_choices[1].split("*:*w_choices_price*:*"),w_choices_price_array=w_choices_price[0].split("***"),(j=document.createElement("select")).setAttribute("id","field_value"+n+"_"+m),j.style.cssText="vertical-align: top; width:200px;","type_paypal_checkbox"==types[h]&&(j.setAttribute("multiple","multiple"),j.setAttribute("class","multiple_select")),k=0;k<w_choices_array.length;k++){var b;(b=document.createElement("option")).setAttribute("id","choise_"+n+"_"+k),b.setAttribute("value",w_choices_array[k]+"*:*value*:*"+w_choices_price_array[k]),b.innerHTML=w_choices_array[k],-1===w_choices_array[k].indexOf("[")&&-1===w_choices_array[k].indexOf("]")&&j.appendChild(b)}o.appendChild(j);break;case"type_address":var j;countries=form_maker.countries,(j=document.createElement("select")).setAttribute("id","field_value"+n+"_"+m),j.setAttribute("class","fm_condition_field_select_value"),jQuery.each(countries,function(e,t){var i=document.createElement("option");i.setAttribute("id","choise_"+n+"_"+k),i.setAttribute("value",t),i.innerHTML=t,j.appendChild(i)}),o.appendChild(j)}o.appendChild(document.createTextNode(" "));var Q=document.createElement("span");Q.setAttribute("class","dashicons dashicons-trash"),Q.setAttribute("id","delete_condition"+n+"_"+m),Q.setAttribute("onClick",'delete_field_condition("'+n+"_"+m+'")'),Q.style.cssText="vertical-align: middle",o.appendChild(Q),document.getElementById("condition"+n).appendChild(o)}function add_condition(e,t,n,a,r,o){for(i=500;0<=i&&!document.getElementById("condition"+i);i--);num=i+1,ids=r.split("@@**@@"),labels=o.split("@@**@@");var l=document.createElement("div");l.setAttribute("id","condition"+num),l.setAttribute("class","fm_condition");var s=document.createElement("div");s.setAttribute("id","conditional_fileds"+num);var d=document.createElement("select");d.setAttribute("id","show_hide"+num),d.setAttribute("name","show_hide"+num),d.setAttribute("class","fm_condition_show_hide");var c=document.createElement("option");c.setAttribute("value","1"),c.innerHTML="show";var u=document.createElement("option");u.setAttribute("value","0"),u.innerHTML="hide",d.appendChild(c),d.appendChild(u);var _=document.createElement("select");for(_.setAttribute("id","fields"+num),_.setAttribute("name","fields"+num),_.setAttribute("class","fm_condition_fields"),k=0;k<labels.length;k++){var m=document.createElement("option");m.setAttribute("value",ids[k]),m.innerHTML=labels[k],_.appendChild(m)}var p=document.createElement("span");p.innerHTML="if";var y=document.createElement("select");y.setAttribute("id","all_any"+num),y.setAttribute("name","all_any"+num),y.setAttribute("class","fm_condition_all_any");var f=document.createElement("option");f.setAttribute("value","and"),f.innerHTML="all";var h=document.createElement("option");h.setAttribute("value","or"),h.innerHTML="any",y.appendChild(f),y.appendChild(h);var v=document.createElement("span");v.style.maxWidth="235px",v.style.width="100%",v.style.display="inline-block",v.innerHTML="of the following match:";var g=document.createElement("span");g.setAttribute("class","dashicons dashicons-plus-alt"),g.setAttribute("onClick",'add_condition_fields("'+num+'", "'+e+'", "'+t.replace(/\'/g,"\\'").replace(/\"/g,""")+'", "'+n.replace(/\'/g,"\\'").replace(/\"/g,""")+'", "'+a.replace(/\'/g,"\\'").replace(/\"/g,""")+'")');var b=document.createElement("span");b.setAttribute("class","dashicons dashicons-trash"),b.setAttribute("onClick",'delete_condition("'+num+'")'),s.appendChild(d),s.appendChild(document.createTextNode(" ")),s.appendChild(_),s.appendChild(document.createTextNode(" ")),s.appendChild(p),s.appendChild(document.createTextNode(" ")),s.appendChild(y),s.appendChild(document.createTextNode(" ")),s.appendChild(v),s.appendChild(document.createTextNode(" ")),s.appendChild(b),s.appendChild(document.createTextNode(" ")),s.appendChild(g),l.appendChild(s),document.getElementById("conditions_fieldset_wrap").appendChild(l)}function delete_condition(e){document.getElementById("conditions_fieldset_wrap").removeChild(document.getElementById("condition"+e))}function acces_level(e){var t="";for(i=0;i<=parseInt(e);i++)document.getElementById("user_"+i).checked&&(t=t+document.getElementById("user_"+i).value+",");document.getElementById("user_id_wd").value=t}function check_isnum_space(e){var t=e.which||e.keyCode;return 32==t||!(31<t&&(t<48||57<t))}function check_isnum_point(e){var t=e.which||e.keyCode;return 46==t||!(31<t&&(t<48||57<t))}function check_stripe_required_fields(){if(jQuery("#paypal_mode2").prop("checked"))for("1"==jQuery("#stripemode").val()?(fields=["live_sec","live_pub"],fields_titles=["Live secret key","Live publishable key"]):(fields=["test_sec","test_pub"],fields_titles=["Test secret key","Test publishable key"]),i=0;i<fields.length;i++)if(!jQuery("#"+fields[i]).val())return jQuery("#"+fields[i]).focus(),alert(fields_titles[i]+" is required."),!0;return!1}function check_calculator_required_fields(){var i=0;return jQuery(jQuery("#wd_calculated_field_table").find('[id^="wdc_equation_"]')).each(function(){if(""==jQuery(this).val()){var e=jQuery(this).attr("id").replace("wdc_equation_",""),t=jQuery(jQuery("#wd_calculated_field_table").find("[data-field='"+e+"']")).html();i=1,jQuery(this).focus(),alert("Set equation for the field "+t)}if(1==i)return!1}),1==i}function set_theme(){theme_id="0"==jQuery("#theme").val()?default_theme:jQuery("#theme").val(),jQuery("#edit_css").attr("onclick","window.open('"+theme_edit_url+"¤t_id="+theme_id+"'); return false;"),1==jQuery("#theme option:selected").attr("data-version")?jQuery("#old_theme_notice").show():jQuery("#old_theme_notice").hide()}function filter_fields_submit(){jQuery("#fm-fields-filter").find("input").keypress(function(e){13==e.which&&(jQuery("#fm-fields-filter").find("#fm_is_search").val(1),fm_form_submit(!1,"admin_form"))})}function show_hide_filter(){return jQuery(".show-filter").toggle(),jQuery(".hide-filter").toggle(),"none"==document.getElementById("fm-fields-filter").style.display?(document.getElementById("fm-fields-filter").style.display="",jQuery(".fm-bulk-actions .search_reset_button").show()):(document.getElementById("fm-fields-filter").style.display="none",jQuery(".fm-bulk-actions .search_reset_button").hide()),add_scroll_width(),!1}function add_scroll_width(){var e=jQuery(".fm-table-submissions").width(),i=0;jQuery.each(jQuery("#fm-scroll table tr.fm_table_head td:visible, #fm-scroll table tr.fm_table_head th:visible"),function(e,t){i+=jQuery(this).width()}),jQuery(".table-scroll-1, .table-scroll-2").css({width:i+"px"}),jQuery(".table-wrapper-1, .table-wrapper-2").css({"overflow-x":"scroll"}),i<e&&remove_scroll_width()}function remove_scroll_width(){jQuery(".table-wrapper-1, .table-wrapper-2").css("overflow-x","hidden"),jQuery(".table-scroll-1, .table-scroll-2").css("width","auto")}function add_scroll_left(){jQuery(".table-wrapper-1").scroll(function(){jQuery(".table-wrapper-2").scrollLeft(jQuery(".table-wrapper-1").scrollLeft())}),jQuery(".table-wrapper-2").scroll(function(){jQuery(".table-wrapper-1").scrollLeft(jQuery(".table-wrapper-2").scrollLeft())})}function tableOrdering(e,t,i){var n=document.admin_form;n.filter_order2.value=e,n.filter_order_Dir2.value=t,submitform(i)}function ordering(e,t){document.getElementById("asc_or_desc").value=t,document.getElementById("order_by").value=e,document.getElementById("admin_form").submit()}function renderColumns(){for(curTag in allTags=document.getElementsByTagName("*"),allTags)void 0!==allTags[curTag].className&&0<allTags[curTag].className.indexOf("_fc")&&(curLabel=allTags[curTag].className.replace("_fc",""),curLabel=curLabel.replace("table_large_col ",""),0<=document.forms.admin_form.hide_label_list.value.indexOf("@"+curLabel+"@")?allTags[curTag].style.display="none":allTags[curTag].style.display=""),void 0!==allTags[curTag].id&&0<allTags[curTag].id.indexOf("_fc")&&(curLabel=allTags[curTag].id.replace("_fc",""),0<=document.forms.admin_form.hide_label_list.value.indexOf("@"+curLabel+"@")?allTags[curTag].style.display="none":allTags[curTag].style.display="")}function clickLabChB(e,t){document.forms.admin_form.hide_label_list.value=document.forms.admin_form.hide_label_list.value.replace("@"+e+"@",""),""==document.forms.admin_form.hide_label_list.value&&(document.getElementById("ChBAll").checked=!0),t.checked||(document.forms.admin_form.hide_label_list.value+="@"+e+"@",document.getElementById("ChBAll").checked=!1),renderColumns(),set_all_column_checkbox_checked()}function toggleChBDiv(e){if(e){var t=jQuery(window).width(),i=jQuery(window).height();document.getElementById("sbox-overlay").style.width=t+"px",document.getElementById("sbox-overlay").style.height=i+"px",document.getElementById("ChBDiv").style.left=Math.floor((t-350)/2)+"px",document.getElementById("ChBDiv").style.display="block",document.getElementById("sbox-overlay").style.display="block",set_columns_history_checked()}else document.getElementById("ChBDiv").style.display="none",document.getElementById("sbox-overlay").style.display="none",set_show_hide_column_ids(),show_hide_columns_history();add_scroll_width(),add_scroll_left()}function set_columns_history_checked(){if(getFormLocalStorage().show_hide_column_ids){var e=getFormLocalStorage().show_hide_column_ids,t=jQuery("#ChBDiv input[type=checkbox]");t.filter(":checkbox").removeAttr("checked");document.getElementById("ChBAll");t.length!=e.length&&jQuery("#ChBAll").addClass("fm-remove_before"),t.length==e.length&&jQuery("#ChBAll").removeClass("fm-remove_before"),jQuery.each(e,function(e,t){jQuery("#ChBDiv #"+t).prop("checked",!0).attr("checked")})}}function set_all_column_checkbox_checked(){var e=jQuery("#ChBAll"),t=jQuery("#ChBDiv input[type=checkbox]");t.length==t.filter(":checked").length?e.removeClass("fm-remove_before").prop("checked",!0):e.addClass("fm-remove_before").prop("checked",!1)}function set_show_hide_column_ids(){var n=[],e={};jQuery("#ChBDiv input[type=checkbox]").each(function(e,t){if(this.checked){var i=jQuery(this).attr("id");n.push(i)}}),e.show_hide_column_ids=n,localStorage.setItem("fm_form"+formId,JSON.stringify(e))}function show_hide_columns_history(){getFormLocalStorage().show_hide_column_ids&&(jQuery("#fm-submission-lists th, #fm-submission-lists td").addClass("fm-hide-column"),jQuery.each(getFormLocalStorage().show_hide_column_ids,function(e,t){var i=t.replace("fm_check_id_","");i=i.replace("fm_check_",""),jQuery("#fm-submission-lists ."+i+"_fc").removeClass("fm-hide-column").addClass("fm-show-column")}),jQuery("#fm-submission-lists .fm-column-not-hide").removeClass("fm-hide-column"))}function submit_del(e){document.getElementById("admin_form").action=e,document.getElementById("admin_form").submit()}function submitbutton(e){document.adminForm;"cancel_theme"!=e?""!=document.getElementById("title").value?submitform(e):alert("The theme must have a title."):submitform(e)}function submitform(e){document.getElementById("adminForm").action=document.getElementById("adminForm").action+"&task="+e,document.getElementById("adminForm").submit()}function edit_star_rating(e,t){rated=!0,star_amount=document.getElementById(t+"_star_amountform_id_temp").value;for(var i=0;i<=e;i++)document.getElementById(t+"_star_"+i).src=plugin_url+"/images/star_yellow.png";for(var n=e+1;n<=star_amount-1;n++)document.getElementById(t+"_star_"+n).src=plugin_url+"/images/star.png";star_amount=e+1,document.getElementById(t+"_selected_star_amountform_id_temp").value=star_amount,document.getElementById("submission_"+t).value=star_amount+"/"+document.getElementById(t+"_star_colorform_id_temp").value}function edit_scale_rating(e,t){if(!e);scale_amount=document.getElementById(t+"_scale_checkedform_id_temp").value,document.getElementById("submission_"+t).value=e+"/"+scale_amount}function edit_grading(e,t){for(var i=0,n="",a=0;a<100;a++)document.getElementById(e+"_element"+a)&&document.getElementById(e+"_element"+a).value&&(i+=parseInt(document.getElementById(e+"_element"+a).value)),i>document.getElementById(e+"_grading_totalform_id_temp").innerHTML&&(document.getElementById(e+"_text_elementform_id_temp").innerHTML=" Your score should be less than "+document.getElementById(e+"_grading_totalform_id_temp").innerHTML);document.getElementById(e+"_grading_sumform_id_temp").innerHTML=i,element=document.getElementById(e+"_element_valueform_id_temp").value,element=element.split(":");for(a=0;a<(element.length-1)/2;a++)document.getElementById(e+"_element"+a).value?n+=document.getElementById(e+"_element"+a).value+":":n+=":";element=element.slice((element.length-1)/2),element=element.join(":"),grading=n+element,document.getElementById(e+"_element_valueform_id_temp").value=grading,document.getElementById("submission_"+e).value=grading+"***grading***"}function edit_range(e,t,i){document.getElementById(t+"_element"+i).value=e,document.getElementById("submission_"+t).value=document.getElementById(t+"_element0").value+"-"+document.getElementById(t+"_element1").value}function change_radio_values(e,t,i,n){for(var a="",r=!0,o=1;o<=i;o++){for(var l=1;l<=n;l++)if(1==document.getElementById(t+"_input_elementform_id_temp"+o+"_"+l).checked){a+=o+"_"+l+"***",r=!1;break}1==r&&(a+="0***"),r=!0}var s=document.getElementById(t+"_matrixform_id_temp").value;s=(s=(s=s.split("***")).slice(0,-(i+1))).join("***"),s+="***"+a,document.getElementById("submission_"+t).value=s+"***matrix***",document.getElementById(t+"_matrixform_id_temp").value=s}function change_text_values(e,t,i,n){for(var a="",r=1;r<=i;r++)for(var o=1;o<=n;o++)a+=document.getElementById(t+"_input_elementform_id_temp"+r+"_"+o).value+"***";var l=document.getElementById(t+"_matrixform_id_temp").value;l=(l=(l=l.split("***")).slice(0,-(i*n+1))).join("***"),l+="***"+a,document.getElementById("submission_"+t).value=l+"***matrix***",document.getElementById(t+"_matrixform_id_temp").value=l}function change_checkbox_values(e,t,i,n){for(var a="",r=1;r<=i;r++)for(var o=1;o<=n;o++)1==document.getElementById(t+"_input_elementform_id_temp"+r+"_"+o).checked?a+="1***":a+="0***";var l=document.getElementById(t+"_matrixform_id_temp").value;l=l.slice(0,-4*i*n),l+=a,document.getElementById("submission_"+t).value=l+"***matrix***",document.getElementById(t+"_matrixform_id_temp").value=l}function change_option_values(e,t,i,n){for(var a="",r=1;r<=i;r++)for(var o=1;o<=n;o++)a+=document.getElementById(t+"_select_yes_noform_id_temp"+r+"_"+o).value+"***";var l=document.getElementById(t+"_matrixform_id_temp").value;l=(l=(l=l.split("***")).slice(0,-(i*n+1))).join("***"),l+="***"+a,document.getElementById("submission_"+t).value=l+"***matrix***",document.getElementById(t+"_matrixform_id_temp").value=l}function fm_Tooltip(){jQuery(".fm_masterTooltip").hover(function(){var e=jQuery(this).attr("title");jQuery(this).data("tipText",e).removeAttr("title"),jQuery('<p class="fm_tooltip"></p>').text(e).appendTo("body").fadeIn("slow")},function(){jQuery(this).attr("title",jQuery(this).data("tipText")),jQuery(".fm_tooltip").remove()}).mousemove(function(e){var t=e.pageX-100,i=e.pageY+10;jQuery(".fm_tooltip").css({top:i,left:t})})}jQuery(document).on("ready fm_tab_loaded, ready fm_tab_email_loaded",function(){fm_admin_ready()}),jQuery(window).on("load",function(){jQuery("#fm_loading").hide(),jQuery("#fm_admin_container").show(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items(),jQuery("#fm_ask_question").parent().attr("target","_blank")}),document.onkeypress=stopRKey,jQuery(document).ready(function(){jQuery(".pp_display_on #pt0").click(function(){var e=jQuery(this).prop("checked");jQuery('.pp_display_on input[type="checkbox"]').prop("checked",e),e?jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}),jQuery('.pp_display_on input[type="checkbox"]:not("#pt0")').click(function(){var e=jQuery(this).prop("checked");jQuery(".pp_display_on #pt0").prop("checked")&&!e&&jQuery(".pp_display_on #pt0").prop("checked",!1)}),jQuery(".pp_display_on #pt4").click(function(){fm_toggle_pages(this)}),jQuery(".pp_display_on #pt3").click(function(){fm_toggle_posts(this)}),jQuery("body").on("focusin",".pp_search_posts",function(){var e=jQuery(this);e.closest("ul").find(".pp_live_search").removeClass("fm-hide"),e.hasClass("already_triggered")||(e.addClass("already_triggered"),pp_live_search(e,500,!0))}),jQuery(document).click(function(){jQuery(".pp_live_search").addClass("fm-hide")}),jQuery("body").on("click",".fm-pp",function(){return!1}),jQuery("body").on("input",".pp_search_posts",function(){pp_live_search(jQuery(this),500,!0)}),jQuery("body").on("click",".pp_search_results li",function(){var e=jQuery(this);if(!e.hasClass("pp_no_res")){var t=e.text(),i=e.data("post_id"),n=e.closest(".fm-pp"),a=n.find(".pp_selected"),r=n.find(".pp_exclude"),o='<span data-post_id="'+i+'">'+t+'<span class="pp_selected_remove">x</span></span>';-1===a.html().indexOf('data-post_id="'+i+'"')&&(a.append(o),""===r.val()?r.val(i):r.val(function(e,t){return t+","+i}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),i=t.val(),n=e.data("post_id");if(-1!==i.indexOf(n)){var a,r=-1!==i.indexOf(","+n)?","+n:n+",";r=-1!==i.indexOf(",")?r:n;a=i.replace(r,""),t.val(a)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var i=jQuery('input[name="display_on_categories[]"]:checked').length,n=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(i-=1),t.prop("checked",!1),i==n&&t.prop("checked",!0)}})}),function(l){l.fn.serializeObject=function(){var a=this,r={},t={},o={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,i){return e[t]=i,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},l.each(l(this).serializeArray(),function(){if(o.validate.test(this.name)){for(var e,t=this.name.match(o.key),i=this.value,n=this.name;void 0!==(e=t.pop());)n=n.replace(new RegExp("\\["+e+"\\]$"),""),e.match(o.push)?i=a.build([],a.push_counter(n),i):e.match(o.fixed)?i=a.build([],e,i):e.match(o.named)&&(i=a.build({},e,i));r=l.extend(!0,r,i)}}),r}}(jQuery),jQuery(document).on("dblclick",".wdform_row, .wdform_tr_section_break",function(){edit(jQuery(this).attr("wdid"))}),jQuery(document).ready(function(){jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1}),jQuery("#startdate, #startstats, #enddate, #endstats").datepicker({dateFormat:"yy-mm-dd",changeMonth:!0,changeYear:!0}),show_hide_columns_history(),add_scroll_width(),add_scroll_left(),fm_Tooltip(),filter_fields_submit()}),jQuery(window).scroll(function(){var e=0,t=jQuery(this).scrollTop(),i=jQuery(".tablenav");i.length&&(e=i.offset().top),e<t?jQuery(".table-wrapper-1").addClass("fixed").css({width:jQuery("#admin_form").width()+"px"}):jQuery(".table-wrapper-1").removeClass("fixed")}),jQuery(window).on("load",function(e){fm_popup(),void 0!==jQuery().fancybox&&jQuery.isFunction(jQuery().fancybox)&&jQuery(".fm_fancybox").fancybox({"maxWidth ":600,maxHeight:500})}),jQuery(window).on("resize",function(){jQuery(window).width()<=765?(document.getElementById("fm-fields-filter").style.display="none",remove_scroll_width()):(jQuery(".hide-filter.hide").is(":visible")&&(document.getElementById("fm-fields-filter").style.display=""),add_scroll_width())});