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("
'+""+form_maker_manage.add_new_field+'');t.prepend(i),i.after('')}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")?(fm_check_something_really_important()||(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=document.getElementById("take").innerHTML}function fm_add_submission_email(e,t,i,n){var a=jQuery("#"+t).val();if(a){var r=jQuery("").attr("class","fm_mail_input").prependTo("#"+i);jQuery("").attr("class","mail_name").text(a).appendTo(r),jQuery("").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!(31document.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('').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()}),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=''+t+'x';-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