Seditio Source
Root |
./othercms/b2evolution_7.2.3/rsc/js/build/bootstrap-evo_backoffice.bmin.js
/* This includes 23 files: build/evo_generic.bmin.js, functions.js, ajax.js, communication.js, form_extensions.js, extracats.js, dynamic_select.js, backoffice.js, blog_widgets.js, src/bootstrap-evo_modal_window.js, src/evo_images.js, src/evo_user_crop.js, src/evo_user_report.js, src/evo_user_deldata.js, src/evo_user_org.js, src/evo_automation.js, src/evo_user_tags.js, src/evo_user_status.js, src/evo_user_groups.js, src/evo_rest_api.js, src/evo_links.js, src/evo_forms.js, src/evo_input_counter.js */

function evo_prevent_key_enter(e){jQuery(e).keypress(function(e){if(13==e.keyCode)return!1})}function link_attachment_window(e,t,n,o,i,r){openModalWindow('<span class="loader_img loader_user_report absolute_center" title="'+evo_link_attachment_window_config.loader_title+'"></span>',"90%","80%",!0,evo_link_attachment_window_config.window_title,"",!0);var a={action:"link_attachment",link_owner_type:e,link_owner_ID:t,crumb_link:evo_link_attachment_window_config.crumb_link,root:void 0===n?"":n,path:void 0===o?"":o,fm_highlight:void 0===i?"":i,prefix:void 0===r?"":r};return jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:a,success:function(e){openModalWindow(e,"90%","80%",!0,evo_link_attachment_window_config.window_title,"")}}),!1}void 0===evoFadeBg&&(evoFadeBg=function evoFadeBg(selector,bgs,options){var origBg=jQuery(selector).css("backgroundColor"),speed=options&&options.speed||'"slow"',toEval="jQuery(selector).animate({ backgroundColor: ";for(e in bgs)"string"==typeof bgs[e]&&(toEval+='"'+bgs[e]+'"}, '+speed+" ).animate({ backgroundColor: ");toEval+="origBg }, "+speed+', "", function(){jQuery( this ).css( "backgroundColor", "" );});',eval(toEval)}),void 0===evoFadeSuccess&&(evoFadeSuccess=function(e){evoFadeBg(e,new Array("#ddff00","#bbff00"))}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_scroll_to_top&&(window.offset=400,offset_opacity=1200,scroll_top_duration=700,$slide_top=jQuery(".slide-top"),jQuery(window).scroll(function(){jQuery(this).scrollTop()>offset?$slide_top.addClass("slide-top-visible"):$slide_top.removeClass("slide-top-visible")}),$slide_top.on("click",function(e){e.preventDefault(),jQuery("body, html").animate({scrollTop:0},scroll_top_duration)})),"undefined"!=typeof evo_init_datepicker&&jQuery(evo_init_datepicker.selector).datepicker(evo_init_datepicker.config),"undefined"!=typeof evo_link_position_config&&(window.displayInlineReminder=evo_link_position_config.display_inline_reminder,window.deferInlineReminder=evo_link_position_config.defer_inline_reminder,jQuery(document).on("change",evo_link_position_config.selector,{url:evo_link_position_config.url,crumb:evo_link_position_config.crumb},function(e){"inline"==this.value&&window.displayInlineReminder&&!window.deferInlineReminder&&(alert(evo_link_position_config.alert_msg),window.displayInlineReminder=!1),evo_link_change_position(this,e.data.url,e.data.crumb)})),"undefined"!=typeof evo_itemform_renderers__click&&jQuery("#itemform_renderers .dropdown-menu").on("click",function(e){e.stopPropagation()}),"undefined"!=typeof evo_commentform_renderers__click&&jQuery("#commentform_renderers .dropdown-menu").on("click",function(e){e.stopPropagation()}),"undefined"!=typeof evo_init_comment_reply_config&&(jQuery(document).on("click","a.comment_reply",function(){var e=jQuery(this).attr("rel");jQuery("a.comment_reply_current").remove(),jQuery("input[name=reply_ID]").remove(),jQuery("a.comment_reply").removeClass("active").html(evo_init_comment_reply_config.reply_button_msg);var t='<a href="'+evo_init_comment_reply_config.link_back_url+"#c"+e+'" class="comment_reply_current" rel="'+e+'">'+evo_init_comment_reply_config.link_back_specific_comment_msg+"</a>",n='<input type="hidden" name="reply_ID" value="'+e+'" />';return jQuery("#evo_comment_form_id_"+evo_init_comment_reply_config.item_ID).prepend(t+n),jQuery(this).addClass("active").html(evo_init_comment_reply_config.link_back_current_comment_msg),jQuery(window).scrollTop(jQuery("#evo_comment_form_id_"+evo_init_comment_reply_config.item_ID).offset().top-30),!1}),jQuery(document).on("click","a.comment_reply_current",function(){var e=jQuery(this).attr("rel");return jQuery(window).scrollTop(jQuery("a#c"+e).offset().top-10),!1})),"undefined"!=typeof evo_disp_download_delay_config&&(window.b2evo_download_timer=evo_disp_download_delay_config,window.downloadInterval=setInterval(function(){jQuery("#download_timer").html(window.b2evo_download_timer),0==window.b2evo_download_timer&&(clearInterval(window.downloadInterval),jQuery("#download_help_url").show()),window.b2evo_download_timer--},1e3),jQuery("#download_timer_js").show()),"undefined"!=typeof evo_skin_bootstrap_forum__quote_button_click&&jQuery(".quote_button").click(function(){var e=jQuery("form[id^=evo_comment_form_id_]");return 0==e.length||(e.attr("action",jQuery(this).attr("href")),e.submit(),!1)}),"undefined"!=typeof evo_ajax_form_config)for(var t=Object.values(evo_ajax_form_config),n=0;n<t.length;n++)!function(){var i=t[n];window["ajax_form_offset_"+i.form_number]=jQuery("#ajax_form_number_"+i.form_number).offset().top,window["request_sent_"+i.form_number]=!1,window["ajax_form_loading_number_"+i.form_number]=0;var r="get_form_"+i.form_number;window[r]=function(){var o="#ajax_form_number_"+i.form_number;window["ajax_form_loading_number_"+i.form_number]++,jQuery.ajax({url:htsrv_url+"anon_async.php",type:"POST",data:i.json_params,success:function(e){jQuery(o).html(ajax_debug_clear(e))},error:function(e,t,n){jQuery(".loader_ajax_form",o).after('<div class="red center">'+n+": "+e.responseText+"</div>"),window["ajax_form_loading_number_"+i.form_number]<3&&setTimeout(function(){jQuery(".loader_ajax_form",o).next().remove(),window[r]()},1e3)}})};var e="check_and_show_"+i.form_number;window[e]=function(e){if(!window["request_sent_"+i.form_number]){var t=null!=typeof e&&e;(t=t||jQuery(window).scrollTop()>=window["ajax_form_offset_"+i.form_number]-jQuery(window).height()-20)&&(window["request_sent_"+i.form_number]=!0,window[r]())}},jQuery(window).scroll(function(){window[e]()}),jQuery(window).resize(function(){window[e]()}),window[e](i.load_ajax_form_on_page_load)}();if("undefined"!=typeof evo_thread_form_config&&(window.check_multiple_recipients=function(){1<jQuery('input[name="thrd_recipients_array[login][]"]').length?jQuery("#multiple_recipients").show():jQuery("#multiple_recipients").hide()},window.check_form_thread=function(){return""==jQuery("input#token-input-thrd_recipients").val()||(alert(evo_thread_form_config.missing_username_msg),jQuery("input#token-input-thrd_recipients").focus(),!1)},evo_thread_form_config.token_input_config.tokenFormatter=function(e){return"<li>"+e[evo_thread_form_config.username_display]+'<input type="hidden" name="thrd_recipients_array[id][]" value="'+e.id+'" /><input type="hidden" name="thrd_recipients_array[login][]" value="'+e.login+'" /></li>'},evo_thread_form_config.token_input_config.resultsFormatter=function(e){var t=e.login;return null!=e.fullname&&void 0!==e.fullname&&(t+="<br />"+e.fullname),"<li>"+e.avatar+"<div>"+t+"</div><span></span></li>"},evo_thread_form_config.token_input_config.onAdd=function(){window.check_multiple_recipients()},evo_thread_form_config.token_input_config.onDelete=function(){window.check_multiple_recipients()},evo_thread_form_config.token_input_config.onReady=function(){evo_thread_form_config.thrd_recipients_has_error&&jQuery(".token-input-list-facebook").addClass("token-input-list-error"),jQuery("#thrd_recipients").removeAttr("required")},jQuery("#thrd_recipients").tokenInput(restapi_url+"users/recipients",evo_thread_form_config.token_input_config),window.check_multiple_recipients()),"undefined"!=typeof evo_comment_form_preview_button_config&&jQuery("input[type=submit].preview.btn-info").val(evo_comment_form_preview_button_config.button_value),"undefined"!=typeof evo_user_func__callback_filter_userlist&&(jQuery("#country").change(function(){jQuery(this),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_regions_option_list&ctry_id="+jQuery(this).val(),success:function(e){jQuery("#region").html(ajax_debug_clear(e)),1<jQuery("#region option").length?jQuery("#region_filter").show():jQuery("#region_filter").hide(),window.load_subregions(0)}})}),jQuery("#region").change(function(){window.load_subregions(jQuery(this).val())}),jQuery("#subregion").change(function(){window.load_cities(jQuery("#country").val(),jQuery("#region").val(),jQuery(this).val())}),window.load_subregions=function(t){jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_subregions_option_list&rgn_id="+t,success:function(e){jQuery("#subregion").html(ajax_debug_clear(e)),1<jQuery("#subregion option").length?jQuery("#subregion_filter").show():jQuery("#subregion_filter").hide(),load_cities(jQuery("#country").val(),t,0)}})},window.load_cities=function(e,t,n){void 0===e&&(e=0),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_cities_option_list&ctry_id="+e+"&rgn_id="+t+"&subrg_id="+n,success:function(e){jQuery("#city").html(ajax_debug_clear(e)),1<jQuery("#city option").length?jQuery("#city_filter").show():jQuery("#city_filter").hide()}})}),"undefined"!=typeof coll_activity_stats_widget_config&&(window.coll_activity_stats_widget_resize_timer,window.resize_coll_activity_stat_widget=function(){for(var e=Object.values(window.activity_stats_widgets),t=0;t<e.length;t++){var n=e[t];if(null==n._original){n._display=coll_activity_stats_widget_config.time_period,n._original={data:[],xLabels:[]};for(var o=0;o<n.series.length;o++)n._original.data.push(n.series[o].data);n._original.xLabels=n.axes.xaxis.ticks}if(null==n._week)if(n._week={data:[],xLabels:[]},7==n._original.xLabels.length)n._week=n._original;else for(o=0;o<n._original.data.length;o++){for(var i=[],r=7,a=1;0<r;r--,a++)i.unshift([r,n._original.data[o][n._original.data[o].length-a][1]]);n._week.data.push(i),n._week.xLabels=n._original.xLabels.slice(-7)}if(jQuery(n.target).width()<650){if("last_week"!=n._display){for(o=0;o<n.series.length;o++)n.series[o].data=n._week.data[o];n.axes.xaxis.ticks=n._week.xLabels,n._display="last_week"}}else if("last_month"!=n._display){for(o=0;o<n.series.length;o++)n.series[o].data=n._original.data[o];n.axes.xaxis.ticks=n._original.xLabels,n._display="last_month"}n.replot({resetAxes:!0})}},jQuery(window).resize(function(){clearTimeout(window.coll_activity_stats_widget_resize_timer),window.coll_activity_stats_widget_resize_timer=setTimeout(window.resize_coll_activity_stat_widget,100)})),"undefined"!=typeof evo_item_tags_widget_config){window.add_quick_tag=function(e,t){var n=jQuery(t).text();jQuery("#item_tags_"+e).tokenInput("add",{id:n,name:n})},window.init_edit_item_tags_icon=function(e,t){jQuery("#evo_widget_item_tags_edit_icon_"+t).click(function(){return jQuery("#evo_widget_item_tags_edit_form_"+t).show(),jQuery("input#token-input-"+e,"#evo_widget_item_tags_edit_form_"+t).focus(),jQuery("#evo_widget_item_tags_list_"+t).hide(),!1})};var e=Object.values(evo_item_tags_widget_config);for(n=0;n<e.length;n++)o=e[n],window.init_edit_item_tags_icon(o.input_ID,o.widget_ID);delete e}var o;if("undefined"!=typeof evo_workflow_properties_widget_config&&jQuery("[id^=evo_widget_item_workflow_properties_] a").click(function(){var e=jQuery(this).closest("[id^=evo_widget_item_workflow_properties_]");return e.next("[id^=evo_widget_item_workflow_form_]").show(),e.hide(),!1}),"undefined"!=typeof evo_display_attachments_fieldset_config&&function(){for(var e=Object.values(evo_display_attachments_fieldset_config),t=0;t<e.length;t++)jQuery("#"+e[t].fieldset_prefix+e[t].form_id).show()}(),"undefined"!=typeof evo_tabs_ajax_load__click&&jQuery('[data-toggle="tabajax"]').click(function(e){var t=jQuery(this),n=t.attr("href"),o=t.attr("data-target");return t.closest("li").hasClass("active")||(jQuery.get(n,function(e){jQuery(o).html(e)}),t.tab("show")),!1}),"undefined"!=typeof evo_contact_list_view_config&&(window.get_selected_users=function(){var e="";return jQuery("input[name^=contacts]").each(function(){jQuery(this).is(":checked")&&(e+=jQuery(this).val()+",")}),0<e.length&&(e=e.substr(0,e.length-1)),e},jQuery("#send_selected_recipients").click(function(){var e="",t=window.get_selected_users();return 0<t.length&&(e="&recipients="+t),location.href=evo_contact_list_view_config.recipients_link_url+e,!1}),jQuery("#add_group_contacts").submit(function(){jQuery("input[name=users]").val(window.get_selected_users())})),"undefined"!=typeof evo_user_identity_form_config&&function(){var i=evo_user_identity_form_config;window.replace_form_params=function(e,t){return t=void 0===t?"":' id="'+t+'"',e.replace("#fieldstart#",i.fieldstart).replace("#fieldend#",i.fieldend).replace("#labelclass#",i.labelclass).replace("#labelstart#",i.labelstart).replace("#labelend#",i.labelend).replace("#inputstart#",i.inputstart).replace("#inputend#",i.inputend)},jQuery("#button_add_field").click(function(){var e=jQuery(this).prev().find("option:selected").val();if(""==e)return window.field_type_error(i.msg_select_field_type),!1;window.field_type_error_clear();var t=i.params;return jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_user_new_field&user_id="+i.user_ID+"&field_id="+e+t,success:function(e){if("[0]"==(e=ajax_debug_clear(e)))window.field_type_error(i.msg_field_already_added);else{if(e=window.replace_form_params(e),0==parseInt(e.replace(/^\[(\d+)\](.*)/,"$1"))){var t=parseInt(e.replace(/(.*)fieldset id="ffield_uf_add_(\d+)_(.*)/,"$2"));if(jQuery("#new_field_type option[value="+t+"]").remove(),0<jQuery("[id^=uf_new_"+t+"], [id^=uf_add_"+t+"]").length)return window.field_type_error(i.msg_field_already_added),!1}jQuery("#ffield_new_field_type").before(e.replace(/^\[\d+\](.*)/,"$1")),jQuery("span[rel^=add_ufdf_]").show(),bind_autocomplete(jQuery("#ffield_new_field_type").prev().prev().find("input[id^=uf_add_][autocomplete=on]"))}}}),!1}),jQuery(document).on("focus","[rel^=ufdf_]",function(){var e=parseInt(jQuery(this).attr("rel").replace(/^ufdf_(\d+)$/,"$1"));0<e&&(jQuery("#new_field_type").val(e),window.field_type_error_clear())}),jQuery("#new_field_type").change(function(){window.field_type_error_clear()}),window.field_type_error=function(e){jQuery("select#new_field_type").addClass("field_error");var t=jQuery("select#new_field_type").next().find("span.field_error");0<t.length?t.html(e):jQuery("select#new_field_type").next().append('<span class="field_error">'+e+"</span>")},window.field_type_error_clear=function(){jQuery("select#new_field_type").removeClass("field_error").next().find("span.field_error").remove()},jQuery("span[rel^=add_ufdf_]").show(),jQuery(document).on("click","span[rel^=add_ufdf_]",function(){var o=jQuery(this),e=o.attr("rel").replace(/^add_ufdf_(\d+)$/,"$1"),t=i.params;jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_user_new_field&user_id="+i.user_ID+"&field_id="+e+t,success:function(e){if("[0]"==(e=ajax_debug_clear(e)))window.field_type_error(i.msg_field_already_added);else{if(e=window.replace_form_params(e),0==parseInt(e.replace(/^\[(\d+)\](.*)/,"$1")))return window.field_type_error(i.msg_field_already_added),!1;var t=o.parent().parent().parent();t.after(e.replace(/^\[\d+\](.*)/,"$1")).next().find("span[rel^=add_ufdf_]").show();var n=t.next().find("input[id^=uf_add_]");"on"==n.attr("autocomplete")&&bind_autocomplete(n),n.focus()}}})}),jQuery(document).on("mouseover","span[rel^=add_ufdf_]",function(){jQuery(this).parent().prev().focus(),jQuery(this).css("z-index",jQuery(this).parent().prev().css("z-index"))}),jQuery(document).on("mouseout","span[rel^=add_ufdf_]",function(){var e=jQuery(this).parent().prev();if(e.is(":focus"))return!1;e.blur()});var n='[id^="ffield_organizations_"]',o=i.max_organizations,r=0;jQuery(document).on("click","span.add_org",function(){var t=jQuery(this),e=i.params;e+="undefined"!=typeof remove_obj_after_org_adding?"&first_org=1":"",jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_user_new_org"+e,success:function(e){e=window.replace_form_params(ajax_debug_clear(e),"ffield_organizations_"+r),t.closest(n).after(e),"undefined"!=typeof remove_obj_after_org_adding&&(remove_obj_after_org_adding.remove(),delete remove_obj_after_org_adding),jQuery(n).length>=o&&jQuery("span.add_org").hide(),1<jQuery(n).length?jQuery("span.remove_org").show():jQuery("span.remove_org").hide(),r++}})}),jQuery(document).on("click","span.remove_org",function(){1<jQuery(n).length?jQuery(this).closest(n).remove():(remove_obj_after_org_adding=jQuery(this).closest(n),jQuery(this).parent().find("span.add_org").click()),jQuery(n).length<o&&jQuery("span.add_org").show(),0<jQuery(n).length?jQuery("span.remove_org").show():jQuery("span.remove_org").hide()}),window.bind_autocomplete=function(e){0<e.length&&e.autocomplete({source:function(e,t){jQuery.getJSON(htsrv_url+"anon_async.php?action=get_user_field_autocomplete",{term:e.term,attr_id:this.element[0].getAttribute("id")},t)}})},bind_autocomplete(jQuery("input[id^=uf_][autocomplete=on]"))}(),"undefined"!=typeof evo_user_organization_config&&jQuery(document).on("click","span[rel^=org_status_]",function(){var t=jQuery(this),e=evo_user_organization_config.params;jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=change_user_org_status&status="+t.attr("rel")+"&crumb_userorg="+evo_user_organization_config.crumb_userorg+e,success:function(e){t.after(ajax_debug_clear(e)).remove()}})}),"undefined"!=typeof evo_item_type_change_buttons_config&&jQuery("button[data-item-type]").on("click",function(){jQuery("[required]").removeAttr("required"),jQuery("input[name=item_typ_ID]").val(jQuery(this).data("item-type")),jQuery(this).closest("form").append('<input type="hidden" name="action" value="'+evo_item_type_change_buttons_config.action+'">').submit()}),"undefined"!=typeof evo_status_dropdown_button_config){var i=Object.values(evo_status_dropdown_button_config);for(n=0;n<i.length;n++)!function(){var l=i[n];jQuery("."+l.type+"_status_dropdown li a").click(function(){var e=l.tooltip_titles_js_array,t=jQuery(this).parent(),n=t.attr("rel"),o=t.parent().parent(),i=o.parent().parent(),r=o.find("button"),a=r.parent().find("button:first"),s=i.find('input[type="submit"]:not(.quick-publish)').add(r);return"published"==n?i.find(".quick-publish").hide():i.find(".quick-publish").show(),s.each(function(){jQuery(this).attr("class",jQuery(this).attr("class").replace(/btn-status-[^\s]+/,"btn-status-"+n))}),a.find("span:first").html(t.find("span:last").html()),jQuery("input[type=hidden][name="+l.type+"_status]").val(n),o.removeClass("open"),"submit"==a.attr("type")&&a.click(),o.tooltip("hide").attr("data-original-title",e[n]).tooltip("show"),!1})}()}if("undefined"!=typeof evo_init_onchange_newcat&&jQuery("#new_category_name").keypress(function(){var e=jQuery("#sel_maincat_new");e.attr("checked")||(e.attr("checked",!0),jQuery("#sel_extracat_new").attr("checked",!0))}),"undefined"!=typeof evo_autocomplete_tags_config){window.init_autocomplete_tags=function(t,n){if(!n&&window.evo_autocomplete_input_tag_configs[t]&&(n=window.evo_autocomplete_input_tag_configs[t]),n){var e=jQuery(t).val(),o=new Array;if(e&&0<e.length){for(var i in e=e.split(","))o.push({id:e[i].trim(),name:e[i].trim()});n.token_input_params.prePopulate=o}n.update_by_ajax&&(n.token_input_params.onAdd=function(e){n.use_quick_tags&&window.evo_update_item_quick_tags(e),window.evo_update_item_tags_by_ajax(n.item_ID,t,e,"add")},n.token_input_params.onDelete=function(e){window.evo_update_item_tags_by_ajax(n.item_ID,t,e,"delete")}),jQuery(t).tokenInput(restapi_url+"tags",n.token_input_params)}},window.evo_update_item_quick_tags=function(e){var t=e.name.trim(),n=jQuery.cookie("quick_item_tags"),o=(n=null==n||0==n.length?[]:n.split(",")).indexOf(t);-1===o||n.splice(o,1),n.push(t),n=n.splice(-5),jQuery.cookie("quick_item_tags",n.join(","),{domain:evo_autocomplete_tags_config.cookie_domain,path:evo_autocomplete_tags_config.cookie_path})},window.evo_update_item_tags_by_ajax=function(e,t,n,o,i){var r=jQuery(".token-input-"+t.substr(1));r.removeClass("token-input-list-error").addClass("token-input-list-process"),jQuery.ajax({type:"POST",url:htsrv_url+"action.php",data:{mname:"collections",action:"update_tags",item_ID:e,item_tags:jQuery(t).val(),crumb_collections_update_tags:evo_autocomplete_tags_config.crumb_collections_update_tags},success:function(){r.removeClass("token-input-list-process")},error:function(){r.removeClass("token-input-list-process").addClass("token-input-list-error")}})},window.evo_autocomplete_input_tag_configs=window.evo_autocomplete_input_tag_configs||{};for(var r=Object.values(evo_autocomplete_input_tags_config),a=(n=0,r.length);n<a;n++)!function(){var e=r[n],t="#"+e.input_ID;window.evo_autocomplete_input_tag_configs[t]=e,0!=jQuery("#suggest_item_tags").length&&!jQuery("#suggest_item_tags").is(":checked")||window.init_autocomplete_tags(t,e),jQuery("#suggest_item_tags").click(function(){jQuery(this).is(":checked")?(jQuery(t).hide(),window.init_autocomplete_tags(t)):(jQuery(t).show(),jQuery(t).parent().find("ul.token-input-list-facebook").remove())}),evo_prevent_key_enter("#token-input-"+e.input_ID)}();delete r}"undefined"!=typeof evo_fieldset_folding_config&&(jQuery(document).on("click","span[id^=icon_folding_], span[id^=title_folding_]",function(){var e=jQuery(this).attr("id").match(/^icon_folding_/),t=jQuery(this).closest(".fieldset_wrapper"),n=e?jQuery(this).prev():jQuery(this).prev().prev();if(0==t.length||0==n.length)return!1;"1"==n.val()?(t.removeClass("folded"),n.val("0")):(t.addClass("folded"),n.val("1"));var o=e?jQuery(this):jQuery(this).prev();if(o.hasClass("fa")||o.hasClass("glyphicon")){if(""!=o.data("toggle")){var i=o.hasClass("fa")?"fa":"glyphicon";null==o.data("toggle-orig-class")&&o.data("toggle-orig-class",o.attr("class").replace(new RegExp("^"+i+" (.+)$","g"),"$1")),o.hasClass(o.data("toggle-orig-class"))?o.removeClass(o.data("toggle-orig-class")).addClass(i+"-"+o.data("toggle")):o.removeClass(i+"-"+o.data("toggle")).addClass(o.data("toggle-orig-class"))}}else{var r=o.css("background-position");o.css("background-position",o.data("xy")),o.data("xy",r)}var a=o.attr("title");o.attr("title",o.data("title")),o.data("title",a)}),jQuery("input[type=hidden][id^=folding_value_]").each(function(){var e=jQuery(this).closest(".fieldset_wrapper");"1"==jQuery(this).val()?e.addClass("folded"):e.removeClass("folded")}),jQuery(".field_error").closest(".fieldset_wrapper.folded").find("span[id^=icon_folding_]").click()),"undefined"!=typeof evo_init_item_list_clipboard_js&&(window.clipboard=new ClipboardJS("a.clipboard-copy")),"undefined"!=typeof evo_item_checklist_config&&(window.update_checklist_tab_badge=function(){var e=document.getElementById("checklist_counter"),t=document.querySelectorAll('.checklist_lines .checklist_line input[type="checkbox"]:not(:checked)').length;if(e)0<t?e.innerHTML=t:e.remove();else if(0<t){var n=document.querySelector('a[href="#checklist"][data-toggle="tab"]');n&&((e=document.createElement("span")).classList.add("badge","badge-important"),e.innerHTML=t,e.setAttribute("id","checklist_counter"),n.appendChild(document.createTextNode(" ")),n.appendChild(e))}},jQuery(".checklist_lines").on("click",'.checklist_line input[type="checkbox"]',window.update_checklist_tab_badge))}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_password_indicator_config){var u=evo_init_password_indicator_config;window.passcheck=function(){var e=jQuery("input#"+u.pass1_id);if(0!=e.length){u.field_width||(u.field_width=e.outerWidth());var t=jQuery("input#"+u.pass2_id);0!=t.length&&t.css("width",u.field_width-2+"px"),e.css("width",u.field_width-2+"px"),e.attr("onkeyup","return passinfo( this );"),e.parent().append('<div id="p-container"><div id="p-result"></div><div id="p-status"></div><div id="p-time"></div></div>'),jQuery("head").append("<style>#p-container { position: relative; margin-top: 4px; height:5px; border: 1px solid #CCC; font-size: 84%; line-height:normal; color: #999; background: #FFF } #p-result { height:5px } #p-status { position:absolute; width: 100px; top:-5px; left: "+(u.field_width+8)+"px } #p-time { position:absolute; width: 400px } </style>"),jQuery("#p-container").css("width",e.outerWidth()-2);var n=parseInt(e.css("margin-left"));0<n&&jQuery("#p-container").css("margin-left",n+"px")}},window.passinfo=function(e){var t=document.getElementById("p-result"),n=document.getElementById("p-status"),o=document.getElementById("p-time"),i="",r=document.getElementById(u.login_id);null!=r&&""!=r.value&&(i=r.value);var a="",s=document.getElementById(u.email_id);null!=s&&""!=s.value&&(a=s.value);var l=[i,a],d=zxcvbn(e.value,l.concat(u.blacklist)),_="red",c=u.msg_status_very_weak;switch(0==e.value.length?(t.style.display="none",n.style.display="none",o.style.display="none"):(t.style.display="block",n.style.display="block",o.style.display="block"),d.score){case 1:_="#F88158",c=u.msg_status_weak;break;case 2:_="#FBB917",c=u.msg_status_soso;break;case 3:_="#8BB381",c=u.msg_status_good;break;case 4:_="#59E817",c=u.msg_status_great}t.style.width=20*d.score+20+"%",t.style.background=_,u.disp_status&&(n.innerHTML=c),u.disp_time&&(document.getElementById("p-time").innerHTML=u.msg_est_crack_time+": "+d.crack_time_display)},function(){var e;e=function(){var e,t;return(t=document.createElement("script")).src=u.rsc_url+"js/zxcvbn.js",t.type="text/javascript",t.async=!0,(e=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,e)},null!=window.attachEvent?window.attachEvent("onload",e):window.addEventListener("load",e,!1)}.call(this),jQuery("input#"+u.pass1_id+", input#"+u.pass2_id).keyup(function(){var e=u.min_pwd_len,t=jQuery("input#"+u.pass1_id),n=jQuery("input#"+u.pass2_id),o=jQuery("#pass2_status"),i="",r=/^[^\<\&\>]+$/g;t.val().length&&null==t.val().match(r)||n.val().length&&null==n.val().match(r)?(i=u.msg_illegal_char,t[0].setCustomValidity(t.val().match(r)?"":i),n[0].setCustomValidity(n.val().match(r)?"":i),o.html(u.error_icon+" "+i)):0<t.val().length&&t.val().length<e||0<n.val().length&&n.val().length<e?(i=u.msg_min_pwd_len,t[0].setCustomValidity(t.val().length<e?i:""),n[0].setCustomValidity(n.val().length<e?i:""),o.html(u.error_icon+" "+i)):n.val()!=t.val()?(i=u.msg_pwd_not_matching,t[0].setCustomValidity(""),n[0].setCustomValidity(i),o.html(u.error_icon+" "+i)):(t[0].setCustomValidity(i),n[0].setCustomValidity(i),o.html(i))}),window.passcheck()}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_password_edit_config){var r=evo_init_password_edit_config;window.user_pass_clear_style=function(e){jQuery(e).each(function(){jQuery(this).parent().find("span.field_error span:visible").length?jQuery(this).addClass("field_error"):jQuery(this).removeClass("field_error")})},jQuery("#current_user_pass").keyup(function(){var e=jQuery(this).parent().find("span.field_error");e.length&&(""==jQuery(this).val()?e.show():e.hide()),user_pass_clear_style("#current_user_pass")}),jQuery("#edited_user_pass1, #edited_user_pass2").keyup(function(){var e=jQuery(this).parent().find(".pass_check_min");e.length&&(jQuery.trim(jQuery(this).val()).length>=r.user_minpwdlen?e.hide():e.show());var t=jQuery(".pass_check_diff");t.length&&jQuery("#edited_user_pass1").val()==jQuery(" #edited_user_pass2").val()&&t.hide();var n=jQuery(this).parent().find(".pass_check_new");n.length&&(""==jQuery(this).val()?n.show():n.hide());var o=jQuery(this).parent().find(".pass_check_twice");o.length&&(""==jQuery(this).val()?o.show():o.hide());var i=jQuery(this).parent().find(".pass_check_warning");jQuery.trim(jQuery(this).val())!=jQuery(this).val()?i.length||jQuery(this).parent().append('<span class="pass_check_warning notes field_error">'+r.msg_pwd_trim_warning+"</span>"):i.length&&i.remove(),user_pass_clear_style("#edited_user_pass1, #edited_user_pass2")})}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_login_validator_config){var e=evo_init_login_validator_config,n=e.login_icon_load,o=(e.login_icon_available,e.login_icon_exists),i=e.login_icon_error,r=e.login_text_empty,a=(e.login_text_available,e.login_text_exists),s=jQuery("#register_form input#"+e.login_id);s.change(function(){var t=jQuery("#login_status_msg");""==jQuery(this).val()?(jQuery("#login_status").html(""),t.html(r).attr("class","notes")):(jQuery("#login_status").html(n),jQuery.ajax({type:"POST",url:e.login_htsrv_url+"anon_async.php",data:"action=validate_login&login="+jQuery(this).val(),success:function(e){"exists"==(e=ajax_debug_clear(e))?(jQuery("#login_status").html(""),t.html(o+" "+a).attr("class","red"),s[0].setCustomValidity(a)):"available"==e?(jQuery("#login_status").html(""),t.html(""),s[0].setCustomValidity("")):(jQuery("#login_status").html(""),t.html(i.replace("$error_msg$",e.replace(/(<([^>]+)>)/gi,""))+" "+e).attr("class","red"),s[0].setCustomValidity(e.replace(/(<([^>]+)>)/gi,"")))}}))})}}),jQuery(document).ready(function(){"undefined"!=typeof evo_skin_bootstrap_forums__post_list_header&&jQuery("#evo_workflow_status_filter").change(function(){var e=location.href.replace(/([\?&])((status|redir)=[^&]*(&|$))+/,"$1"),t=jQuery(this).val();""!==t&&(e+=(-1==e.indexOf("?")?"?":"&")+"status="+t+"&redir=no"),location.href=e.replace("?&","?").replace(/\?$/,"")})}),jQuery(document).ready(function(){"undefined"!=typeof evo_autocomplete_login_config&&(jQuery("input.autocomplete_login").on("added",function(){jQuery("input.autocomplete_login").each(function(){if(!jQuery(this).hasClass("tt-input")&&!jQuery(this).hasClass("tt-hint")){var t="";t=jQuery(this).hasClass("only_assignees")?restapi_url+evo_autocomplete_login_config.url:restapi_url+"users/logins",jQuery(this).data("status")&&(t+="&status="+jQuery(this).data("status")),jQuery(this).typeahead(null,{displayKey:"login",source:function(e,o){jQuery.ajax({type:"GET",dataType:"JSON",url:t,data:{q:e},success:function(e){var t=new Array;for(var n in e.list)t.push({login:e.list[n]});o(t)}})}})}})}),jQuery("input.autocomplete_login").trigger("added"),evo_prevent_key_enter(evo_autocomplete_login_config.selector))}),jQuery(document).ready(function(){"undefined"!=typeof evo_widget_poll_initialize&&(jQuery('.evo_poll__selector input[type="checkbox"]').on("click",function(){var e=jQuery(this).closest(".evo_poll__table"),t=jQuery(".evo_poll__selector input:checked",e).length>=e.data("max-answers");jQuery(".evo_poll__selector input[type=checkbox]:not(:checked)",e).prop("disabled",t)}),jQuery(".evo_poll__table").each(function(){var e=jQuery(this);e.width()>e.parent().width()&&(jQuery(".evo_poll__title",e).css("white-space","normal"),jQuery(".evo_poll__title label",e).css({width:Math.floor(e.parent().width()/2)+"px","word-wrap":"break-word"}))}))}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_checklist_lines_config){var d=evo_init_checklist_lines_config;window.toggle_add_checklist_line_input=function(e,t){var n=jQuery(".add_checklist_line_input",e),o=jQuery(".checklist_add_btn"),i=jQuery(".checklist_close_btn");null==t&&(t=0===jQuery(".add_checklist_line_input",e).is(":visible").length),1==t?(o.html(d.button_label_add),n.show(),i.show(),n.focus()):0==t&&(o.html(d.button_label_add_an_item),n.hide(),i.hide())},window.update_checklist_line=function(r,e){jQuery.ajax({type:"POST",url:htsrv_url+"action.php",data:{mname:"collections",action:"checklist_line",item_ID:d.item_ID,check_ID:e,check_label:r.val(),check_checked:r.checked,crumb_collections_checklist_line:d.crumb_checklist_line},dataType:"json",success:function(e){if("add"==e.status){var t=r.closest("div.checklist_wrapper"),n=jQuery(".checklist_lines",t),o=d.checklist_line_template;if(o=(o=o.replace(/\$checklist_line_ID\$/g,e.check_ID)).replace(/\$checklist_line_label\$/g,e.check_label),o=jQuery(o),n.append(o),window.dragndrop_checklist_lines(o),r.hasClass("add_checklist_line_input")){r.val("");var i=r.get(0);i.setAttribute("style","height:"+i.scrollHeight+"px;overflow-y:hidden;"),i.style.height="auto",i.style.height=i.scrollHeight+"px",r.focus()}}else"update"==e.status&&r.closest(".checklist_line_label").html(e.check_label)},error:function(){console.error("Add/update checklist line request error.")}})},window.toggle_checklist_line=function(e,t){jQuery.ajax({type:"POST",url:htsrv_url+"action.php",data:{mname:"collections",action:"checklist_line",item_action:"toggle_check",item_ID:d.item_ID,check_ID:t,check_checked:jQuery(e).is(":checked"),crumb_collections_checklist_line:d.crumb_checklist_line},dataType:"json",success:function(e){},error:function(){console.error("Add/update checklist line request error.")}})},window.delete_checklist_line=function(t,e){jQuery.ajax({type:"POST",url:htsrv_url+"action.php",data:{mname:"collections",action:"checklist_line",item_action:"delete",item_ID:d.item_ID,check_ID:e,crumb_collections_checklist_line:d.crumb_checklist_line},dataType:"json",success:function(e){"delete"==e.status&&jQuery(t).closest(".checklist_line").remove()},error:function(){console.error("Delete checklist line request error.")}})},window.reorder_checklist_lines=function(e){var n=[];jQuery(".checklist_line",e).each(function(e,t){n.push(jQuery("input",t).val())}),jQuery.ajax({type:"POST",url:htsrv_url+"action.php",data:{mname:"collections",action:"checklist_line",item_action:"reorder",item_ID:d.item_ID,item_order:n,crumb_collections_checklist_line:d.crumb_checklist_line},dataType:"json",success:function(e){},error:function(){console.error("Delete checklist line request error.")}})},window.dragndrop_checklist_lines=function(e){jQuery(e).draggable({axis:"y",helper:"original",scroll:!0,scrollSensitivity:100,zIndex:999,opacity:.8,cursor:"move",cancel:"input,textarea,button,select,option,a",stop:function(){jQuery(this).removeAttr("style")}}).addClass("draggable_checklist_line"),jQuery(e).droppable({accept:".draggable_checklist_line",hoverClass:"droppable-hover",greedy:!0,tolerance:"pointer",delay:1e3,drop:function(e,t){var n=jQuery(this).closest(".checklist_lines");jQuery(this).after(t.draggable),window.reorder_checklist_lines(n)}})},jQuery(".checklist_add_btn").on("click",function(){var e=jQuery(this).closest("div.checklist_wrapper"),t=jQuery("textarea.add_checklist_line_input",e);t.is(":visible")?window.update_checklist_line(t):window.toggle_add_checklist_line_input(e,!0)}),jQuery(".checklist_close_btn").on("click",function(){var e=jQuery(this).closest("div.checklist_wrapper");window.toggle_add_checklist_line_input(e,!1)}),jQuery(document).on("click",".checklist_lines label .checklist_line_label",function(e){var t=jQuery(this),n=t.html(),o=t.closest(".checklist_line"),i=jQuery('input[type="checkbox"]',o),r=o.closest("div.checklist_wrapper");if(e.preventDefault(),0===t.has("textarea.checklist_line_input").length){window.toggle_add_checklist_line_input(r,!1);var a=jQuery(d.checklist_line_input_template),s=jQuery("textarea.checklist_line_input",a);s.attr("id","checklist_line_input_"+i.val()),s.attr("name","checklist_line_input_"+i.val()),s.val(n),s.data("checkId",i.val()),s.data("content",n),t.html(s);var l=s.get(0);l.setAttribute("style","height:"+l.scrollHeight+"px;overflow-y:hidden;"),l.style.height="auto",l.style.height=l.scrollHeight+"px",s.focus()}}),jQuery(document).on("blur",".checklist_lines .checklist_line_label .checklist_line_input",function(e){var t=jQuery(this),n=t.data("content"),o=t.closest(".checklist_line_label");setTimeout(function(){o.html(n)},10)}),jQuery(document).on("keypress",".checklist_line_input",function(e){var t=jQuery(this);13==e.keyCode&&(e.preventDefault(),t.val().length&&window.update_checklist_line(t,t.data("checkId")))}),jQuery(document).on("change",'.checklist_lines .checklist_line input[type="checkbox"]',function(e){var t=jQuery(this);window.toggle_checklist_line(t,t.val())}),jQuery(document).on("click",".checklist_lines .checklist_line .checklist_line_delete",function(e){var t=jQuery(this),n=t.closest(".checklist_line"),o=jQuery('input[type="checkbox"]',n),i=n.closest("div.checklist_wrapper");return window.toggle_add_checklist_line_input(i,!1),window.delete_checklist_line(t,o.val()),!1}),jQuery(document).on("input","textarea.checklist_line_input",function(e){this.style.height="auto",this.style.height=this.scrollHeight+"px"}),window.dragndrop_checklist_lines(".checklist_lines .checklist_line, .checklist_droparea")}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_plugin_auto_anchors_settings){jQuery("h1, h2, h3, h4, h5, h6").each(function(){if(jQuery(this).attr("id")&&jQuery(this).hasClass("evo_auto_anchor_header")){var e=location.href.replace(/#.+$/,"")+"#"+jQuery(this).attr("id");jQuery(this).append(' <a href="'+e+'" class="evo_auto_anchor_link" style="visibility:hidden"><span class="fa fa-link"></span></a>')}});var t=jQuery("#evo_toolbar").length?jQuery("#evo_toolbar").height():0;jQuery(".evo_auto_anchor_link").on("click",function(){var e=jQuery(this).attr("href");return jQuery("html,body").animate({scrollTop:jQuery(this).offset().top-t-evo_plugin_auto_anchors_settings.offset_scroll},function(){window.history.pushState("","",e)}),!1})}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_custom_tags_toolbar_config)for(var e=Object.values(evo_init_custom_tags_toolbar_config),t=0;t<e.length;t++){var r=e[t];!function(){var i=r.js_prefix+r.plugin_code+"_";window[i+"tagButtons"]=new Array,window[i+"tagOpenTags"]=new Array,window[i+"tagButton"]=function(e,t,n,o,i,r,a,s){this.id=e,this.display=t,this.style=n,this.tagStart=o,this.tagEnd=i,this.access=r,this.title=a,this.open=s};for(var e=Object.values(r.tag_buttons),n=0,o=e.length;n<o;n++)window[i+"tagButtons"][window[i+"tagButtons"].length]=new window[i+"tagButton"]("tag_"+e[n].title,e[n].name,"",e[n].start,e[n].end,"",e[n].title);window[i+"tagGetButton"]=function(e,t){return'<input type="button" id="'+e.id+'" accesskey="'+e.access+'" title="'+e.title+'" style="'+e.style+'" class="'+r.toolbar_button_class+'" data-func="'+i+"tagInsertTag|"+r.js_prefix+"b2evoCanvas|"+t+'" value="'+e.display+'" />'},window[i+"tagAddTag"]=function(e){""!=window[i+"tagButtons"][e].tagEnd&&(window[i+"tagOpenTags"][window[i+"tagOpenTags"].length]=e,document.getElementById(window[i+"tagButtons"][e].id).style.fontWeight="bold")},window[i+"tagRemoveTag"]=function(e){for(n=0,o=window[i+"tagOpenTags"].length;n<o;n++)window[i+"tagOpenTags"][n]==e&&(window[i+"tagOpenTags"].splice(n,1),document.getElementById(window[i+"tagButtons"][e].id).style.fontWeight="normal")},window[i+"tagCheckOpenTags"]=function(e){var t=0;for(n=0,o=window[i+"tagOpenTags"].length;n<o;n++)window[i+"tagOpenTags"][n]==e&&t++;return 0<t},window[i+"tagCloseAllTags"]=function(){var e=window[i+"tagOpenTags"].length;for(n=0;n<e;n++)window[i+"tagInsertTag"](window[r.js_prefix+"b2evoCanvas"],window[i+"tagOpenTags"][window[i+"tagOpenTags"].length-1])},window[i+"tagToolbar"]=function(){var e=r.toolbar_title_before+r.toolbar_label+" "+r.toolbar_title_after;e+=r.toolbar_group_before;for(var t=0,n=window[i+"tagButtons"].length;t<n;t++)e+=window[i+"tagGetButton"](window[i+"tagButtons"][t],t);e+=r.toolbar_group_after+r.toolbar_group_before,e+='<input type="button" id="tag_close" class="'+r.toolbar_button_class+'" data-func="'+i+'tagCloseAllTags" title="'+r.btn_title_close_all_tags+'" value="X" />',e+=r.toolbar_group_after,jQuery("."+i+"toolbar").html(e)},window[i+"tagInsertTag"]=function(e,t){var n=b2evo_Callbacks.trigger_callback("get_selected_text_for_"+e.id),o=!1;null!=n&&0!=n||(document.selection?(e.focus(),n=document.selection.createRange().text,o=!0):!e.selectionStart&&"0"!=e.selectionStart||(n=e.selectionStart!=e.selectionEnd)),n?textarea_wrap_selection(e,window[i+"tagButtons"][t].tagStart,window[i+"tagButtons"][t].tagEnd,0):window[i+"tagCheckOpenTags"](t)&&""!=window[i+"tagButtons"][t].tagEnd?(textarea_wrap_selection(e,"",window[i+"tagButtons"][t].tagEnd,0),window[i+"tagRemoveTag"](t)):(textarea_wrap_selection(e,window[i+"tagButtons"][t].tagStart,"",0),window[i+"tagAddTag"](t)),o&&e.focus()},window[i+"tagToolbar"]()}()}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_plugin_table_contents_settings){var n=jQuery("#evo_toolbar").length?jQuery("#evo_toolbar").height():0;jQuery(".evo_plugin__table_of_contents a").on("click",function(){var e=jQuery("#"+jQuery(this).data("anchor"));if(0==e.length||!e.prop("tagName").match(/^h[1-6]$/i))return!0;var t=jQuery(this).attr("href");return jQuery("html,body").animate({scrollTop:e.offset().top-n-evo_plugin_table_contents_settings.offset_scroll},function(){window.history.pushState("","",t)}),!1})}}),jQuery(document).ready(function(){if(window.evo_init_shortlinks_toolbar=function(n){window.shortlinks_toolbar=function(e){var t=n.toolbar_title_before+e+n.toolbar_title_after+n.toolbar_group_before+'<input type="button" title="'+n.button_title+'" class="'+n.button_class+'" data-func="shortlinks_load_window|'+n.js_prefix+'" value="'+n.button_value+'" />'+n.toolbar_group_after;jQuery("."+n.js_prefix+n.plugin_code+"_toolbar").html(t)},window.shortlinks_toolbar(n.toolbar_title)},"undefined"!=typeof evo_init_shortlinks_toolbar_config){for(var e=Object.values(evo_init_shortlinks_toolbar_config),t=0;t<e.length;t++)window.evo_init_shortlinks_toolbar(e[t]);delete e}}),jQuery(document).ready(function(){if(window.evo_init_inlines_toolbar=function(r){var o=r.target_ID,i=r.temp_ID,a=r.target_type,s=new Array;window.inline_button=function(e,t,n,o,i){this.id=e,this.text=t,this.type=n,this.title=o,this.style=i},s[s.length]=new window.inline_button("inline_image","image","image",r.button_title,""),window.inline_toolbar=function(e,t){for(var n=r.toolbar_title_before+e+r.toolbar_title_after+r.toolbar_group_before,o=0;o<s.length;o++){var i=s[o];n+='<input type="button" id="'+i.id+'" title="'+i.title+'"'+(void 0!==i.style?' style="'+i.style+'"':"")+' class="'+r.button_class+'" data-func="insert_inline|'+i.type+'" value="'+i.text+'" />'}n+=r.toolbar_group_after,jQuery("."+t+r.plugin_code+"_toolbar").html(n)},window.insert_inline=function(){switch(a){case"Item":if(!o&&!i)return alert(evo_js_lang_alert_before_insert_item),!1;break;case"Comment":if(!o)return alert(evo_js_lang_alert_before_insert_comment),!1;break;case"EmailCampaign":if(!o)return alert(evo_js_lang_alert_before_insert_emailcampaign),!1;break;case"Message":if(!o&&!i)return alert(evo_js_lang_alert_before_insert_message),!1}"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.activeEditor&&tinyMCE.activeEditor?(tinyMCE.execCommand("mceFocus",!1,tinyMCE.activeEditor.id),tinyMCE.execCommand("evo_view_edit_inline",!1,tinyMCE.activeEditor.id)):(openModalWindow('<span class="loader_img loader_user_report absolute_center" title="'+evo_js_lang_loading+'..."></span>',"80%","",!0,evo_js_lang_select_image_insert,"",!0),jQuery.ajax({type:"POST",url:r.insert_inline_url,success:function(e){var t,n;n=null==i?(t=a,o):(t="temporary",i),openModalWindow(e,"90%","80%",!0,"Select image","","","","","",function(){evo_link_refresh_list(t,n,"refresh"),evo_link_fix_wrapper_height()})}}))},window.inline_toolbar(r.toolbar_title,r.prefix)},"undefined"!=typeof evo_init_inlines_toolbar_config){for(var e=Object.values(evo_init_inlines_toolbar_config),t=0;t<e.length;t++)window.evo_init_inlines_toolbar(e[t]);delete e}}),jQuery(document).ready(function(){if(window.evo_init_markdown_toolbar=function(i){window[i.js_prefix+"markdown_btns"]=new Array,window[i.js_prefix+"markdown_open_tags"]=new Array,window.markdown_btn=function(e,t,n,o,i,r,a,s){this.id=e,this.text=t,this.title=n,this.tag_start=o,this.tag_end=i,this.style=r,this.open=a,this.grp_pos=s},i.enable_text_styles&&(window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_bold","bold",i.btn_title_bold,"**","**","font-weight:bold"),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_italic","italic",i.btn_title_italic,"*","*","font-style:italic",-1,"last")),i.enable_links&&(window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_link","link",i.btn_title_link,"","","text-decoration:underline",-1,i.enable_images?void 0:"last")),i.enable_images&&(window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_img","img",i.btn_title_image,"","","",-1,"last")),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h1","H1",i.btn_title_h1,"\n# ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h2","H2",i.btn_title_h2,"\n## ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h3","H3",i.btn_title_h3,"\n### ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h4","H4",i.btn_title_h4,"\n#### ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h5","H5",i.btn_title_h5,"\n##### ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_h6","H6",i.btn_title_h6,"\n###### ","","",-1,"last"),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_li","li",i.btn_title_li,"\n* ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_ol","ol",i.btn_title_ol,"\n1. ","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_blockquote","blockquote",i.btn_title_blockquote,"\n> ","","",-1,"last"),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_codespan","codespan",i.btn_title_codespan,"`","`","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_preblock","preblock",i.btn_title_preblock,"\n\t","","",-1,"last"),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_codeblock","codeblock",i.btn_title_codeblock,"\n```\n","\n```\n","",-1,"last"),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_hr","hr",i.btn_title_hr,"\n---\n","","",-1),window[i.js_prefix+"markdown_btns"][window[i.js_prefix+"markdown_btns"].length]=new markdown_btn(i.js_prefix+"mrkdwn_br","<br>",i.btn_title_br,"  \n","","",-1),window[i.js_prefix+"markdown_get_btn"]=function(e,t){var n="";return e.id==window[i.js_prefix+"mrkdwn_img"]?n+='<input type="button" id="'+e.id+'" accesskey="'+e.access+'" title="'+e.title+'" style="'+e.style+'" class="'+i.toolbar_button_class+'" data-func="'+i.js_prefix+"markdown_insert_lnkimg|"+i.js_prefix+'b2evoCanvas|img" value="'+e.text+'" />':e.id==i.js_prefix+"mrkdwn_link"?n+='<input type="button" id="'+e.id+'" accesskey="'+e.access+'" title="'+e.title+'" style="'+e.style+'" class="'+i.toolbar_button_class+'" data-func="'+i.js_prefix+"markdown_insert_lnkimg|"+i.js_prefix+'b2evoCanvas" value="'+e.text+'" />':n+='<input type="button" id="'+e.id+'" accesskey="'+e.access+'" title="'+e.title+'" style="'+e.style+'" class="'+i.toolbar_button_class+'" data-func="'+i.js_prefix+"markdown_insert_tag|"+i.js_prefix+"b2evoCanvas|"+t+'" value="'+e.text+'" />',n},window[i.js_prefix+"markdown_add_tag"]=function(e){""!=window[i.js_prefix+"markdown_btns"][e].tag_end&&(window[i.js_prefix+"markdown_open_tags"][window[i.js_prefix+"markdown_open_tags"].length]=e,document.getElementById(window[i.js_prefix+"markdown_btns"][e].id).value="/"+document.getElementById(window[i.js_prefix+"markdown_btns"][e].id).value)},window[i.js_prefix+"markdown_remove_tag"]=function(e){for(n=0;n<window[i.js_prefix+"markdown_open_tags"].length;n++)window[i.js_prefix+"markdown_open_tags"][n]==e&&(window[i.js_prefix+"markdown_open_tags"].splice(n,1),document.getElementById(window[i.js_prefix+"markdown_btns"][e].id).value=document.getElementById(window[i.js_prefix+"markdown_btns"][e].id).value.replace("/",""))},window[i.js_prefix+"markdown_check_open_tags"]=function(e){var t=0;for(n=0;n<window[i.js_prefix+"markdown_open_tags"].length;n++)window[i.js_prefix+"markdown_open_tags"][n]==e&&t++;return 0<t},window[i.js_prefix+"markdown_close_all_tags"]=function(){for(var e=window[i.js_prefix+"markdown_open_tags"].length,t=0;t<e;t++)window[i.js_prefix+"markdown_insert_tag"](window[i.js_prefix+"b2evoCanvas"],window[i.js_prefix+"markdown_open_tags"][window[i.js_prefix+"markdown_open_tags"].length-1])},window[i.js_prefix+"markdown_toolbar"]=function(e){for(var t=i.toolbar_title_before+e+i.toolbar_title_after+i.toolbar_group_before,n=0;n<window[i.js_prefix+"markdown_btns"].length;n++)t+=window[i.js_prefix+"markdown_get_btn"](window[i.js_prefix+"markdown_btns"][n],n),"last"==window[i.js_prefix+"markdown_btns"][n].grp_pos&&0<n&&n<window[i.js_prefix+"markdown_btns"].length-1&&(t+=i.toolbar_group_after+i.toolbar_group_before);t+=i.toolbar_group_after+i.toolbar_group_before+'<input type="button" id="'+i.js_prefix+'mrkdwn_close" class="'+i.toolbar_button_class+'" data-func="'+i.js_prefix+'markdown_close_all_tags" title="'+i.btn_title_close_all_tags+'" value="X" />'+i.toolbar_group_after,jQuery("."+i.js_prefix+i.plugin_code+"_toolbar").html(t)},window[i.js_prefix+"markdown_insert_tag"]=function(e,t){var n=b2evo_Callbacks.trigger_callback("get_selected_text_for_"+e.id),o=!1;null==n&&(document.selection?(e.focus(),n=document.selection.createRange().text,o=!0):!e.selectionStart&&"0"!=e.selectionStart||(n=e.selectionStart!=e.selectionEnd)),n?textarea_wrap_selection(e,window[i.js_prefix+"markdown_btns"][t].tag_start,window[i.js_prefix+"markdown_btns"][t].tag_end,0):window[i.js_prefix+"markdown_check_open_tags"](t)&&""!=window[i.js_prefix+"markdown_btns"][t].tag_end?(textarea_wrap_selection(e,"",window[i.js_prefix+"markdown_btns"][t].tag_end,0),window[i.js_prefix+"markdown_remove_tag"](t)):(textarea_wrap_selection(e,window[i.js_prefix+"markdown_btns"][t].tag_start,"",0),window[i.js_prefix+"markdown_add_tag"](t)),o&&e.focus()},window[i.js_prefix+"markdown_insert_lnkimg"]=function(e,t){var n=prompt(i.prompt_url+":","http://");if(n){n="["+prompt(i.prompt_text+":","")+"]("+n;var o=prompt(i.prompt_title+":","");""!=o&&(n+=' "'+o+'"'),n+=")",void 0!==t&&"img"==t&&(n="!"+n),textarea_wrap_selection(e,n,"",1)}},window[i.js_prefix+"markdown_toolbar"](i.toolbar_title+": ")},"undefined"!=typeof evo_init_markdown_toolbar_config){for(var e=Object.values(evo_init_markdown_toolbar_config),n=0;n<e.length;n++)window.evo_init_markdown_toolbar(e[n]);delete e}}),jQuery(document).ready(function(){if(window.evo_init_polls_toolbar=function(o){window.polls_toolbar=function(e,t){var n=o.toolbar_title_before+e+o.toolbar_title_after+o.toolbar_group_before+'<input type="button" title="'+o.button_title+'" class="'+o.button_class+'" data-func="polls_load_window|'+t+'" value="'+o.button_value+'" />'+o.toolbar_group_after;jQuery("."+t+o.plugin_code+"_toolbar").html(n)},window.polls_load_window=function(e){return openModalWindow('<div id="poll_wrapper"></div>',"auto","",!0,o.modal_window_title,["Insert Poll"],!0),polls_load_polls(e),!1},window.polls_api_request=function(e,t,n){jQuery.ajax({url:restapi_url+e}).then(n,function(e){polls_api_print_error(t,e)})},window.polls_api_print_error=function(e,t){if("string"!=typeof t&&void 0===t.code&&(t=void 0===t.responseJSON?t.statusText:t.responseJSON),void 0===t.code)var n='<h4 class="text-danger">Unknown error: '+t+"</h4>";else n='<h4 class="text-danger">'+t.message+"</h4>",o.debug&&(n+="<div><b>Code:</b> "+t.code+"</div><div><b>Status:</b> "+t.data.status+"</div>");jQuery(e).html(n)},window.polls_load_polls=function(i){i=i||"",polls_api_request("polls","#poll_wrapper",function(e){var t='<div id="'+i+'polls_list">';for(var n in t+="<ul>",e.polls){var o=e.polls[n];t+='<li><a href="#" data-poll-id="'+o.pqst_ID+'" data-prefix="'+i+'">'+o.pqst_question_text+"</a></li>"}t+="</ul>",t+="</div>",jQuery("#poll_wrapper").html(t),jQuery(document).on("click","#"+i+"polls_list a[data-poll-id]",function(){"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.activeEditor&&tinyMCE.activeEditor&&tinyMCE.execCommand("mceFocus",!1,tinyMCE.activeEditor.id);var e=jQuery(this).data("prefix")?jQuery(this).data("prefix"):"";return textarea_wrap_selection(window[e+"b2evoCanvas"],"[poll:"+jQuery(this).data("pollId")+"]","",0),closeModalWindow(),!1})})},window.polls_toolbar(o.toolbar_title,o.prefix)},"undefined"!=typeof evo_init_polls_toolbar_config){for(var e=Object.values(evo_init_polls_toolbar_config),t=0;t<e.length;t++)window.evo_init_polls_toolbar(e[t]);delete e}}),jQuery(document).ready(function(){if(window.evo_init_shortcodes_toolbar=function(r){window[r.js_prefix+"shortcodes_buttons"]=new Array,window.shortcodes_button=function(e,t,n,o,i){this.id=e,this.text=t,this.tag=n,this.title=o,this.style=i},window[r.js_prefix+"shortcodes_buttons"][window[r.js_prefix+"shortcodes_buttons"].length]=new shortcodes_button("shortcodes_teaserbreak","[teaserbreak]","[teaserbreak]",r.btn_title_teaserbreak,""),window[r.js_prefix+"shortcodes_buttons"][window[r.js_prefix+"shortcodes_buttons"].length]=new shortcodes_button("shortcodes_pagebreak","[pagebreak]","[pagebreak]",r.btn_title_pagebreak,""),window[r.js_prefix+"shortcodes_toolbar"]=function(e){for(var t=r.toolbar_title_before+e+r.toolbar_title_after+r.toolbar_group_before,n=0,o=window[r.js_prefix+"shortcodes_buttons"].length;n<o;n++){var i=window[r.js_prefix+"shortcodes_buttons"][n];t+='<input type="button" id="'+i.id+'" title="'+i.title+'"'+(void 0!==i.style?' style="'+i.style+'"':"")+' class="'+r.toolbar_button_class+'" data-func="'+r.js_prefix+"shortcodes_insert_tag|"+r.js_prefix+"b2evoCanvas|"+n+'" value="'+i.text+'" />'}t+=r.toolbar_group_after,jQuery("."+r.js_prefix+r.plugin_code+"_toolbar").html(t)},window[r.js_prefix+"shortcodes_insert_tag"]=function(e,t){"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.activeEditor&&tinyMCE.activeEditor&&tinyMCE.execCommand("mceFocus",!1,tinyMCE.activeEditor.id),textarea_wrap_selection(e,window[r.js_prefix+"shortcodes_buttons"][t].tag,"",0)},window[r.js_prefix+"shortcodes_toolbar"](r.toolbar_title+": ")},"undefined"!=typeof evo_init_shortcodes_toolbar_config){for(var e=Object.values(evo_init_shortcodes_toolbar_config),t=0;t<e.length;t++)window.evo_init_shortcodes_toolbar(e[t]);delete e}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_widescroll_toolbar_config)for(var e=Object.values(evo_init_widescroll_toolbar_config),t=0;t<e.length;t++){var r=e[t];window[r.js_prefix+"widescroll_buttons"]=new Array,window[r.js_prefix+"widescroll_buttons"][window[r.js_prefix+"widescroll_buttons"].length]=new function(e,t,n,o,i,r){this.id="widescroll",this.text="wide scroll",this.tag_open='<div class="wide_scroll">',this.tag_close="</div>",this.title=i,this.style=""}("widescroll","wide scroll",'<div class="wide_scroll">',"</div>",r.btn_title_teaserbreak,""),window[r.js_prefix+"widescroll_toolbar"]=function(e){for(var t=r.toolbar_title_before+e+r.toolbar_title_after+r.toolbar_group_before,n=0,o=window[r.js_prefix+"widescroll_buttons"].length;n<o;n++){var i=window[r.js_prefix+"widescroll_buttons"][n];t+='<input type="button" id="'+i.id+'" title="'+i.title+'"'+(void 0!==i.style?' style="'+i.style+'"':"")+' class="'+r.toolbar_button_class+'" data-func="'+r.js_prefix+"widescroll_insert_tag|"+r.js_prefix+"b2evoCanvas|"+n+'" value="'+i.text+'" />'}t+=r.toolbar_group_after,jQuery("."+r.js_prefix+r.plugin_code+"_toolbar").html(t)},window[r.js_prefix+"widescroll_insert_tag"]=function(e,t){"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.activeEditor&&tinyMCE.activeEditor&&tinyMCE.execCommand("mceFocus",!1,tinyMCE.activeEditor.id),textarea_wrap_selection(e,window[r.js_prefix+"widescroll_buttons"][t].tag_open,window[r.js_prefix+"widescroll_buttons"][t].tag_close,0)},window[r.js_prefix+"widescroll_toolbar"](r.toolbar_title+": ")}}),jQuery(document).ready(function(){"undefined"!=typeof evo_plugin_videoplug_config&&(jQuery(evo_plugin_videoplug_config.youtube_lazyload_selector).each(function(){var e=jQuery(this),t=new Image;t.src="https://img.youtube.com/vi/"+e.data("embed")+"/sddefault.jpg",t.addEventListener("load",function(){e.append(t)})}),jQuery(evo_plugin_videoplug_config.youtube_lazyload_selector).click(function(){var e=document.createElement("iframe");e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",""),e.setAttribute("allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("src","https://www.youtube.com/embed/"+jQuery(this).data("embed")+"?rel=0&showinfo=0&autoplay=1"),jQuery(this).html(e)}))}),jQuery(document).ready(function(){if("undefined"!=typeof evo_init_editable_column_config)for(var keys=Object.keys(evo_init_editable_column_config),i=0;i<keys.length;i++)!function(){var config=evo_init_editable_column_config[keys[i]];0<jQuery(config.column_selector).length&&jQuery(config.column_selector).editable(config.ajax_url,{data:function(value,settings){if(value=ajax_debug_clear(value),"select"==config.field_type){var result=value.match(/rel="([^"]*)"/);return config.options_eval?eval(config.options_eval):config.options instanceof Object?jQuery.extend({},config.options,{selected:result[1]}):config.options}var result=value.match(/>\s*([^<]+)\s*</);return result[1]==config.null_text?"":result[1]},type:config.field_type,class_name:config.field_class,name:config.new_field_name,tooltip:config.tooltip,event:"click",onblur:"text"==config.field_type?"submit":"cancel",onedit:function(e,t){var n=jQuery(t).width();jQuery(t).css({width:n,"max-width":n})},callback:function(settings,original){if(config.colored_cells){jQuery(this).html(ajax_debug_clear(settings));var link=jQuery(this).find("a");jQuery(this).css("background-color","none"==link.attr("color")?"transparent":link.attr("color")),link.removeAttr("color")}else"function"==typeof evoFadeSuccess&&evoFadeSuccess(this);config.callback_code&&eval(config.callback_code)},submitdata:function(value,settings){var return_obj={};return return_obj[config.ID_name]=eval(config.ID_value),return_obj},onerror:function(e,t,n){"function"==typeof evoFadeFailure&&evoFadeFailure(t);var o=jQuery(t).find("input");0<o.length&&(jQuery(t).find("span.field_error").remove(),o.addClass("field_error"),void 0!==n.responseText&&o.after('<span class="note field_error">'+n.responseText+"</span>"))}})}()}),jQuery(document).ready(function(){if("undefined"!=typeof evo_regional_config){window.check_regional_required_fields=function(e){jQuery("#"+e+"_rgn_ID, #"+e+"_subrg_ID, #"+e+"_city_ID").each(function(){void 0!==jQuery(this).attr("required")||!0===jQuery(this).data("required")?(1<jQuery(this).find("option").length?jQuery(this).attr("required","required"):jQuery(this).removeAttr("required"),jQuery(this).data("required",!0)):jQuery(this).data("required",!1)})},window.load_regions=function(e,t,n){jQuery("#"+n+"_rgn_ID").next().find("button").hide().next().show(),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_regions_option_list&page=edit&mode=load_all&ctry_id="+e+"&rgn_id="+t,success:function(e){jQuery("#"+n+"_rgn_ID").next().find("button").show().next().hide();var t=(e=ajax_debug_clear(e)).split("-##-");jQuery("#"+n+"_rgn_ID").html(t[0]),jQuery("#"+n+"_subrg_ID").html(t[1]),jQuery("#"+n+"_city_ID").html(t[2]),window.check_regional_required_fields(n)}})},window.load_subregions=function(e,t,n){jQuery("#"+n+"_subrg_ID").next().find("button").hide().next().show(),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_subregions_option_list&page=edit&mode=load_all&ctry_id="+e+"&rgn_id="+t,success:function(e){jQuery("#"+n+"_subrg_ID").next().find("button").show().next().hide();var t=(e=ajax_debug_clear(e)).split("-##-");jQuery("#"+n+"_subrg_ID").html(t[0]),jQuery("#"+n+"_city_ID").html(t[1]),window.check_regional_required_fields(n)}})},window.load_cities=function(e,t,n,o){jQuery("#"+o+"_city_ID").next().find("button").hide().next().show(),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_cities_option_list&page=edit&ctry_id="+e+"&rgn_id="+t+"&subrg_id="+n,success:function(e){jQuery("#"+o+"_city_ID").html(ajax_debug_clear(e)),jQuery("#"+o+"_city_ID").next().find("button").show().next().hide(),window.check_regional_required_fields()}})};for(var t=Object.values(evo_regional_config),n=0;n<t.length;n++)!function(){var e=t[n];window.check_regional_required_fields(e.prefix),jQuery("#"+e.prefix+"_ctry_ID").change(function(){window.load_regions(jQuery(this).val(),0,e.prefix)}),jQuery("#"+e.prefix+"_rgn_ID").change(function(){window.load_subregions(jQuery("#"+e.prefix+"_ctry_ID").val(),jQuery(this).val(),e.prefix)}),jQuery("#"+e.prefix+"_subrg_ID").change(function(){window.load_cities(jQuery("#"+e.prefix+"_ctry_ID").val(),jQuery("#"+e.prefix+"_rgn_ID").val(),jQuery(this).val(),e.prefix)}),jQuery("#button_refresh_region").click(function(){return window.load_regions(jQuery("#"+e.prefix+"_ctry_ID").val(),0,e.prefix),!1}),jQuery("#button_refresh_subregion").click(function(){return window.load_subregions(jQuery("#"+e.prefix+"_ctry_ID").val(),jQuery("#"+e.prefix+"_rgn_ID").val(),e.prefix),!1}),jQuery("#button_refresh_city").click(function(){return window.load_cities(jQuery("#"+e.prefix+"_ctry_ID").val(),jQuery("#"+e.prefix+"_rgn_ID").val(),jQuery("#"+e.prefix+"_subrg_ID").val(),e.prefix),!1})}()}}),jQuery(function(){jQuery('[data-toggle="tooltip"]').tooltip({html:!0})}),jQuery(document).ready(function(){if("undefined"!=typeof evo_comment_funcs_config){var p=evo_comment_funcs_config,f=new Array,d=new Array,_=p.displayed,t=!1;window.isDefined=function(e){return void 0!==e},window.fadeIn=function(e,t){if(0!=jQuery(e).length){"TR"==jQuery(e).get(0).tagName&&(e+=" td");var n=jQuery(e).css("backgroundColor");return jQuery(e).animate({backgroundColor:t},200),n}},window.fadeInStatus=function(e,t){switch(t){case"published":return fadeIn(e,"#99EE44");case"community":return fadeIn(e,"#2E8BB9");case"protected":return fadeIn(e,"#FF9C2A");case"review":return fadeIn(e,"#CC0099");case"deprecated":return fadeIn(e,"#656565");case"deleted":return fadeIn(e,"#fcc");case"spam":return fadeIn(e,"#ffc9c9");case"notsure":return fadeIn(e,"#bbbbbb");case"ok":return fadeIn(e,"#bcffb5")}},window.delete_comment_url=function(e){var t="#commenturl_"+e;fadeIn(t,"#fcc"),jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{blogid:p.blog_ID,commentid:e,action:"delete_comment_url",crumb_comment:p.crumb_comment},success:function(e){jQuery(t).remove()}})},window.show_modified=function(){for(var e in f)fadeInStatus("#"+e,f[e])},window.setCommentStatus=function(e,t,i,n){var r="comment_"+e,a="[id="+r+"]";if(void 0===f[r]){f[r]=t;var s=fadeInStatus(a,t),o=get_show_statuses(),l=get_expiry_status(),d=get_current_page(),_=get_itemid(),c=get_limit(),u={blogid:p.blog_ID,commentid:e,status:t,limit:c,action:"set_comment_status",request_from:i,moderation:"commentlist",statuses:o,expiry_status:l,itemid:_,currentpage:d,redirect_to:n,crumb_comment:p.crumb_comment};p.is_admin_page&&(u.is_backoffice=1),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:u,success:function(e){if(delete f[r],"front"==i){fadeIn(a,s);var t=ajax_debug_clear(e).split(":"),n=t[0];if(""==n)return;var o=jQuery(a).attr("class");o=o.replace(/vs_([a-z]+)/g,"vs_"+n),jQuery(a).attr("class",o),update_moderation_buttons(a,t[1],t[2])}else"dashboard"==i||"coll_settings"==i?updateCommentsList(r):(jQuery("#comments_container").html(ajax_debug_clear(e)),jQuery(".vote_spam").show(),show_modifieds())},error:function(e){e&&""!=e.statusText&&evoAlert(e.statusText),fadeIn(a,s),delete f[r]}})}},jQuery(".vote_spam").show(),window.setCommentVote=function(t,n,e){var o="#comment_"+t,i=fadeInStatus(o,e),r="";switch(e){case"spam":r=p.button_class_button_red;break;case"ok":r=p.button_class_button_green}var a={blog:p.blog_ID,commentid:t,type:n,vote:e,action:"set_comment_vote",b2evo_icons_type:p.b2evo_icons_type,crumb_comment:p.crumb_comment};p.is_admin_page&&(a.is_backoffice=1),""!=r&&jQuery("#vote_"+n+"_"+t).find(p.button_class_button).addClass(r),jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:a,success:function(e){fadeIn(o,i),jQuery("#vote_"+n+"_"+t).after(ajax_debug_clear(e)),jQuery("#vote_"+n+"_"+t).remove()}})},window.edit_comment=function(e,t){var n=jQuery("#editable_comment_"+t);if(0==n.length)return!0;var o="";if("update"==e){var i=n.find("textarea");if(0==i.length)return;o=i.val()}return jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{commentid:t,action:"edit_comment",comment_action:e,comment_content:o,crumb_comment:p.crumb_comment},success:function(e){n.html(ajax_debug_clear(e)),window.init_autocomplete_usernames&&init_autocomplete_usernames()}}),!1},window.deleteComment=function(e,n,o){if(void 0===o&&(o="feedback"),"meta"==o&&!confirm(p.delete_confirmation_msg))return!1;var i="comment_"+e,r="#"+i;if(void 0===f[i]){f[i]="deleted";var t=fadeIn(r,"#fcc"),a=get_show_statuses(),s=get_expiry_status(),l=get_itemid(),d=get_current_page(),_=get_limit();if("meta"!=o){var c=jQuery("#recycle_bin");0<c.length&&""==c.html()&&jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{action:"get_opentrash_link",blog:p.blog_ID,request_from:n,crumb_comment:p.crumb_comment},success:function(e){c.replaceWith(ajax_debug_clear(e))}})}jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{blogid:p.blog_ID,commentid:e,action:"delete_comment",request_from:n,itemid:l,comment_type:o,statuses:a,expiry_status:s,currentpage:d,limit:_,crumb_comment:p.crumb_comment},success:function(e){var t="meta"==o?"#comments":"#recycle_bin";jQuery(r).transfer({to:t,duration:700},function(){delete f[i],"dashboard"==n||"coll_settings"==n?updateCommentsList(i):(jQuery("#comments_container").html(ajax_debug_clear(e)),jQuery(".vote_spam").show(),show_modifieds())})},error:function(e){e&&""!=e.statusText&&evoAlert(e.statusText),""!=t&&fadeIn(r,t),delete f[i]}})}},window.ban_url=function(e){openModalWindow('<span class="loader_img loader_ban_url absolute_center" title="'+p.loading_msg+'"></span><iframe id="modal_window_frame_ban" src="'+p.admin_url+"?ctrl=antispam&action=ban&display_mode=js&mode=iframe&request=checkban&keyword="+e+"&crumb_antispam="+p.crumb_antispam+'" width="100%" height="500px" frameborder="0" style="display:none"></iframe>',"90%","",!0,p.confirm_ban_delete_title,[p.perform_selected_operations_msg,"btn-danger","#antispam_ban"],!0,!1,"modal_window_frame_ban");var t=jQuery(".modal-footer button:submit").not("[data-dismiss=modal]");t.on("click",function(){addSpinner(this)}),jQuery("#modal_window_frame_ban").on("load",function(){t.hasClass("btn-spinner")&&(t.removeClass("btn-spinner"),t.css("width","-=24px"))})},window.refreshAfterBan=function(e){for(var t=String(e).split(","),n=0;n<t.length;++n)fadeIn("#comment_"+t[n],"#fcc");var o=get_itemid();refresh_item_comments(o)},window.closedModalAfterBan=function(){jQuery("#server_messages").html("").append(jQuery("#modal_window_frame_ban").contents().find(".action_messages")),closeModalWindow()},window.processResult=function(e,t){var n=jQuery("<div/>");n.html(e);var o=0;for(var i in d){var r=n.find("#"+d[i]);0!==r.length&&(r.remove(),n.find(".hidden_comment:first").removeClass("hidden_comment"),o+=1)}d.length=0,jQuery("#comments_container").html(n.html());var a=jQuery("#comments_container [id^=comment_]");for(var i in _=a?a.length:0,t)switch(t[i]){case"published":jQuery("#"+i).css("backgroundColor","#339900");break;case"deprecated":jQuery("#"+i).css("backgroundColor","#656565");break;case"deleted":jQuery("#"+i).css("backgroundColor","#fcc")}var s=jQuery("#new_badge").val();if("0"==s)jQuery("#comments_block").effect("blind",{},200),jQuery("#comments_block").remove();else{var l=parseInt(s)-o;jQuery("#badge").text(l)}},window.refreshComments=function(e){t||(t=!0,jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{blogid:p.blog_ID,action:"refresh_comments",request_from:e,crumb_comment:p.crumb_comment},success:function(e){processResult(ajax_debug_clear(e),f),jQuery("#comments_container").slideDown("fast"),jQuery(".vote_spam").show(),t=!1},error:function(e){e&&""!=e.statusText&&evoAlert(e.statusText),t=!1}}))},window.startRefreshComments=function(e,t,n,o){"dashboard"==e||"coll_settings"==e?jQuery("#comments_container").slideUp("fast",refreshComments(e)):jQuery("#comments_container").fadeTo("slow",.1,function(){refresh_item_comments(t,n,o)})},window.endRefreshComments=function(e){jQuery("#comments_container").html(e),jQuery("#comments_container").fadeTo("slow",1),jQuery(".vote_spam").show()},window.get_current_page=function(){return isDefined(jQuery("#currentpage"))&&isDefined(jQuery("#currentpage").attr("value"))?jQuery("#currentpage").attr("value"):1},window.get_limit=function(){var e=jQuery("select[name$=_per_page]");return isDefined(e)?e.val():0},window.get_show_statuses=function(){return jQuery("#only_moderation")&&jQuery("#only_moderation").is(":checked")?"#only_moderation#":jQuery("#only_valid")&&jQuery("#only_valid").is(":checked")?"#only_valid#":"#all#"},window.get_expiry_status=function(){var e="active";return jQuery("#show_expiry_all")&&jQuery("#show_expiry_all").prop("checked")&&(e="all"),e},window.get_itemid=function(){var e=jQuery("#comments_container").attr("value");return isDefined(e)||(e=-1),e},window.refresh_item_comments=function(e,t,n){var o=get_show_statuses(),i=get_expiry_status();isDefined(t)||(t=get_current_page()),isDefined(e)||(e=-1),void 0===n&&(n="feedback"),jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{blogid:p.blog_ID,action:"refresh_comments",request_from:p.request_from,itemid:e,statuses:o,expiry_status:i,currentpage:t,comment_type:n},success:function(e){endRefreshComments(ajax_debug_clear(e)),show_modifieds()},error:function(e){e&&""!=e.statusText&&evoAlert(e.statusText)}})},window.decrease_comments_number=function(e){var t=parseInt(jQuery("#badge").text());t&&(t-=e,jQuery("#badge").text(t))},window.updateCommentsList=function(e){_-=1,decrease_comments_number(1),jQuery("#"+e).remove(),jQuery(".hidden_comment:first").removeClass("hidden_comment"),t&&d.push(e),jQuery(".dashboard_post:visible").removeClass("dashboard_post_odd dashboard_post_even"),jQuery(".dashboard_post:visible:even").addClass("dashboard_post_even"),jQuery(".dashboard_post:visible:odd").addClass("dashboard_post_odd"),_<6&&refreshComments("dashboard")},window.update_moderation_buttons=function(e,t,n){var o=p.button_class_group+" ";void 0!==e&&(o=e+" "+o),e=o+p.button_class_text,jQuery(e).removeClass("first-child last-child btn_next_status"),jQuery(e+".btn_raise_status_"+t).addClass("btn_next_status"),jQuery(e+".btn_lower_status_"+n).addClass("btn_next_status"),jQuery(e+":visible:first").addClass("first-child"),jQuery(e+":visible:last").addClass("last-child")}}}),jQuery(document).ready(function(){if("undefined"!=typeof evo_user_funcs_config){var n=evo_user_funcs_config;window.userfield_criteria_autocomplete=function(e){if(0<e.find("option:selected[rel=suggest]").length){var n=e.val();e.nextAll("input").first().autocomplete({source:function(e,t){jQuery.getJSON(htsrv_url+"anon_async.php?action=get_user_field_autocomplete",{term:e.term,attr_id:n},t)}})}else e.nextAll("input").first().autocomplete().autocomplete("destroy")},jQuery(document).on("change","select[id^=criteria_type]",function(){window.userfield_criteria_autocomplete(jQuery(this))});for(var e=0;e<jQuery("select[id^=criteria_type]").length;e++)window.userfield_criteria_autocomplete(jQuery("select[id^=criteria_type]:eq("+e+")"));n.can_edit_user_level&&jQuery(".user_level_edit").each(function(){0==jQuery(this).find("a").length&&jQuery(this).removeClass("user_level_edit")}),window.merge_duplicated_users=function(e){var t=jQuery("[name=selected_user_ID]:checked");return 0==t.length?alert(n.msg_select_remaining_account):location.href=jQuery(e).attr("href")+"&selected_user_ID="+t.val(),!1}}}),function(_,l,e){var a,d,c,u,p,f,g,i,h,m,v,w,y,b,s,j,Q,k,x,C,I,T,S,D,E,O,W,A,M,q,t,z,B,o={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,minWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,minHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",openNewWindowText:"open in new window",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1,displayVoting:!1,votingUrl:""},H="colorbox",P="cbox",$=P+"Element",F=P+"_closed",L=P+"_purge",R=!_.support.opacity;function r(e,t,n){return n=l.createElement("div"),e&&(n.id=P+e),n.style.cssText=t||"",_(n)}function N(e,t){return Math.round((/%/.test(e)?("x"===t?f.width():f.height())/100:1)*parseInt(e,10))}function V(e){return Q.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(e)}function U(e){for(e in Q=_.extend({},_.data(E,H)))_.isFunction(Q[e])&&"on"!==e.substring(0,2)&&(Q[e]=Q[e].call(E));Q.rel=Q.rel||E.rel||"nofollow",Q.href=Q.href||_(E).attr("href"),Q.title=Q.title||E.title,"string"==typeof Q.href&&(Q.href=_.trim(Q.href))}function X(e,t){t&&t.call(E),_.event.trigger(e)}function K(e){if(!q){if(E=e,k={},U(),p=_(E),O=0,"nofollow"!==Q.rel&&(p=_("."+$).filter(function(){return(_.data(this,H).rel||this.rel)===Q.rel}),-1===(O=p.index(E))&&(p=p.add(E),O=p.length-1)),!A){if(A=M=!0,d.show(),Q.returnFocus)try{E.blur(),_(E).one(F,function(){try{this.focus()}catch(e){}})}catch(e){}a.css({cursor:Q.overlayClose?"pointer":"auto"}).show(),Q.w=N(Q.initialWidth,"x"),Q.h=N(Q.initialHeight,"y"),B.position(),X("cbox_open",Q.onOpen),j.add(m).hide(),s.html(Q.close).show(),i=P+"Slideshow_",r="click."+P,Q.slideshow&&p[1]?(n=function(){w.text(Q.slideshowStop).one(r,o),d.removeClass(i+"off").addClass(i+"on"),t=setInterval(function(){A&&(Q.loop||O!=p.length-1)||o(),B.next()},Q.slideshowSpeed)},o=function(){clearInterval(t),w.text(Q.slideshowStart).one(r,n),d.removeClass(i+"on").addClass(i+"off")},Q.slideshowAuto?n():o()):d.removeClass(i+"off "+i+"on")}B.load(!0)}var t,n,o,i,r}(B=_.fn[H]=_[H]=function(e,t){var n=this;if(e=e||{},!n[0]){if(n.selector)return n;n=_("<a/>"),e.open=!0}return t&&(e.onComplete=t),n.each(function(){_.data(this,H,_.extend({},_.data(this,H)||o,e)),_(this).addClass($)}),(_.isFunction(e.open)&&e.open.call(n)||e.open)&&K(n[0]),n}).init=function(){f=_(e),d=r().attr({id:H,class:R?P+"IE":""}),a=r("Overlay").hide(),c=r("Wrapper"),u=r("Content").append(g=r("LoadedContent","width:0; height:0; overflow:hidden"),h=r("LoadingOverlay").add(r("LoadingGraphic")),m=r("Title"),$infoBar=r("InfoBar").append($nav=r("Navigation").append(b=r("Previous"),v=r("Current"),y=r("Next")),$voting=r("Voting"),w=r("Slideshow"),s=r("Close"),$open=r("Open"))),c.append(u),i=r(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),_("body").prepend(a,d.append(c,i)),$voting.data("voting_positions_done",0),previous_title="",u.children().on("mouseenter",function(){_(this).addClass("hover")}).on("mouseleave",function(){_(this).removeClass("hover")}).addClass("hover"),x=u.outerHeight(!0)-u.height(),C=u.outerWidth(!0)-u.width(),T=g.outerHeight(!0),S=g.outerWidth(!0),I=T,D=s.height()+4,d.css({"padding-bottom":x,"padding-right":C}).hide(),y.on("click",function(){B.next()}),b.on("click",function(){B.prev()}),s.on("click",function(){B.close()}),$open.on("click",function(){B.close()}),j=y.add(b).add(v).add(w),u.children().removeClass("hover"),a.on("click",function(){Q.overlayClose&&B.close()}),_(l).bind("keydown."+P,function(e){var t=e.keyCode;A&&Q.escKey&&27===t&&(e.preventDefault(),B.close()),A&&Q.arrowKey&&p[1]&&(37===t?(e.preventDefault(),b.trigger("click")):39===t&&(e.preventDefault(),y.trigger("click")))})},B.remove=function(){d.add(a).remove(),_("."+$).removeData(H).removeClass($)},B.position=function(e,t){var n=null==k.pw||Q.w>k.pw?Q.w:k.pw,o=null==k.ph||Q.h>k.ph?Q.h:k.ph,i=_("#colorbox .voting_wrapper");parseInt(u.css("border-bottom")),$infoBar.css({minHeight:D+"px"}),T=n<=700&&$voting.is(":visible")?(i.addClass("compact"),2*I-3):(i.removeClass("compact"),I);var r=0,a=0;function s(e){u[0].style.width=e.style.width,h[0].style.height=h[1].style.height=u[0].style.height=e.style.height}f.unbind("resize."+P),d.hide(),Q.fixed?d.css({position:"fixed"}):(r=f.scrollTop(),a=f.scrollLeft(),d.css({position:"absolute"})),!1!==Q.right?a+=Math.max(f.width()-n-S-C-N(Q.right,"x"),0):!1!==Q.left?a+=N(Q.left,"x"):a+=Math.round(Math.max(f.width()-n-S-C,0)/2),!1!==Q.bottom?r+=Math.max(l.documentElement.clientHeight-o-T-x-N(Q.bottom,"y"),0):!1!==Q.top?r+=N(Q.top,"y"):r+=Math.round(Math.max(l.documentElement.clientHeight-o-T-x,0)/2),d.show(),e=d.width()===n+S&&d.height()===o+T?0:e||0,c[0].style.width=c[0].style.height="9999px",d.dequeue().animate({width:n+S,height:o+T,top:r,left:a},{duration:e,complete:function(){s(this),M=!1,c[0].style.width=n+S+C+"px",c[0].style.height=o+T+x+"px",t&&t(),setTimeout(function(){f.bind("resize."+P,B.position)},1),B.resizeVoting(),c.parent().width()<380?w.hide():w.show()},step:function(){s(this)}})},B.resize=function(e){if(A){if((e=e||{}).width&&(Q.w=N(e.width,"x")-S-C),e.innerWidth&&(Q.w=N(e.innerWidth,"x")),g.css({width:Q.w}),e.height&&(Q.h=N(e.height,"y")-T-x),e.innerHeight&&(Q.h=N(e.innerHeight,"y")),!e.innerHeight&&!e.height){var t=g.wrapInner("<div style='overflow:auto'></div>").children();Q.h=t.outerHeight(),t.replaceWith(t.children())}g.css({height:Q.h}),k.pw=Q.w,k.ph=Q.h,B.position("none"===Q.transition?0:Q.speed)}},B.prep=function(e){if(A){var t,l="none"===Q.transition?0:Q.speed;g.remove(),(g=r("LoadedContent").append(e)).hide().appendTo(i.show()).css({width:(Q.w=Q.w||g.width(),Q.w=Q.mw&&Q.mw<Q.w?Q.mw:Q.w,Q.w=Q.minWidth&&Q.minWidth>Q.w?Q.minWidth:Q.w,k.pw=null==k.pw||Q.w>k.pw?Q.w:k.pw,k.pw),overflow:Q.scrolling?"auto":"hidden"}).css({height:(Q.h=Q.h||g.height(),Q.h=Q.mh&&Q.mh<Q.h?Q.mh:Q.h,Q.h=Q.minHeight&&Q.minHeight>Q.h?Q.minHeight:Q.h,k.ph=null==k.ph||Q.h>k.ph?Q.h:k.ph,k.ph)}).prependTo(u),i.hide(),_(W).css({float:"none"}),t=function(){var e,t,n,o,i,r,a=p.length;function s(){R&&d[0].style.removeProperty("filter")}A&&(r=function(){clearTimeout(z),h.hide(),X("cbox_complete",Q.onComplete)},R&&W&&g.fadeIn(100),m.add(g).show(),1<a?("string"==typeof Q.current&&380<g.width()&&v.html(Q.current.replace("{current}",O+1).replace("{total}",a)).show(),y[Q.loop||O<a-1?"show":"hide"]().html(Q.next),b[Q.loop||O?"show":"hide"]().html(Q.previous),e=O?p[O-1]:p[a-1],n=O<a-1?p[O+1]:p[0],Q.slideshow&&380<g.width()&&w.show(),Q.preloading&&(o=_.data(n,H).href||n.href,t=_.data(e,H).href||e.href,o=_.isFunction(o)?o.call(n):o,t=_.isFunction(t)?t.call(e):t,V(o)&&(_("<img/>")[0].src=o),V(t)&&(_("<img/>")[0].src=t))):j.hide(),Q.iframe?(i=_("<iframe/>").addClass(P+"Iframe")[0],Q.fastIframe?r():_(i).one("load",r),i.name=P+ +new Date,i.src=Q.href,Q.scrolling||(i.scrolling="no"),R&&(i.frameBorder=0,i.allowTransparency="true"),_(i).appendTo(g).one(L,function(){i.src="//about:blank"})):r(),"fade"===Q.transition?d.fadeTo(l,1,s):s())},"fade"===Q.transition?d.fadeTo(l,0,function(){B.position(0,t)}):B.position(l,t)}},B.load=function(e){var t,n,o=B.prep;W=!(M=!0),E=p[O],e||U(),X(L),X("cbox_load",Q.onLoad),previous_title=Q.title,Q.displayVoting&&""!=Q.votingUrl&&""!=E.id?(0==$voting.data("voting_positions_done")&&(0==T&&(T=g.outerHeight(!0)),$voting.data("voting_positions_done",1)),$voting.show(),init_voting_bar($voting,Q.votingUrl,E.id,!0)):""!=$voting.html()&&($voting.html("").hide(),$voting.data("voting_positions_done",0)),Q.h=Q.height?N(Q.height,"y")-T-x:Q.innerHeight&&N(Q.innerHeight,"y"),Q.w=Q.width?N(Q.width,"x")-S-C:Q.innerWidth&&N(Q.innerWidth,"x"),Q.mw=Q.w,Q.mh=Q.h,Q.maxWidth&&(Q.mw=N(Q.maxWidth,"x")-S-C,Q.mw=Q.w&&Q.w<Q.mw?Q.w:Q.mw),Q.maxHeight&&(Q.mh=N(Q.maxHeight,"y")-T-x,Q.mh=Q.h&&Q.h<Q.mh?Q.h:Q.mh),t=Q.href,z=setTimeout(function(){h.show()},100),Q.inline?(r().hide().insertBefore(_(t)[0]).one(L,function(){_(this).replaceWith(g.children())}),o(_(t))):Q.iframe?o(" "):Q.html?o(Q.html):V(t)?(_(W=new Image).addClass(P+"Photo").on("error",function(){Q.title=!1,o(r("Error").text("This image could not be loaded"))}).on("load",function(){var e;W.onload=null,Q.scalePhotos&&(n=function(){W.height-=W.height*e,W.width-=W.width*e},Q.mw&&W.width>Q.mw&&(e=(W.width-Q.mw)/W.width,n()),Q.mh&&W.height>Q.mh&&(e=(W.height-Q.mh)/W.height,n())),Q.h&&(W.style.marginTop=Math.max(Q.h-W.height,0)/2+"px"),jQuery(W).removeClass("zoomin zoomout"),colorbox_is_zoomed=!1;var l=0,d=0,t=W.naturalWidth>1.1*W.width||W.naturalHeight>1.1*W.height;t&&(W.className=W.className+" zoomin"),!t&&p[1]&&(O<p.length-1||Q.loop)&&(W.onclick=function(e){B.next()}),t&&jQuery(W).bind("click dblclick",function(e,t){if(colorbox_is_zoomed)W.className=W.className.replace(/zoomout/,""),W.width=l,W.height=d,jQuery(this).parent().scrollLeft(0).scrollTop(0),jQuery(this).css({position:"relative",top:"0",left:"0"});else{B.resize({width:Q.mw,height:Q.mh+parseInt(g.css("margin-bottom"))});var n=jQuery(this).offset(),o=void 0!==e.pageX?e.pageX:t.originalEvent.touches[0].pageX,i=void 0!==e.pageY?e.pageY:t.originalEvent.touches[0].pageY,r=(o-n.left)/jQuery(this).width(),a=(i-n.top)/jQuery(this).height();W.className=W.className+" zoomout",_(W).css({position:"static",top:0,left:0,transform:"none"}),l=W.width,d=W.height,W.removeAttribute("width"),W.removeAttribute("height");var s=jQuery(this).parent()[0];jQuery(this).parent().scrollLeft(r*(s.scrollWidth-s.clientWidth)).scrollTop(a*(s.scrollHeight-s.clientHeight))}colorbox_is_zoomed=!colorbox_is_zoomed}),R&&(W.style.msInterpolationMode="bicubic"),setTimeout(function(){o(W)},1)}),setTimeout(function(){W.src=t},1)):t&&i.load(t,Q.data,function(e,t,n){o("error"===t?r("Error").text("Request unsuccessful: "+n.statusText):_(this).contents())})},B.next=function(){!M&&p[1]&&(O<p.length-1||Q.loop)&&(O=O<p.length-1?O+1:0,B.load())},B.prev=function(){!M&&p[1]&&(O||Q.loop)&&(O=O?O-1:p.length-1,B.load())},B.close=function(){A&&!q&&(A=!(q=!0),X("cbox_cleanup",Q.onCleanup),f.unbind("."+P),a.fadeTo(200,0),d.stop().fadeTo(300,0,function(){d.add(a).css({opacity:1,cursor:"auto"}).hide(),X(L),g.remove(),setTimeout(function(){q=!1,X(F,Q.onClosed)},1)}))},B.resizeVoting=function(){var e=_("#colorbox .voting_wrapper"),t=c.parent().width();t<=480?v.hide():v.show(),$infoBar.css({minHeight:D+"px"}),T=t<=700&&$voting.is(":visible")?(e.addClass("compact"),2*I-3):(e.removeClass("compact"),I)},B.element=function(){return _(E)},B.settings=o,t=function(e){0!==e.button&&void 0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),K(this))},_(l).on("click","."+$,t),_(B.init)}(jQuery,document,this),jQuery.event.special.dblclick={setup:function(e,t){jQuery(this).bind("touchstart.dblclick",jQuery.event.special.dblclick.handler)},teardown:function(e){jQuery(this).unbind("touchstart.dblclick")},handler:function(e){var t=e.target,n=jQuery(t),o=n.data("lastTouch")||0,i=(new Date).getTime(),r=i-o;20<r&&r<500?(n.data("lastTouch",0),n.trigger("dblclick",e)):n.data("lastTouch",i)}},window.init_voting_bar=function(s,l,e,t){function d(){if("cboxVoting"==s.attr("id")){var e=jQuery("#colorbox").width(),t=s.width();e<t&&jQuery("#colorbox").css({left:jQuery("#colorbox").position().left-Math.round(t-e)/2,width:t})}}if(t&&(s.html('<div class="loading">&nbsp;</div>'),jQuery.ajax({type:"POST",url:l+"&vote_ID="+e,success:function(e){s.html(ajax_debug_clear(e)),jQuery("a.action_icon",s).data("votingPanel",s),d(),window.votingAdjust()}})),null==jQuery(s).data("initialized")){function n(t,e,n,o){var i=s.find("#voting_action"),r=i.length?i.val():l;0<s.find("#votingID").length&&(r+="&vote_ID="+s.find("#votingID").val()),0<s.find("#widgetID").length&&(r+="&widget_ID="+s.find("#widgetID").val()),0<s.find("#skinID").length&&(r+="&skin_ID="+s.find("#skinID").val());var a=s.css("backgroundColor");jQuery(t).is(":checkbox")?jQuery(t).is(":checked")?(r+="&checked=1",window.votingFadeIn(s,n)):(r+="&checked=0",window.votingFadeIn(s,o)):(jQuery(t).removeAttr("id"),window.votingFadeIn(s,n)),jQuery.ajax({type:"POST",url:r+"&vote_action="+e,success:function(e){jQuery(t).is(":checkbox")||(s.html(ajax_debug_clear(e)),d()),window.votingFadeIn(s,a),window.votingAdjust()}})}s.on("click","a.action_icon",function(){return!1}),s.on("click","#votingLike",function(){n(this,"like","#bcffb5")}),s.on("click","#votingNoopinion",function(){n(this,"noopinion","#bbb")}),s.on("click","#votingDontlike",function(){n(this,"dontlike","#ffc9c9")}),s.on("click","#votingInappropriate",function(){n(this,"inappropriate","#dcc","#bbb")}),s.on("click","#votingSpam",function(){n(this,"spam","#dcc","#bbb")}),jQuery(s).data("initialized",!0)}},window.votingFadeIn=function(e,t){var n="transparent"==t||"rgba(0, 0, 0, 0)"==t;if(n){for(var o=e.parent(),i=t;o&&("transparent"==i||"rgba(0, 0, 0, 0)"==i);)i=o.css("backgroundColor"),o=o.parent();"HTML"!=o[0].tagName&&(t=i)}e.animate({backgroundColor:t},200,function(){n&&e.css("background-color","transparent")})},window.votingAdjust=function(){$prev=jQuery("#cboxPrevious"),$wrap=jQuery("#cboxWrapper"),$voting=jQuery("#cboxVoting"),$prev.width();var e=$("#colorbox .voting_wrapper"),t=($("#colorbox .voting_wrapper > .btn-group"),$("#colorbox .vote_title_panel"),$("#colorbox .vote_others"),$("#colorbox .separator"),$wrap.parent().width());e.removeClass("compact"),t<=700&&e.addClass("compact")},jQuery(document).ready(function(){"undefined"!=typeof evo_init_comment_voting_config&&jQuery("span[id^=vote_helpful_").each(function(){window.init_voting_bar(jQuery(this),evo_init_comment_voting_config.action_url,jQuery(this).find("#votingID").val(),!1)}),"undefined"!=typeof evo_init_item_voting_config&&jQuery("span[id^=vote_item_").each(function(){window.init_voting_bar(jQuery(this),evo_init_item_voting_config.action_url,jQuery(this).find("#votingID").val(),!1)})}),function(e){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(function(ie){"use strict";var re="left",ae="right",se="up",le="down",de="none",_e="doubletap",ce="longtap",ue="horizontal",pe="vertical",fe="all",ge="move",he="end",me="cancel",ve="ontouchstart"in window,we="TouchSwipe";function o(e,b){var t=ve||!b.fallbackToMouseEvents,n=t?"touchstart":"mousedown",o=t?"touchmove":"mousemove",i=t?"touchend":"mouseup",r=t?null:"mouseleave",a="touchcancel",j=0,Q=null,k=0,x=0,C=0,I=1,T=0,S=0,D=null,s=ie(e),E="start",O=0,W=null,l=0,A=0,d=0,_=0,c=0,u=null;try{s.bind(n,p),s.bind(a,h)}catch(e){ie.error("events not supported "+n+","+a+" on jQuery.swipe")}function p(e){if(!0!==s.data(we+"_intouch")&&!(0<ie(e.target).closest(b.excludedElements,s).length)){var t,n=e.originalEvent?e.originalEvent:e,o=ve?n.touches[0]:n;return E="start",ve?O=n.touches.length:e.preventDefault(),S=Q=null,I=1,T=C=x=k=j=0,W=function(){for(var e=[],t=0;t<=5;t++)e.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0});return e}(),(i={})[re]=ee(re),i[ae]=ee(ae),i.up=ee(se),i[le]=ee(le),D=i,X(),!ve||O===b.fingers||b.fingers===fe||P()?(G(0,o),l=oe(),2==O&&(G(1,n.touches[1]),x=C=ne(W[0].start,W[1].start)),(b.swipeStatus||b.pinchStatus)&&(t=q(n,E))):t=!1,!1===t?(q(n,E=me),t):(J(!0),null)}var i}function f(e){var t,n,o,i,r,a,s,l,d,_,c,u,p,f,g,h,m=e.originalEvent?e.originalEvent:e;if(E!==he&&E!==me&&!K()){var v,w=Y(ve?m.touches[0]:m);if(A=oe(),ve&&(O=m.touches.length),E=ge,2==O&&(0==x?(G(1,m.touches[1]),x=C=ne(W[0].start,W[1].start)):(Y(m.touches[1]),C=ne(W[0].end,W[1].end),W[0].end,W[1].end,S=I<1?"out":"in"),I=(C/x*1).toFixed(2),T=Math.abs(x-C)),O===b.fingers||b.fingers===fe||!ve||P()){if(function(e,t){if(b.allowPageScroll===de||P())e.preventDefault();else{var n="auto"===b.allowPageScroll;switch(t){case re:(b.swipeLeft&&n||!n&&b.allowPageScroll!=ue)&&e.preventDefault();break;case ae:(b.swipeRight&&n||!n&&b.allowPageScroll!=ue)&&e.preventDefault();break;case se:(b.swipeUp&&n||!n&&b.allowPageScroll!=pe)&&e.preventDefault();break;case le:(b.swipeDown&&n||!n&&b.allowPageScroll!=pe)&&e.preventDefault()}}}(e,(d=w.start,c=w.end,u=(_=d).x-c.x,p=c.y-_.y,f=Math.atan2(p,u),(g=Math.round(180*f/Math.PI))<0&&(g=360-Math.abs(g)),Q=(h=g)<=45&&0<=h?re:h<=360&&315<=h?re:135<=h&&h<=225?ae:45<h&&h<135?le:se)),s=w.start,l=w.end,j=Math.round(Math.sqrt(Math.pow(l.x-s.x,2)+Math.pow(l.y-s.y,2))),k=te(),r=Q,a=j,a=Math.max(a,Z(r)),D[r].distance=a,(b.swipeStatus||b.pinchStatus)&&(v=q(m,E)),!b.triggerOnTouchEnd||b.triggerOnTouchLeave){var y=!0;if(b.triggerOnTouchLeave)n={left:(i=(o=ie(o=this)).offset()).left,right:i.left+o.outerWidth(),top:i.top,bottom:i.top+o.outerHeight()},y=(t=w.end).x>n.left&&t.x<n.right&&t.y>n.top&&t.y<n.bottom;!b.triggerOnTouchEnd&&y?E=M(ge):b.triggerOnTouchLeave&&!y&&(E=M(he)),E!=me&&E!=he||q(m,E)}}else q(m,E=me);!1===v&&q(m,E=me)}}function g(e){var t=e.originalEvent;return ve&&0<t.touches.length?(d=oe(),_=event.touches.length+1,!0):(K()&&(O=_),e.preventDefault(),A=oe(),k=te(),z()?q(t,E=me):b.triggerOnTouchEnd||0==b.triggerOnTouchEnd&&E===ge?q(t,E=he):!b.triggerOnTouchEnd&&N()?w(t,E=he,"tap"):E===ge&&q(t,E=me),J(!1),null)}function h(){C=x=l=A=O=0,I=1,X(),J(!1)}function m(e){var t=e.originalEvent;b.triggerOnTouchLeave&&q(t,E=M(he))}function v(){s.unbind(n,p),s.unbind(a,h),s.unbind(o,f),s.unbind(i,g),r&&s.unbind(r,m),J(!1)}function M(e){var t=e,n=B(),o=y(),i=z();return!n||i?t=me:!o||e!=ge||b.triggerOnTouchEnd&&!b.triggerOnTouchLeave?!o&&e==he&&b.triggerOnTouchLeave&&(t=me):t=he,t}function q(e,t){var n=void 0;return $()&&F()||F()?n=w(e,t,"swipe"):(H()&&P()||P())&&!1!==n&&(n=w(e,t,"pinch")),U()&&V()&&!1!==n?n=w(e,t,_e):k>b.longTapThreshold&&j<10&&b.longTap&&!1!==n?n=w(e,t,ce):1!==O&&ve||!isNaN(j)&&0!==j||!N()||!1===n||(n=w(e,t,"tap")),t===me&&h(),t===he&&(ve?0==e.touches.length&&h():h()),n}function w(e,t,n){var o=void 0;if("swipe"==n){if(s.trigger("swipeStatus",[t,Q||null,j||0,k||0,O]),b.swipeStatus&&!1===(o=b.swipeStatus.call(s,e,t,Q||null,j||0,k||0,O)))return!1;if(t==he&&$()){if(s.trigger("swipe",[Q,j,k,O]),b.swipe&&!1===(o=b.swipe.call(s,e,Q,j,k,O)))return!1;switch(Q){case re:s.trigger("swipeLeft",[Q,j,k,O]),b.swipeLeft&&(o=b.swipeLeft.call(s,e,Q,j,k,O));break;case ae:s.trigger("swipeRight",[Q,j,k,O]),b.swipeRight&&(o=b.swipeRight.call(s,e,Q,j,k,O));break;case se:s.trigger("swipeUp",[Q,j,k,O]),b.swipeUp&&(o=b.swipeUp.call(s,e,Q,j,k,O));break;case le:s.trigger("swipeDown",[Q,j,k,O]),b.swipeDown&&(o=b.swipeDown.call(s,e,Q,j,k,O))}}}if("pinch"==n){if(s.trigger("pinchStatus",[t,S||null,T||0,k||0,O,I]),b.pinchStatus&&!1===(o=b.pinchStatus.call(s,e,t,S||null,T||0,k||0,O,I)))return!1;if(t==he&&H())switch(S){case"in":s.trigger("pinchIn",[S||null,T||0,k||0,O,I]),b.pinchIn&&(o=b.pinchIn.call(s,e,S||null,T||0,k||0,O,I));break;case"out":s.trigger("pinchOut",[S||null,T||0,k||0,O,I]),b.pinchOut&&(o=b.pinchOut.call(s,e,S||null,T||0,k||0,O,I))}}return"tap"==n?t!==me&&t!==he||(clearTimeout(u),V()&&!U()?(c=oe(),u=setTimeout(ie.proxy(function(){c=null,s.trigger("tap",[e.target]),b.tap&&(o=b.tap.call(s,e,e.target))},this),b.doubleTapThreshold)):(c=null,s.trigger("tap",[e.target]),b.tap&&(o=b.tap.call(s,e,e.target)))):n==_e?t!==me&&t!==he||(clearTimeout(u),c=null,s.trigger("doubletap",[e.target]),b.doubleTap&&(o=b.doubleTap.call(s,e,e.target))):n==ce&&(t!==me&&t!==he||(clearTimeout(u),c=null,s.trigger("longtap",[e.target]),b.longTap&&(o=b.longTap.call(s,e,e.target)))),o}function y(){var e=!0;return null!==b.threshold&&(e=j>=b.threshold),e}function z(){var e=!1;return null!==b.cancelThreshold&&null!==Q&&(e=Z(Q)-j>=b.cancelThreshold),e}function B(){return!(b.maxTimeThreshold&&k>=b.maxTimeThreshold)}function H(){var e=L(),t=R(),n=null===b.pinchThreshold||T>=b.pinchThreshold;return e&&t&&n}function P(){return!!(b.pinchStatus||b.pinchIn||b.pinchOut)}function $(){var e=B(),t=y(),n=L(),o=R();return!z()&&o&&n&&t&&e}function F(){return!!(b.swipe||b.swipeStatus||b.swipeLeft||b.swipeRight||b.swipeUp||b.swipeDown)}function L(){return O===b.fingers||b.fingers===fe||!ve}function R(){return 0!==W[0].end.x}function N(){return!!b.tap}function V(){return!!b.doubleTap}function U(){if(null==c)return!1;var e=oe();return V()&&e-c<=b.doubleTapThreshold}function X(){_=d=0}function K(){var e=!1;return d&&oe()-d<=b.fingerReleaseThreshold&&(e=!0),e}function J(e){!0===e?(s.bind(o,f),s.bind(i,g),r&&s.bind(r,m)):(s.unbind(o,f,!1),s.unbind(i,g,!1),r&&s.unbind(r,m,!1)),s.data(we+"_intouch",!0===e)}function G(e,t){var n=void 0!==t.identifier?t.identifier:0;return W[e].identifier=n,W[e].start.x=W[e].end.x=t.pageX||t.clientX,W[e].start.y=W[e].end.y=t.pageY||t.clientY,W[e]}function Y(e){var t=function(e){for(var t=0;t<W.length;t++)if(W[t].identifier==e)return W[t]}(void 0!==e.identifier?e.identifier:0);return t.end.x=e.pageX||e.clientX,t.end.y=e.pageY||e.clientY,t}function Z(e){if(D[e])return D[e].distance}function ee(e){return{direction:e,distance:0}}function te(){return A-l}function ne(e,t){var n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);return Math.round(Math.sqrt(n*n+o*o))}function oe(){return(new Date).getTime()}this.enable=function(){return s.bind(n,p),s.bind(a,h),s},this.disable=function(){return v(),s},this.destroy=function(){return v(),s.data(we,null),s},this.option=function(e,t){if(void 0!==b[e]){if(void 0===t)return b[e];b[e]=t}else ie.error("Option "+e+" does not exist on jQuery.swipe.options");return null}}ie.fn.swipe=function(e){var t=ie(this),n=t.data(we);if(n&&"string"==typeof e){if(n[e])return n[e].apply(this,Array.prototype.slice.call(arguments,1));ie.error("Method "+e+" does not exist on jQuery.swipe")}else if(!(n||"object"!=typeof e&&e))return function(n){return!n||void 0!==n.allowPageScroll||void 0===n.swipe&&void 0===n.swipeStatus||(n.allowPageScroll=de),void 0!==n.click&&void 0===n.tap&&(n.tap=n.click),n=n||{},n=ie.extend({},ie.fn.swipe.defaults,n),this.each(function(){var e=ie(this),t=e.data(we);t||(t=new o(this,n),e.data(we,t))})}.apply(this,arguments);return t},ie.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe"},ie.fn.swipe.phases={PHASE_START:"start",PHASE_MOVE:ge,PHASE_END:he,PHASE_CANCEL:me},ie.fn.swipe.directions={LEFT:re,RIGHT:ae,UP:se,DOWN:le,IN:"in",OUT:"out"},ie.fn.swipe.pageScroll={NONE:de,HORIZONTAL:ue,VERTICAL:pe,AUTO:"auto"},ie.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:fe}});var b2evo_colorbox_params={maxWidth:480<jQuery(window).width()?"95%":"100%",maxHeight:480<jQuery(window).height()?"90%":"100%",slideshow:!0,slideshowAuto:!1};function init_colorbox(e){if("object"==typeof e&&0!=e.length){var t=e.attr("rel").match(/lightbox\[([a-z]+)/i);switch(t=t?t[1]:""){case"p":e.colorbox(b2evo_colorbox_params_post);break;case"c":e.colorbox(b2evo_colorbox_params_cmnt);break;case"user":e.colorbox(b2evo_colorbox_params_user);break;default:e.colorbox(b2evo_colorbox_params)}}}function pop_up_window(e,t,n,o,i){return void 0===n&&(n=750),void 0===o&&(o=550),void 0===i&&(i="scrollbars=yes, status=yes, resizable=yes, menubar=yes"),i="width="+n+", height="+o+", left="+(screen.width-n)/2+", top="+(screen.height-o)/2+", "+i,opened=window.open(e,t,i),opened.focus(),"undefined"==typeof openedWindows?openedWindows=new Array(opened):openedWindows.push(opened),!1}function textarea_replace_selection(e,t,n){textarea_wrap_selection(e,t,"",1,n)}function textarea_wrap_selection(e,t,n,o,i){var r={element:e,before:t,after:n,replace:o,target_document:i=i||document};if(!b2evo_Callbacks.trigger_callback("wrap_selection_for_"+e.id,r)){if(window.opener&&void 0!==window.opener)try{if(window.opener.b2evo_Callbacks&&void 0!==window.opener.b2evo_Callbacks&&window.opener.b2evo_Callbacks.trigger_callback("wrap_selection_for_"+e.id,r))return}catch(e){}if(!(window.parent&&void 0!==window.parent&&window.parent.b2evo_Callbacks&&void 0!==window.parent.b2evo_Callbacks&&window.parent.b2evo_Callbacks.trigger_callback("wrap_selection_for_"+e.id,r)))if(i.selection)e.focus(),sel=i.selection.createRange(),sel.text=o?t+n:t+sel.text+n,e.focus();else if(e.selectionStart||"0"==e.selectionStart){var a,s,l,d=e.selectionStart,_=e.selectionEnd;"textarea"==e.type&&void 0!==e.scrollTop&&(s=e.scrollTop,l=e.scrollLeft),a=o?(e.value=e.value.substring(0,d)+t+n+e.value.substring(_,e.value.length),d+t.length+n.length):(e.value=e.value.substring(0,d)+t+e.value.substring(d,_)+n+e.value.substring(_,e.value.length),_+t.length+n.length),void 0!==s&&(e.scrollTop=s,e.scrollLeft=l),e.focus(),e.selectionStart=a,e.selectionEnd=a}else e.value+=t+n,e.focus()}}function textarea_str_replace(e,t,n,o){var i={element:e,search:t,replace:n,target_document:o=o||document};if(!b2evo_Callbacks.trigger_callback("str_replace_for_"+e.id,i)){if(window.opener&&void 0!==window.opener)try{if(window.opener.b2evo_Callbacks&&void 0!==window.opener.b2evo_Callbacks&&window.opener.b2evo_Callbacks.trigger_callback("str_replace_for_"+e.id,i))return}catch(e){}window.parent&&void 0!==window.parent&&window.parent.b2evo_Callbacks&&void 0!==window.parent.b2evo_Callbacks&&window.parent.b2evo_Callbacks.trigger_callback("str_replace_for_"+e.id,i)||(e.value=e.value.replace(t,n),e.focus())}}function toggle_filter_area(e,t){var n=jQuery("#clickdiv_"+e),o=jQuery("#clickimg_"+e);if(0==n.length||0==o.length)return alert("ID "+e+" not found!"),!1;if(o.hasClass("fa")||o.hasClass("glyphicon")){if(""!=o.data("toggle")&&null!=o.data("toggle")){var i=o.hasClass("fa")?"fa":"glyphicon";null==o.data("toggle-orig-class")&&o.data("toggle-orig-class",o.attr("class").replace(new RegExp("^"+i+" (.+)$","g"),"$1")),o.hasClass(o.data("toggle-orig-class"))?o.removeClass(o.data("toggle-orig-class")).addClass(i+"-"+o.data("toggle")):o.removeClass(i+"-"+o.data("toggle")).addClass(o.data("toggle-orig-class"))}}else{var r=o.css("background-position").match(/-*\d+/g);o.css("background-position",parseInt(r[0])+(n.is(":hidden")?-16:16)+"px "+parseInt(r[1])+"px")}var a=void 0===t?n.is(":hidden")?"expand":"collapse":t;return"collapse"==a?n.slideUp(500):"expand"==a&&n.slideDown(500),void 0===t&&"expand"==a&&jQuery("#clickdiv_"+e).closest(".filters").find("[id^=clickdiv_]").each(function(){jQuery(this).is(":visible")&&jQuery(this).attr("id")!="clickdiv_"+e&&toggle_filter_area(jQuery(this).attr("id").substr(9),"collapse")}),!1}function b2evo_Callbacks(){this.eventHandlers=new Array}jQuery(document).ready(function(){"undefined"!=typeof b2evo_colorbox_params_post&&"undefined"!=typeof b2evo_colorbox_params_cmnt&&"undefined"!=typeof b2evo_colorbox_params_user&&"undefined"!=typeof b2evo_colorbox_params_other&&(b2evo_colorbox_params_post=jQuery.extend({},b2evo_colorbox_params,b2evo_colorbox_params_post),b2evo_colorbox_params_cmnt=jQuery.extend({},b2evo_colorbox_params,b2evo_colorbox_params_cmnt),b2evo_colorbox_params_user=jQuery.extend({},b2evo_colorbox_params,b2evo_colorbox_params_user),b2evo_colorbox_params=jQuery.extend({},b2evo_colorbox_params,b2evo_colorbox_params_other),jQuery('a[rel^="lightbox"]').each(function(){init_colorbox(jQuery(this))}),jQuery("#colorbox").swipe({swipeLeft:function(e,t,n,o,i){"undefined"!=typeof colorbox_is_zoomed&&colorbox_is_zoomed||jQuery.colorbox.next()},swipeRight:function(e,t,n,o,i){"undefined"!=typeof colorbox_is_zoomed&&colorbox_is_zoomed||jQuery.colorbox.prev()}}),jQuery(document).on("click","#colorbox img.cboxPhoto",function(){jQuery(this).hasClass("zoomout")?jQuery("#colorbox").swipe("disable"):jQuery("#colorbox").swipe("enable")}))}),b2evo_Callbacks.prototype={register_callback:function(e,t,n){void 0===this.eventHandlers[e]&&(this.eventHandlers[e]=new Array),void 0!==n&&n?this.eventHandlers[e][0]=t:this.eventHandlers[e][this.eventHandlers[e].length]=t},trigger_callback:function(event,args){if(void 0===this.eventHandlers[event])return null;for(var r=!1,cb_args="",cb_arguments=arguments,i=1;i<arguments.length;i++)cb_args+="cb_arguments["+i+"], ";cb_args.length&&(cb_args=cb_args.substring(0,cb_args.length-2));for(var i=0;i<this.eventHandlers[event].length;i++){var f=this.eventHandlers[event][i];r=eval("f("+cb_args+");")||r}return r}};var b2evo_Callbacks=new b2evo_Callbacks;function evoAlert(e){var t=jQuery(".b2evo_alert");0<t.length&&t.remove(),jQuery("body").append('<div class="b2evo_alert">'+e+"</div>"),setTimeout(function(){jQuery(".b2evo_alert").fadeOut({complete:function(){jQuery(this).remove()}})},3e3),evo_alert_events_initialized||(evo_alert_events_initialized=!0,jQuery(document).on("click",".b2evo_alert",function(){jQuery(this).remove()}))}function debounce(i,r,a){var s,l;return function(){var e,t,n=this,o=arguments;return e=function(){s=null,a||(l=i.apply(n,o))},t=a&&!s,clearTimeout(s),s=setTimeout(e,r),t&&(l=i.apply(n,o)),l}}function ajax_debug_clear(e){return e=(e=e.replace(/<!-- Ajax response end -->/,"")).replace(/(<div class="jslog">[\s\S]*)/i,""),jQuery.trim(e)}function ajax_response_is_correct(e){return!!e.match(/<!-- Ajax response end -->/)&&""!=(e=ajax_debug_clear(e))}function SendAdminRequest(e,t,n,o){void 0!==o&&!o||(n+=(""!==n?"&":"")+"nocache_dummy="+(new Date).getTime());SendServerRequest(b2evo_dispatcher_url+"?ctrl="+e+"&action="+t+(n?"&"+n:""))}function SendServerRequest(e){e+=-1!=e.indexOf("?")?"&":"?";var t=(e+="display_mode=js").split("?");e=t[0],t=t[1],jQuery.ajax({type:"POST",url:e,data:t,dataType:"script",success:function(){-1<t.indexOf("ctrl=widgets")&&"function"==typeof window.top.evo_customizer_reload_frontoffice&&window.top.evo_customizer_reload_frontoffice()}})}function AttachServerRequest(e){jQuery('<input type="hidden" name="display_mode" value="js" /><input type="hidden" name="js_target" value="window.parent." />').appendTo("#"+e),jQuery("#"+e).attr("target","server_postback")}function DisplayServerMessages(e,t){jQuery("#server_messages").html(e),"object"==typeof t&&(jQuery("input.field_error, select.field_error, textarea.field_error").each(function(){jQuery(this).removeClass("field_error");var e=jQuery(this).next();e.hasClass("notes")&&"SPAN"==e.get(0).tagName&&e.remove()}),jQuery.each(t,function(e,t){jQuery("#"+e).addClass("field_error").after('<span class="oneline notes"> <span class="field_error" rel="'+e+'">'+t+"</span></span>")})),jQuery("#server_messages .log_success").animate({backgroundColor:"#88ff88"},"fast").animate({backgroundColor:"#ffffff"},"fast","",function(){jQuery(this).removeAttr("style")}),jQuery("#server_messages > .log_error").animate({backgroundColor:"#ff8888"},"fast").animate({backgroundColor:"#ffffff"},"fast","",function(){jQuery(this).removeAttr("style")})}evo_alert_events_initialized=!1,jQuery(document).ready(function(){function n(e){var t=e.data("prefix")?e.data("prefix"):"",n=jQuery("."+t+e.val()+"_toolbar");if(0==n.length)return!0;e.is(":checked")?(n.removeClass("disabled"),n.find("input[type=button]").prop("disabled",!1)):(n.addClass("disabled"),n.find("input[type=button]").prop("disabled",!0))}jQuery(document).on("click","[data-func]",function(){var e=jQuery(this).data("func").match(/([^\\|]|\\\|)+/g),t=e[0];e.splice(0,1);for(var n=0;n<e.length;n++)-1<e[n].indexOf("b2evoCanvas")?e[n]=window[e[n]]:" "==e[n]?e[n]="":e[n]=e[n].replace(/\\\|/g,"|");return 0<jQuery(this).closest(".disabled[class*=_toolbar]").length||window[t].apply(null,e),!1}),jQuery('input[type=checkbox][name="renderers[]"]').each(function(){n(jQuery(this))}),jQuery('input[type=checkbox][name="renderers[]"]').on("click",function(){n(jQuery(this))}),jQuery(".plugin-toolbar").on("click",function(){if(jQuery(this).hasClass("disabled")){var e=jQuery(this).attr("data-plugin-toolbar");if(e){if(0===(e=e.replace("_toolbar","")).indexOf("meta_")){e=e.replace("meta_","");var t=jQuery('input[type=checkbox][id="meta_renderer_'+e+'"]')}else t=jQuery('input[type=checkbox][id="renderer_'+e+'"]');0<t.length&&(t.prop("checked",!0),n(t))}}})}),jQuery(document).ready(function(){jQuery(".pblock").length?jQuery('<div id="server_messages"></div>').prependTo(".pblock"):jQuery(".level2").length?jQuery(".level2").after('<div id="server_messages"></div>'):jQuery(".navbar.level1").after('<div id="server_messages"></div>'),jQuery('<iframe id="server_postback" name="server_postback"></iframe>').appendTo("body").css({position:"absolute",left:"-1000em",top:"-1000em"})});var _b2evoCommunications=function(){var n,o,t=2500,i=250;return{Init:function(){var e=jQuery.fn.extend({delay:t,interval:i,dispatcher:o},arguments.length?arguments[0]:"");t=e.delay,i=e.interval,o=e.dispatcher,n=this,b2evoHelper.info("Communications object ready")},BufferedServerCall:function(){var e=jQuery.fn.extend({ticker_callback:function(){return!0},send_callback:function(){},delay:t,interval:i,buffer_name:""},arguments.length?arguments[0]:"");if(ticker_status=e.ticker_callback(e.delay))switch(!0!==ticker_status&&b2evoHelper.log("Ticker status : "+ticker_status),ticker_status){case"cancel":return void b2evoHelper.DisplayMessage('<div class="log_message">'+T_("Update cancelled")+"</div>");case"pause":return b2evoHelper.DisplayMessage('<div class="log_error">'+T_("Update Paused")+" : "+b2evoHelper.str_repeat(".",e.delay/e.interval)+"</div>"),void n.BufferedServerLoop(e);case"ignore":return void n.BufferedServerLoop(e);case"immediate":break;default:if(e.delay-=e.interval,0<e.delay)return b2evoHelper.DisplayMessage('<div class="log_error">'+T_("Changes pending")+" : "+b2evoHelper.str_repeat(".",e.delay/e.interval)+"</div>"),void n.BufferedServerLoop(e);b2evoHelper.DisplayMessage('<div class="log_message">'+T_("Saving changes")+"</div>"),e.send_callback()}},BufferedServerLoop:function(e){var t=jQuery(n).data("buffers");void 0===t&&(t=Array()),t[e.buffer_name]=e,jQuery(n).data("buffers",t),window.setTimeout('b2evoCommunications.BufferedServerCallback( "'+e.buffer_name+'" )',e.interval)},BufferedServerCallback:function(e){var t=jQuery(n).data("buffers");n.BufferedServerCall(t[e])},SendAdminRequest:function(){var e=jQuery.fn.extend({ctrl:"",action:"",data:"",key:"",error:function(){return!1},ok:function(){return!1}},arguments.length?arguments[0]:""),t="ctrl="+e.ctrl+"&key="+e.key+"&action="+e.action+"&"+e.data;n.SendServerRequest({url:o,data:t,error:e.error,ok:e.ok})},SendServerRequest:function(){var e=jQuery.fn.extend({url:"",data:"",error:function(){return!1},ok:function(){return!1}},arguments.length?arguments[0]:"");if(e.url){e.url+=(!0===e.url.indexOf("?")?"&":"?")+"mode=js",e.data&&(e.url+="&"+e.data);var t=jQuery("<script><\/script>");t.attr("src",e.url),t.load(e.ok()),t.error(e.error()),t.appendTo("body"),b2evoHelper.log("Sending request : "+e.url)}}}},b2evoCommunications=new _b2evoCommunications;function get_form(e){for(;"FORM"!=e.tagName;){if(void 0===e)return!1;e=e.parentNode}return e}function cancelClick(e){return window.event&&window.event.returnValue&&(window.event.returnValue=!1),e&&e.preventDefault&&e.preventDefault(),!1}function clear_form(e){for(e=check(e,!1),i=0;i<e.length;)"text"==e.elements[i].type&&(e.elements[i].value=""),i++;return e}function focus_on_first_input(){if(all_inputs=document.getElementsByTagName("input"),all_inputs.length)for(i=0;i<all_inputs.length;i++)if("text"==all_inputs[i].type&&1!=all_inputs[i].disabled){try{all_inputs[i].focus()}catch(e){}break}}function check_combo(e){var t=jQuery(e),n=t.next();t.find("option:first").is(":selected")?(n.show().focus(),"required"==t.attr("required")&&n.attr("required","required")):(n.hide(),n.removeAttr("required"))}function input_decorated_help(e,t){function n(){""!=o.value&&o.value!=t||(o.style.color="#666",o.value=t)}var o=document.getElementById(e);jQuery(o).bind("blur",n),jQuery(o).bind("focus",function(){o.style.color="",o.value==t&&(o.value="")}),jQuery(o.form).bind("submit",function(){o.value==t&&(o.value="")}),n()}function findTarget(e){var t;if(window.event&&window.event.srcElement?t=window.event.srcElement:e&&e.target&&(t=e.target),!t)return null;for(;t!=document.body&&"a"!=t.nodeName.toLowerCase();)t=t.parentNode;return"a"!=t.nodeName.toLowerCase()?null:t}function addSpinner(e){(e=jQuery(e)).addClass("btn-spinner"),e.css("width","+=24px")}function checkInputLength(e,t,n){e.value.length<t?e.setCustomValidity(n):e.setCustomValidity("")}function check_extracat(e){for(var t=e.value,n=document.getElementsByName("post_extracats[]"),o=0;o<n.length;o++){var i=n[o];i.value==t&&(i.checked=!0)}}function init_dynamicSelect(){for(var e=0;e<nb_dynamicSelects;e++)dynamicSelect(tab_dynamicSelects[e].parent,tab_dynamicSelects[e].child)}function dynamicSelect(e,t){if(document.getElementById&&document.getElementsByTagName){var n=document.getElementById(e),o=document.getElementById(t),i=o.cloneNode(!0).getElementsByTagName("option");refreshDynamicSelectOptions(n,o,i),n.onchange=function(){refreshDynamicSelectOptions(n,o,i)}}}function refreshDynamicSelectOptions(e,t,n){for(;t.options.length;)t.remove(0);for(var o=new RegExp("^"+e.options[e.selectedIndex].value+"-.*$"),i=0;i<n.length;i++)!n[i].value.match(o)&&""!=n[i].value||t.appendChild(n[i].cloneNode(!0))}function evoFadeSuccess(e){evoFadeBg(e,new Array("#ddff00","#bbff00"))}function evoFadeFailure(e){evoFadeBg(e,new Array("#9300ff","#ff000a","#ff0000"))}function evoFadeHighlight(e){evoFadeBg(e,new Array("#ffbf00","#ffe79f"))}function evoFadeBg(selector,bgs,options){var origBg=jQuery(selector).css("backgroundColor"),speed=options&&options.speed||'"slow"',toEval="jQuery(selector).animate({ backgroundColor: ";for(e in bgs)"string"==typeof bgs[e]&&(toEval+='"'+bgs[e]+'"}, '+speed+" ).animate({ backgroundColor: ");toEval+="origBg }, "+speed+', "", function(){jQuery( this ).css( "backgroundColor", "" );});',eval(toEval)}function evobarFlash(bgs,options){var evobar="#evo_toolbar",menus="#evo_toolbar .evobar-menu a",origBg=jQuery(evobar).css("backgroundColor");jQuery(menus).css("backgroundColor","inherit");var speed=options&&options.speed||'"fast"',toEval="jQuery( evobar ).animate({ backgroundColor: ";for(e in bgs)"string"==typeof bgs[e]&&(toEval+='"'+bgs[e]+'"}, '+speed+" ).animate({ backgroundColor: ");toEval+="origBg }, "+speed+', "", function(){ jQuery( this ).css( "backgroundColor", "" ); jQuery( menus ).css( "backgroundColor", "" ); } );',eval(toEval)}function b2edit_open_preview(e,t,n){var o=jQuery(e);if(0==o.length)return location.href=t,!1;if("b2evo_preview"==o.attr("target"))return!1;null!=typeof n&&!0===n&&o.find("input[name=preview_block]").val("1");var i=o.attr("action");return o.attr("action",t),o.attr("target","b2evo_preview"),preview_window=window.open("","b2evo_preview"),preview_window.focus(),o.submit(),o.attr("action",i),o.attr("target","_self"),o.find("input[name=preview_block]").val("0"),!1}function b2edit_reload(e,t,n,o,i){var r=jQuery(e);if(0==r.length||0==r.find("input[type=hidden][name^=crumb_]").length)return location.href=t,!1;r.attr("action",t);if((0<r.find('[name="actionArray[update]"]').length?r.append('<input type="hidden" name="action" value="edit_switchtab" />'):0<r.find('[name="actionArray[create]"]').length?r.append('<input type="hidden" name="action" value="new_switchtab" />'):r.append('<input type="hidden" name="action" value="switchtab" />'),!0)&&void 0!==o)for(param in o)r.append('<input type="hidden" name="'+param+'" value="'+o[param]+'" />');return void 0!==n&&"undefined"!=n&&(null==n&&(n=""),r.find('[name="blog"]').val(n)),window.onbeforeunload=null,void 0!==i&&1==i&&r.reset(),r.submit(),!1}function b2edit_type(e,t,n){var o=!1;return 0<bozo.nb_changes&&(o=!confirm(e)),b2edit_reload("#item_checkchanges",t,null,{action:n},o)}function b2edit_confirm(e,t,n){return!(0<bozo.nb_changes&&!confirm(e))&&b2edit_reload("#item_checkchanges",t,null,{action:n},!1)}function get_whois_info(t){var n=jQuery(window).height()-40;return openModalWindow('<span id="spinner" class="loader_img loader_user_report absolute_center" title="'+evo_js_lang_whois_title+'"></span>',"90%",n+"px",!0,"WHOIS - "+t,!0,!0),jQuery.ajax({type:"GET",url:htsrv_url+"async.php",data:{action:"get_whois_info",query:t,window_height:n},success:function(e){ajax_response_is_correct(e)&&openModalWindow(e=ajax_debug_clear(e),"90%",n+"px",!0,"WHOIS - "+t,!0)}}),!1}function b2template_list_highlight(e){var t=jQuery(e),n=t.prevAll("select").find(":selected").val(),o=t.attr("href");n&&(o+="&highlight="+n);var i=t.attr("target");return void 0===i?window.self!==window.top?window.top.location=o:window.location=o:window.open(o,i),!1}function evo_copy_to_clipboard(e,t){if(void 0===t)var n=document.getElementById(e);else(n=document.createElement("span")).innerHTML=t,document.body.appendChild(n);var o=document.createRange();return o.selectNode(n),window.getSelection().removeAllRanges(),window.getSelection().addRange(o),document.execCommand("copy"),window.getSelection().removeAllRanges(),evoFadeBg("#"+e,new Array("#ffbf00"),{speed:100}),void 0!==t&&document.body.removeChild(n),!1}jQuery(document).on("change",".btn-file :file",function(){var e=jQuery(this).val().replace(/\\/g,"/").replace(/.*\//,"");jQuery(this).parent().next().html(e)});var current_widgets="",reorder_widgets_queue,reorder_delay=200,reorder_delay_remaining=0;function makeDragnDrop(e){makeDraggable(e),makeDroppable(e)}function makeDraggable(e){jQuery(e).draggable({helper:"clone",scroll:!0,scrollSensitivity:100,zIndex:999,opacity:.8,cursor:"move",cancel:"input,textarea,button,select,option,a,span.fa,span.widget_checkbox",start:function(){jQuery(this).hide()},stop:function(){jQuery(this).show()}}).addClass("draggable_widget")}function makeDroppable(e){jQuery(e).droppable({accept:".draggable_widget",hoverClass:"droppable-hover",greedy:!0,tolerance:"pointer",delay:1e3,drop:function(e,t){jQuery(".fade_me").removeClass("fade_me"),jQuery(".available_widgets").removeClass("available_widgets_active"),jQuery(this).hasClass("available_widgets")?jQuery(t.draggable).hasClass("new_widget")||jQuery(t.draggable).remove():jQuery(t.draggable).hasClass("new_widget")?addNewWidget(t.draggable,this):(jQuery(t.draggable).insertAfter(this),jQuery(t.draggable).addClass("fade_me server_update"),jQuery(t.draggable).droppable("enable")),doFade(".fade_me"),colourWidgets(),sendWidgetOrder()}})}function doFade(e){jQuery(e).addClass("evo_highlight"),setTimeout(function(){jQuery(e).removeClass("evo_highlight")},5e3)}function sendWidgetOrder(){reorder_delay_remaining<1&&jQuery("#server_messages").html('<div class="log_container"><div class="log_error"></div></div>'),reorder_delay_remaining=reorder_delay,bufferedServerCall()}function sendWidgetOrderCallback(e){doFade(".server_updating"),jQuery(".server_updating").removeClass("server_updating"),colourWidgets()}function bufferedServerCall(){var e=getWidgetOrder();e!=current_widgets?(jQuery("#server_messages").html('<div class="action_messages container-fluid"><ul><li><div class="alert alert-dismissible alert-info fade in">'+T_("Saving changes")+"</div></li></ul></div>"),current_widgets=e,e+="&"+widget_crumb_url_param,jQuery(".pending_update").removeClass("pending_update").addClass("server_updating"),jQuery("input[type=hidden][name=wico_ID]").length&&(e+="&wico_ID="+jQuery("input[type=hidden][name=wico_ID]").val()),SendAdminRequest("widgets","re-order",e,!1)):(jQuery("#server_messages").html('<div class="action_messages container-fluid"><ul><li><div class="alert alert-dismissible alert-warning fade in">'+T_("Widget order unchanged")+"</div></li></ul></div>"),jQuery(".pending_update").removeClass("pending_update"),colourWidgets())}function getWidgetOrder(){var t=new Array;jQuery(".widget_container").each(function(){var e=jQuery(this).attr("id");t[e]="",jQuery("#"+e+" .draggable_widget").each(function(){jQuery(this).attr("id")&&"undefined"!=jQuery(this).attr("id")&&(t[e]+=jQuery(this).attr("id")+", ")})});var e="",n="";for(container in t)e+=container+"="+t[container]+"&",n+=container+",";return("undefined"!=typeof blog_id?"blog="+blog_id:"")+"&"+e+"container_list="+n}function colourWidgets(){jQuery(".draggable_widget").removeClass("odd"),jQuery(".draggable_widget").removeClass("even");var e=!1;jQuery("#current_widgets .draggable_widget").each(function(){e=!e,jQuery(this).addClass(e?"even":"odd")})}function deleteWidget(e){var t=e.substr(6,e.length);return jQuery("#wi_ID_"+t).animate({backgroundColor:"#f88"},"fast",function(){jQuery(this).remove(),colourWidgets(),SendAdminRequest("widgets","delete","wi_ID="+t+"& "+widget_crumb_url_param,!1)}),!1}function duplicateWidget(e,t){var n="wi_ID="+e.substr(6,e.length)+"&"+widget_crumb_url_param;return"customizer"==t&&(n+="&mode=customizer"),SendAdminRequest("widgets","duplicate",n,!0),!1}function editWidget(e){return jQuery("#server_messages").html(""),msg="wi_ID="+e.substr(6,e.length)+"&"+widget_crumb_url_param,SendAdminRequest("widgets","edit",msg,!0),!1}function widgetSettings(e,t,n){jQuery("body").append('<div id="screen_mask" onclick="closeWidgetSettings()"></div><div id="widget_settings" class="modal-content"></div>'),jQuery("#screen_mask").fadeTo(1,.5).fadeIn(200),jQuery("#widget_settings").html(e).addClass("widget_settings_active edit_widget_"+t+"_"+n),jQuery("#widget_settings").prepend(jQuery("#server_messages")),AttachServerRequest("widget_checkchanges");var o=jQuery("#widget_settings").find("form > h2.page-title:first");if(0<o.length){var i=o.parent().children("span.global_icons"),r="";0<i.length&&(i.find("a.close_link").remove(),r='<span class="pull-right">'+i.html()+"</span>",i.remove()),jQuery("#widget_settings").prepend('<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>'+r+'<h4 class="modal-title">'+o.html()+"</h4></div>"),o.remove(),jQuery("#widget_settings button.close").bind("click",closeWidgetSettings)}jQuery("#widget_settings a.close_link").bind("click",closeWidgetSettings)}function widgetSettingsCallback(e,t,n){jQuery("#wi_ID_"+e+" .widget_name").html(t),jQuery("#wi_ID_"+e+" .widget_cache_status").html(getWidgetCacheIcon("wi_ID_"+e,n))}function closeWidgetSettings(e){if(!jQuery("#widget_settings").is(":visible"))return!1;if("undefined"!=typeof bozo&&(void 0===e||"update"!=e)){if(bozo.validate_close()&&!confirm(bozo.validate_close()))return!1;bozo.reset_changes()}return jQuery("#widget_settings").hide(),jQuery("#server_messages").insertBefore(".available_widgets"),jQuery("#widget_settings").remove(),jQuery("#screen_mask").remove(),!1}function showMessagesWidgetSettings(e){return void 0!==e&&"success"==e&&"undefined"!=typeof bozo&&bozo.reset_changes(),jQuery("#widget_settings").animate({scrollTop:jQuery("#widget_settings").scrollTop()+ +jQuery("#server_messages").position().top-20},100),!1}function T_(e){return void 0===T_arr[e]?e:T_arr[e]}function convertAvailableList(){jQuery(".fieldset_title > span > a[id^='add_new']").attr("href","#").bind("click",function(e){jQuery("body").append('<div id="screen_mask" onclick="closeAvailableWidgets()"></div>'),jQuery("#screen_mask").fadeTo(1,.5).fadeIn(200),offset=jQuery(this).offset();var t=offset.top,n=jQuery(document).height()-10-jQuery(".available_widgets").height();return n<20&&(n=20),n<t&&(t=n),jQuery(".available_widgets").addClass("available_widgets_active").attr("id","available_"+jQuery(this).attr("id")),!1}),jQuery(".available_widgets_toolbar > a").bind("click",function(e){return closeAvailableWidgets(),!1}),jQuery(".available_widgets li").each(function(){jQuery(this).addClass("new_widget");var e=jQuery(this).children("a").attr("href");e=e.substr(e.indexOf("&type")+1,e.length),jQuery(this).children("a").attr("href","#").bind("click",function(){return addNewWidget(this,e),!1})})}function closeAvailableWidgets(){if(!jQuery(".available_widgets").is(":visible"))return!1;jQuery(".available_widgets").removeClass("available_widgets_active"),jQuery("#screen_mask").remove()}function addNewWidget(e,t){closeAvailableWidgets();var n=jQuery(e).attr("id");jQuery(e).attr("id",n);var o=jQuery(".available_widgets").attr("id");o=o.substr(18,o.length),SendAdminRequest("widgets","create",t+"&blog="+blog_id+"&container="+o,!0)}function addNewWidgetCallback(e,t,n,o,i,r,a,s,l){jQuery(".fade_me").removeClass("fade_me"),createWidget("wi_ID_"+e,t.replace(/ /g,"_").replace(/:/g,"-"),n,o,"",i,r,a,s,l),doFade("#wi_ID_"+e),0<reorder_delay_remaining?reorder_delay_remaining=0:current_widgets=getWidgetOrder()}function createWidget(e,t,n,o,i,r,a,s,l,d){var _=jQuery('<li id="'+e+'" class="draggable_widget"><span class="widget_title">'+o+"</span></li>");if(_.find("a.widget_name").click(function(){return editWidget(e)}),i&&jQuery(_).addClass(i),jQuery(_).prepend(jQuery('<span class="widget_state">'+(a?disabled_plugin_tag:'<a href="#" class="toggle_action" onclick="return toggleWidget( \''+e+"' );\">"+(r?enabled_icon_tag:disabled_icon_tag)+"</a>")+"</span>")),"customizer"!=d){jQuery(_).prepend(jQuery('<span class="widget_checkbox'+(r?" widget_checkbox_enabled":"")+'"><input type="checkbox" name="widgets[]" value="'+e.replace("wi_ID_","")+'" '+(a?'disabled="disabled" ':"")+"/></span>"));var c=jQuery('<span class="widget_cache_status">'+getWidgetCacheIcon(e,s)+"</span>");jQuery(_).append(c)}var u='<span class="widget_actions">';"customizer"!=d&&(u+='<a href="#" onclick="return editWidget( \''+e+"' );\">"+edit_icon_tag+"</a>"),u+='<a href="#" onclick="return duplicateWidget( \''+e+"', '"+d+"' );\">"+duplicate_icon_tag+'</a><a href="#" onclick="return deleteWidget( \''+e+"' );\">"+delete_icon_tag+"</a></span>",u=jQuery(u),jQuery(_).append(u),l?jQuery("#container_"+t+" li#wi_ID_"+l).after(_):jQuery("#container_"+t).append(_),makeDragnDrop("#"+e),colourWidgets()}function toggleWidget(e){return SendAdminRequest("widgets","toggle","wi_ID="+e.substr(6)+"&"+widget_crumb_url_param,!0),!1}function doToggle(e,t,n){n?(jQuery("#wi_ID_"+e+" .widget_state").html(disabled_plugin_tag),jQuery("#wi_ID_"+e+" .toggle_action").css("visibility","hidden")):(jQuery("#wi_ID_"+e+" .toggle_action").css("visibility","visible"),jQuery("#wi_ID_"+e+" .widget_state").html('<a href="#" class="toggle_state" onclick="return toggleWidget( \'wi_ID_'+e+"', '"+widget_crumb_url_param+"' );\">"+(t?enabled_icon_tag:disabled_icon_tag)+"</a>")),t?jQuery("#wi_ID_"+e+" .widget_checkbox").addClass("widget_checkbox_enabled"):jQuery("#wi_ID_"+e+" .widget_checkbox").removeClass("widget_checkbox_enabled"),jQuery("#wi_ID_"+e+" .toggle_action").html(t?deactivate_icon_tag:activate_icon_tag),doFade("#wi_ID_"+e)}function toggleCacheWidget(e,t){return SendAdminRequest("widgets","cache_"+t,"wi_ID="+e.substr(6)+"&"+widget_crumb_url_param,!0),!1}function doToggleCache(e,t){jQuery("#wi_ID_"+e+" .widget_cache_status").html(getWidgetCacheIcon("wi_ID_"+e,t)),doFade("#wi_ID_"+e)}function str_repeat(e,t){return new Array(t+1).join(e)}function getWidgetCacheIcon(e,t){switch(t){case"enabled":return'<a href="#" class="cache_action" onclick="return toggleCacheWidget( \''+e+"', 'disable' );\">"+cache_enabled_icon_tag+"</a>";case"disabled":return'<a href="#" class="cache_action" onclick="return toggleCacheWidget( \''+e+"', 'enable' );\">"+cache_disabled_icon_tag+"</a>";case"disallowed":return cache_disallowed_icon_tag;case"denied":return'<a href="?ctrl=coll_settings&amp;tab=advanced&amp;blog='+blog_id+'#fieldset_wrapper_caching">'+cache_denied_icon_tag+"</a>"}}jQuery(document).ready(function(){"undefined"!=typeof b2evo_widgets_init&&!1===b2evo_widgets_init||(makeDragnDrop(".draggable_widget"),jQuery(".fieldset_title").each(function(){jQuery(this).droppable({accept:".draggable_widget",hoverClass:"droppable-hover",greedy:!0,tolerance:"pointer",delay:1e3,drop:function(e,t){jQuery(".fade_me").removeClass("fade_me"),jQuery(".available_widgets").removeClass("available_widgets_active"),jQuery(t.draggable).prependTo(jQuery("#container_"+jQuery(this).find(".container_name").data("wico_id"))),jQuery(t.draggable).addClass("fade_me server_update"),jQuery(t.draggable).droppable("enable"),doFade(".fade_me"),colourWidgets(),sendWidgetOrder()}})}),jQuery(".no-drop .draggable_widget").droppable("disable"),jQuery(".draggable_widget").bind("mousedown",function(){jQuery(this).hasClass("new_widget")||jQuery(".available_widgets_active").removeClass("available_widgets_active")}),colourWidgets(),convertAvailableList(),current_widgets=getWidgetOrder(),doFade(".evo_highlight"),jQuery("#widget_button_check_all").click(function(){jQuery(this).closest("form").find("input[type=checkbox]:enabled").prop("checked",!0)}),jQuery("#widget_button_uncheck_all").click(function(){jQuery(this).closest("form").find("input[type=checkbox]").prop("checked",!1)}),jQuery("#widget_button_check_active").click(function(){jQuery(this).closest("form").find(".widget_checkbox.widget_checkbox_enabled input[type=checkbox]:enabled").prop("checked",!0),jQuery(this).closest("form").find(".widget_checkbox:not(.widget_checkbox_enabled) input[type=checkbox]").prop("checked",!1)}),jQuery("#widget_button_check_inactive").click(function(){jQuery(this).closest("form").find(".widget_checkbox.widget_checkbox_enabled input[type=checkbox]").prop("checked",!1),jQuery(this).closest("form").find(".widget_checkbox:not(.widget_checkbox_enabled) input[type=checkbox]:enabled").prop("checked",!0)}),jQuery(document).keyup(function(e){27==e.keyCode&&(closeWidgetSettings(),closeAvailableWidgets())}))});var modal_window_js_initialized=!1;function openModalWindow(e,t,n,o,i,r,a,s,l,d,_){var c=void 0===t||"auto"==t?"":"width:"+t+";",u=void 0===n||0==n||""==n?"":"height:"+n,p=u.match(/%$/i)?" evo_modal_window__percent_height":"",f=void 0===r||!1!==r,g="form";if(void 0!==r&&""!=r)if("object"==typeof r){var h=r[0],m=r[1];g=void 0===r[2]?"form":r[2]}else h=r,m="btn-primary";if(void 0!==a&&a&&jQuery("#modal_window").remove(),0==jQuery("#modal_window").length){var v='<div id="modal_window" class="modal fade'+p+'" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog" style="'+c+u+'"><div class="modal-content">';if(void 0!==i&&""!=i&&(v+='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title">'+i+"</h4></div>"),v+='<div class="modal-body">'+e,l){jQuery("#"+l);v+="<script>jQuery( document ).ready( function() {var iframe = jQuery( '#"+l+"' );iframe.on( 'load', function() {iframe.closest( '.modal-body' ).find( 'span.loader_img' ).remove();setModalIFrameUnload( '"+l+"' );});});<\/script>"}v+="</div>",f&&(v+='<div class="modal-footer">',void 0!==r&&""!=r&&(v+='<button class="btn '+m+'" type="submit" style="display:none">'+h+"</button>"),v+='<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">'+evo_js_lang_close+"</button></div>"),v+="</div></div></div>",jQuery("body").append(v)}else jQuery("#modal_window .modal-body").html(e);void 0!==l?jQuery("#"+l).on("load",function(){prepareModalWindow(jQuery(this).contents(),g,f,s),jQuery("#modal_window .loader_img").remove(),jQuery("#"+l).show()}):prepareModalWindow("#modal_window",g,f,s),"function"==typeof d&&jQuery("#modal_window").on("shown.bs.modal",d);var w={};modal_window_js_initialized&&(w="show"),jQuery("#modal_window").modal(w),c||(jQuery("#modal_window .modal-dialog").css({display:"table",width:"auto"}),jQuery("#modal_window .modal-dialog .modal-content").css({display:"table-cell"})),jQuery("#modal_window").on("hidden.bs.modal",function(){jQuery(this).remove(),"function"==typeof _&&_()}),modal_window_js_initialized=!0}function prepareModalWindow(e,t,n,o){n&&(void 0!==o&&o||(jQuery("legend",e).remove(),jQuery("#close_button",e).remove(),jQuery(".panel, .panel-body",e).removeClass("panel panel-default panel-body")),0==jQuery(t+" input[type=submit]",e).length?jQuery("#modal_window .modal-footer button[type=submit]").hide():(jQuery(t+" input[type=submit]",e).hide(),jQuery("#modal_window .modal-footer button[type=submit]").show()),jQuery(t,e).change(function(){var e=jQuery(this).find("input[type=submit]");0<e.length?(e.hide(),jQuery("#modal_window .modal-footer button[type=submit]").show()):jQuery("#modal_window .modal-footer button[type=submit]").hide()}),jQuery("#modal_window .modal-footer button[type=submit]").off("click"),jQuery("#modal_window .modal-footer button[type=submit]").on("click",function(){1!==jQuery(this).data("click_init")&&(jQuery(t+" input[type=submit]",e).click(),jQuery(this).data("click_init",1))}));var i="";jQuery(t+" a.btn",e).each(function(){i+="<a href="+jQuery(this).attr("href")+'><button type="button" class="'+jQuery(this).attr("class")+'">'+jQuery(this).html()+"</button></a> ",jQuery(this).remove()}),jQuery("#modal_window .modal-footer").prepend(i),0<jQuery(t+" #current_modal_title",e).length&&jQuery("#modal_window .modal-title").html(jQuery(t+" #current_modal_title",e).html())}function closeModalWindow(e,t){return void 0===e&&(e=window.document),"function"==typeof t&&jQuery("#modal_window").on("hidden.bs.modal",t),jQuery("#modal_window",e).modal("hide"),!1}function setModalIFrameUnload(e){var n=jQuery("#"+e);n[0].contentWindow.onunload=function(){var e=n.closest(".modal-body"),t=jQuery('<span class="loader_img absolute_center" title="'+evo_js_lang_loading+'"></span>');jQuery(e).prepend(t)}}function user_crop_avatar(e,t,n){void 0===n&&(n="avatar");var o=750,i=jQuery(window).width(),r=jQuery(window).height(),a=r/i,s=10,l=10;s=320<(i=o<i?o:i<320?320:i)-2*s?10:0,l=320<(r=o<r?o:r<320?320:r)-2*l?10:0;var d=o<i?o:i,_=o<r?o:r;openModalWindow('<span id="spinner" class="loader_img loader_user_report absolute_center" title="'+evo_js_lang_loading+'"></span>',d+"px",_+"px",!0,evo_js_lang_crop_profile_pic,[evo_js_lang_crop,"btn-primary"],!0);var c=jQuery("div.modal-dialog div.modal-body").length?jQuery("div.modal-dialog div.modal-body"):jQuery("#overlay_page"),u=parseInt(c.css("paddingTop")),p=parseInt(c.css("paddingRight")),f=parseInt(c.css("paddingBottom")),g=parseInt(c.css("paddingLeft")),h=(jQuery("div.modal-dialog div.modal-body").length?parseInt(c.css("min-height")):_-100)-(u+f),m={user_ID:e,file_ID:t,aspect_ratio:a,content_width:d-(g+p),content_height:h,display_mode:"js",crumb_user:evo_js_crumb_user};return evo_js_is_backoffice?(m.ctrl="user",m.user_tab="crop",m.user_tab_from=n):(m.blog=evo_js_blog,m.disp="avatar",m.action="crop"),jQuery.ajax({type:"POST",url:evo_js_user_crop_ajax_url,data:m,success:function(e){openModalWindow(e,d+"px",_+"px",!0,evo_js_lang_crop_profile_pic,[evo_js_lang_crop,"btn-primary"])}}),!1}function user_report(e,t){openModalWindow('<span class="loader_img loader_user_report absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_report_user,[evo_js_lang_report_this_user_now,"btn-danger"],!0);var n={action:"get_user_report_form",user_ID:e,crumb_user:evo_js_crumb_user};return evo_js_is_backoffice?(n.is_backoffice=1,n.user_tab=t):n.blog=evo_js_blog,jQuery.ajax({type:"POST",url:evo_js_user_report_ajax_url,data:n,success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_report_user,[evo_js_lang_report_this_user_now,"btn-danger"])}}),!1}function user_deldata(e,t){return openModalWindow('<span class="loader_img loader_user_deldata absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_delete_user_data,[evo_js_lang_delete_selected_data,"btn-danger"],!0),jQuery.ajax({type:"POST",url:evo_js_user_deldata_ajax_url,data:{ctrl:"user",user_tab:"deldata",user_tab_from:t,user_ID:e,display_mode:"js",crumb_user:evo_js_crumb_user},success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_delete_user_data,[evo_js_lang_delete_selected_data,"btn-danger"])}}),!1}function user_add_org(e){return openModalWindow('<span class="loader_img loader_user_deldata absolute_center" title="'+evo_js_lang_loading+'"></span>',"450px","",!0,evo_js_lang_add_user_to_organization,evo_js_lang_add,!0),jQuery.ajax({type:"POST",url:evo_js_user_org_ajax_url,data:{ctrl:"organizations",action:"add_user",org_ID:e,display_mode:"js",crumb_user:evo_js_crumb_organization},success:function(e){openModalWindow(e,"450px","",!0,evo_js_lang_add_user_to_organization,evo_js_lang_add),jQuery("input.autocomplete_login").trigger("added")}}),!1}function user_edit(e,t){return openModalWindow('<span class="loader_img loader_user_deldata absolute_center" title="'+evo_js_lang_loading+'"></span>',"450px","",!0,evo_js_lang_edit_membership,evo_js_lang_edit,!0),jQuery.ajax({type:"POST",url:evo_js_user_org_ajax_url,data:{ctrl:"organizations",action:"edit_user",org_ID:e,user_ID:t,display_mode:"js",crumb_user:evo_js_crumb_organization},success:function(e){openModalWindow(e,"450px","",!0,evo_js_lang_edit_membership,evo_js_lang_edit)}}),!1}function user_remove(e,t){return openModalWindow('<span class="loader_img loader_user_deldata absolute_center" title="'+evo_js_lang_loading+'"></span>',"450px","",!0,'<span class="text-danger">'+evo_js_lang_remove_user_membership+"</span>",evo_js_lang_remove,!0),jQuery.ajax({type:"POST",url:evo_js_user_org_ajax_url,data:{ctrl:"organizations",action:"remove_user",org_ID:e,user_ID:t,display_mode:"js",crumb_user:evo_js_crumb_organization},success:function(e){openModalWindow(e,"450px","",!0,'<span class="text-danger">'+evo_js_lang_remove_user_membership+"</span>",evo_js_lang_remove)}}),!1}function add_user_automation(e){return openModalWindow('<span class="loader_img loader_add_user_automation absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_add_user_to_automation,evo_js_lang_add,!0),jQuery.ajax({type:"POST",url:evo_js_user_automation_ajax_url,data:{ctrl:"user",user_tab:"automation",user_ID:e,display_mode:"js",crumb_user:evo_js_crumb_user},success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_add_user_to_automation,evo_js_lang_add)}}),!1}function add_userlist_automation(){return openModalWindow('<span class="loader_img loader_add_userlist_automation absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_add_current_selection_to_automation,evo_js_lang_add_selected_users_to_automation,!0),jQuery.ajax({type:"POST",url:evo_js_userlist_automation_ajax_url,data:{ctrl:"users",action:"automation",display_mode:"js"},success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_add_current_selection_to_automation,evo_js_lang_add_selected_users_to_automation)}}),!1}function requeue_automation(e,t,n,o,i){var r=evo_js_lang_requeue_automation_for_finished_steps;return void 0!==o?r=evo_js_lang_requeue_automation_for_user.replace("%s",i):void 0!==t&&(r=evo_js_lang_requeue_automation_for_step_users.replace("%s",n)),openModalWindow('<span class="loader_img loader_requeue_automation absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,r,evo_js_lang_requeue,!0),jQuery.ajax({type:"POST",url:evo_js_requeue_automation_ajax_url,data:{ctrl:"automations",action:"requeue_form",autm_ID:e,source_step_ID:void 0===t?0:t,source_user_ID:void 0===o?0:o,display_mode:"js"},success:function(e){openModalWindow(e,"auto","",!0,r,evo_js_lang_requeue)}}),!1}function add_remove_userlist_tags(){return openModalWindow('<span class="loader_img loader_add_userlist_automation absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_add_remove_tags_to_users,evo_js_lang_make_changes_now,!0),jQuery.ajax({type:"POST",url:evo_js_userlist_tags_ajax_url,data:{ctrl:"users",action:"edit_tags",display_mode:"js"},success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_add_remove_tags_to_users,evo_js_lang_make_changes_now)}}),!1}function set_account_status(){return openModalWindow('<span class="loader_img loader_set_user_account_status absolute_center" title="'+evo_js_lang_loading+'"></span>',"500px","",!0,evo_js_lang_set_user_account_status,evo_js_lang_make_changes_now,!0),jQuery.ajax({type:"POST",url:evo_js_userlist_set_account_status_ajax_url,data:{ctrl:"users",action:"set_status",display_mode:"js"},success:function(e){openModalWindow(e,"500px","",!0,evo_js_lang_set_user_account_status,evo_js_lang_make_changes_now)}}),!1}function change_groups(){return openModalWindow('<span class="loader_img loader_change_groups absolute_center" title="'+evo_js_lang_loading+'"></span>',"500px","",!0,evo_js_lang_change_groups,evo_js_lang_make_changes_now,!0),jQuery.ajax({type:"POST",url:evo_js_userlist_change_groups_ajax_url,data:{ctrl:"users",action:"change_groups",display_mode:"js"},success:function(e){openModalWindow(e,"500px","",!0,evo_js_lang_change_groups,evo_js_lang_make_changes_now)}}),!1}function evo_users_list_default_filters(){return openModalWindow('<span class="loader_img loader_user_filters absolute_center" title="'+evo_js_lang_loading+'"></span>',"auto","",!0,evo_js_lang_change_default_users_filters,evo_js_lang_save_defaults,!0),jQuery.ajax({type:"POST",url:evo_js_userlist_filters_ajax_url,data:{action:"get_user_default_filters_form"},success:function(e){openModalWindow(e,"auto","",!0,evo_js_lang_change_default_users_filters,evo_js_lang_save_defaults)}}),!1}function evo_rest_api_request(url,params_func,func_method,method){var params=params_func,func=func_method;"function"==typeof params_func&&(func=params_func,params={},method=func_method),void 0===method&&(method="GET"),jQuery.ajax({contentType:"application/json; charset=utf-8",type:method,url:restapi_url+url,data:params}).then(function(data,textStatus,jqXHR){"object"==typeof jqXHR.responseJSON&&eval(func)(data,textStatus,jqXHR)})}function evo_rest_api_print_error(e,t,n){if("string"!=typeof t&&void 0===t.code&&(t=void 0===t.responseJSON?t.statusText:t.responseJSON),void 0===t.code)var o='<h4 class="text-danger">Unknown error: '+t+"</h4>";else{o='<h4 class="text-danger">'+t.message+"</h4>";n&&(o+="<div><b>Code:</b> "+t.code+"</div><div><b>Status:</b> "+t.data.status+"</div>")}evo_rest_api_end_loading(e,o)}function evo_rest_api_start_loading(e){jQuery(e).addClass("evo_rest_api_loading").append('<div class="evo_rest_api_loader">loading...</div>')}function evo_rest_api_end_loading(e,t){jQuery(e).removeClass("evo_rest_api_loading").html(t).find(".evo_rest_api_loader").remove()}function evo_link_initialize_fieldset(n){if(0<jQuery("#"+n+"attachments_fieldset_table").length){var e=jQuery("#"+n+"attachments_fieldset_table").height();e=320<e?320:e<97?97:e,jQuery("#"+n+"attachments_fieldset_wrapper").height(e),jQuery("#"+n+"attachments_fieldset_wrapper").resizable({minHeight:80,handles:"s",zIndex:0,resize:function(e,t){jQuery("#"+n+"attachments_fieldset_wrapper").resizable("option","maxHeight",jQuery("#"+n+"attachments_fieldset_table").height()),evo_link_update_overlay(n)}}),jQuery(document).on("click","#"+n+"attachments_fieldset_wrapper .ui-resizable-handle",function(){var e=jQuery("#"+n+"attachments_fieldset_table").height(),t=jQuery("#"+n+"attachments_fieldset_wrapper").height()+80;jQuery("#"+n+"attachments_fieldset_wrapper").css("height",e<t?e:t),evo_link_update_overlay(n)})}}function evo_link_update_overlay(e){jQuery("#"+e+"attachments_fieldset_overlay").length&&jQuery("#"+e+"attachments_fieldset_overlay").css("height",jQuery("#"+e+"attachments_fieldset_wrapper").closest(".panel").height())}function evo_link_fix_wrapper_height(e){var t=void 0===e?"":e,n=jQuery("#"+t+"attachments_fieldset_table").height();jQuery("#"+t+"attachments_fieldset_wrapper").height()!=n&&jQuery("#"+t+"attachments_fieldset_wrapper").height(jQuery("#"+t+"attachments_fieldset_table").height())}function evo_link_change_position(n,e,t){var o=n,i=n.value,r=n.id.substr(17);return jQuery.get(e+"anon_async.php?action=set_object_link_position&link_ID="+r+"&link_position="+i+"&crumb_link="+t,{},function(e,t){"OK"==(e=ajax_debug_clear(e))?(evoFadeSuccess(jQuery(o).closest("tr")),jQuery(o).closest("td").removeClass("error"),"cover"!=i&&"background"!=i||jQuery("select[name=link_position][id!="+n.id+"] option[value=cover]:selected").each(function(){jQuery(this).parent().val("aftermore"),evoFadeSuccess(jQuery(this).closest("tr"))})):(jQuery(o).val(e),evoFadeFailure(jQuery(o).closest("tr")),jQuery(o.form).closest("td").addClass("error"))}),!1}function evo_link_insert_inline(e,t,n,o,i,r){if(null==o&&(o=0),void 0!==r){var a="["+e+":"+t;n.length&&(a+=":"+n),a+="]",void 0!==i&&!1!==i&&(a+=i+"[/"+e+"]");var s=jQuery("#display_position_"+t);0!=s.length&&"inline"!=s.val()?(deferInlineReminder=!0,evo_rest_api_request("links/"+t+"/position/inline",function(e){s.val("inline"),evoFadeSuccess(s.closest("tr")),s.closest("td").removeClass("error"),textarea_wrap_selection(r,a,"",o,window.document)},"POST"),deferInlineReminder=!1):textarea_wrap_selection(r,a,"",o,window.document)}}function evo_link_delete(n,o,i,e){return evo_rest_api_request("links/"+i,{action:e},function(e){if("item"==o||"comment"==o||"emailcampaign"==o||"message"==o){var t=window.b2evoCanvas;if(null!=t)textarea_str_replace(t,new RegExp("\\[(image|file|inline|video|audio|thumbnail):"+i+":?[^\\]]*\\]","ig"),"",window.document)}jQuery(n).closest("tr").remove(),evo_link_fix_wrapper_height()},"DELETE"),!1}function evo_link_change_order(l,e,d){return evo_rest_api_request("links/"+e+"/"+d,function(e){var t=jQuery(l).closest("tr"),n=t.find("span[data-order]");if("move_up"==d){var o=n.attr("data-order"),i=jQuery(t.prev()).find("span[data-order]"),r=i.attr("data-order");t.prev().before(t),n.attr("data-order",r),i.attr("data-order",o)}else{o=n.attr("data-order");var a=jQuery(t.next()).find("span[data-order]"),s=a.attr("data-order");t.next().after(t),n.attr("data-order",s),a.attr("data-order",o)}evoFadeSuccess(t)},"POST"),!1}function evo_link_attach(e,t,n,o,i){return evo_rest_api_request("links",{action:"attach",type:e,object_ID:t,root:n,path:o},function(e){void 0===i&&(i="");var t=jQuery("#"+i+"attachments_fieldset_table .results table",window.parent.document),n=jQuery(e.list_content);t.replaceWith(jQuery("table",n)).promise().done(function(e){setTimeout(function(){window.parent.evo_link_fix_wrapper_height()},10)})}),!1}function evo_link_ajax_loading_overlay(e){var t=jQuery("#"+(void 0===e?"":e)+"attachments_fieldset_table"),n=!1;return 0==t.find(".results_ajax_loading").length&&(n=jQuery('<div class="results_ajax_loading"><div>&nbsp;</div></div>'),t.css("position","relative"),n.css({width:t.width(),height:t.height()}),t.append(n)),n}function evo_link_refresh_list(e,t,n,o){var i=void 0===o?"":o,r=evo_link_ajax_loading_overlay(i);return void 0===n&&(n="refresh"),r&&evo_rest_api_request("links",{action:n,type:e.toLowerCase(),object_ID:t,prefix:i},function(e){jQuery("#"+i+"attachments_fieldset_table").html(e.html),window.evo_init_dragdrop_button_config&&window.evo_init_dragdrop_button_config["fieldset_"+i]&&init_uploader(window.evo_init_dragdrop_button_config["fieldset_"+i]),evo_link_fix_wrapper_height(i),r.remove()}),!1}function evo_link_sort_list(e){var n,o=void 0===e?"":e,i=jQuery("#"+o+"attachments_fieldset_table tbody.filelist_tbody tr");i.sort(function(e,t){var n=parseInt(jQuery("span[data-order]",e).attr("data-order")),o=parseInt(jQuery("span[data-order]",t).attr("data-order"));return(n=n||i.length)<(o=o||i.length)?-1:o<n?1:0}),$.each(i,function(e,t){n=(0===e?jQuery(t).prependTo("#"+o+"attachments_fieldset_table tbody.filelist_tbody"):jQuery(t).insertAfter(n),t)})}jQuery(document).ready(function(){jQuery("img.loadimg").each(function(){jQuery(this).prop("complete")?(jQuery(this).removeClass("loadimg"),""==jQuery(this).attr("class")&&jQuery(this).removeAttr("class")):jQuery(this).on("load",function(){jQuery(this).removeClass("loadimg"),""==jQuery(this).attr("class")&&jQuery(this).removeAttr("class")})})}),jQuery(document).on("click","[data-dir-path]",function(){var e=jQuery(this);if(e.hasClass("fa")||e.hasClass("glyphicon")){if(""!=e.data("toggle")){var t=e.hasClass("fa")?"fa":"glyphicon";null==e.data("toggle-orig-class")&&e.data("toggle-orig-class",e.attr("class").replace(new RegExp("^"+t+" (.+)$","g"),"$1")),e.hasClass(e.data("toggle-orig-class"))?e.removeClass(e.data("toggle-orig-class")).addClass(t+"-"+e.data("toggle")):e.removeClass(t+"-"+e.data("toggle")).addClass(e.data("toggle-orig-class"))}}else{var n=e.css("background-position").match(/-*\d+/g);e.css("background-position",parseInt(n[0])+(hide?16:-16)+"px "+parseInt(n[1])+"px")}var o=jQuery(this).parent(),i=o.next("ul");i.length?i.toggle():(o.after('<ul class="clicktree"><span class="loader_img"></span></ul>'),jQuery.ajax({type:"POST",url:htsrv_url+"async.php",data:{action:"browse_subdirs",path:jQuery(this).data("dir-path"),b2evo_icons_type:b2evo_icons_type},success:function(e){o.next("ul").html(ajax_debug_clear(e))},error:function(e){o.next("ul").html(e.responseText)}}))}),jQuery(document).on("keydown","textarea, input",function(e){!e.metaKey&&!e.ctrlKey||13!=e.keyCode&&10!=e.keyCode||jQuery(this).closest("form").submit()}),jQuery(document).on("click","button[data-checkbox-control]",function(){var e=!0;switch(jQuery(this).data("checkbox-control-type")){case"uncheck":e=!1;break;case"reverse":e=function(e,t){return!t}}("$all$"==jQuery(this).data("checkbox-control")?jQuery(this).closest("form").find("input[type=checkbox]"):jQuery('input[type=checkbox][name="'+jQuery(this).data("checkbox-control")+'[]"]')).prop("checked",e)}),jQuery(document).on("mouseover mouseout","button[data-checkbox-control]",function(e){var t=jQuery(this).data("checkbox-control-type");("$all$"==jQuery(this).data("checkbox-control")?jQuery(this).closest("form").find("input[type=checkbox]"):jQuery('input[type=checkbox][name="'+jQuery(this).data("checkbox-control")+'[]"]')).each(function(){"mouseout"==e.type?jQuery(this).unwrap(".checkbox_surround"):0==jQuery(this).parent("span.checkbox_surround").length&&("check"==t&&!jQuery(this).prop("checked")||"uncheck"==t&&jQuery(this).prop("checked")||"reverse"==t)&&jQuery(this).wrap('<span class="checkbox_surround"></span>')})}),jQuery(document).ready(function(){var e="input[type=text][data-maxlength], textarea[data-maxlength], input[type=text][data-recommended-length], textarea[data-recommended-length]";function n(e){return"countdown"==o(e)?e.data("maxlength")-e.val().length:jQuery("<textarea/>").html(e.val()).text().length}function o(e){return void 0!==e.data("maxlength")?"countdown":"recommended"}function i(e){if("recommended"==o(e)){var t=e.next(".evo_input_counter");if(0!=t.length){var n=t.html();n<=e.data("recommended-min")?t.removeClass("label-warning label-danger").addClass("label label-success"):n>e.data("recommended-min")&&n<=e.data("recommended-max")?t.removeClass("label-success label-danger").addClass("label label-warning"):t.removeClass("label-success label-warning").addClass("label label-danger")}}}function r(e){var t=e.next(".evo_input_counter");if(0!=t.length){var n=(e.outerHeight(!0)-parseInt(t.outerHeight(!0)))/2,o=e.position().top+n;"TEXTAREA"==e.prop("tagName")&&(o+=n-parseInt(e.css("padding-bottom"))),t.css({top:o,left:e.position().left+e.outerWidth(!0)-t.outerWidth(!0)-e.data("padding-right")/2}),e.css("padding-right",e.data("padding-right")+t.outerWidth(!0))}}jQuery(e).each(function(){if(jQuery(this).after('<span class="evo_input_counter">'+n(jQuery(this))+"</span>"),jQuery(this).parent().css("position","relative"),jQuery(this).data("padding-right",parseInt(jQuery(this).css("padding-right"))),"recommended"==o(jQuery(this))){var e=jQuery(this).data("recommended-length").toString().split(";",2);jQuery(this).data("recommended-min",parseInt(e[0])),jQuery(this).data("recommended-max",parseInt(typeof e[1]?e[1]:e[0])),i(jQuery(this))}r(jQuery(this))}),jQuery(e).keyup(function(){var e=jQuery(this).next(".evo_input_counter");if(0!=e.length){var t=e.html().length;e.html(n(jQuery(this))),i(jQuery(this)),t!=e.html().length&&r(jQuery(this))}}),jQuery(window).resize(function(){jQuery(e).each(function(){r(jQuery(this))})})});