!function(a){var b=function(a,b){this.$element=a,this.options=b},c=!1,d={init:function(){function g(){var c='<button type="button" class="btn btn-lightgray btn-sm" id="'+b.select_all_name+'">'+b.select_all_text+"</button>"+'<button type="button" class="btn btn-ironash btn-sm" id="'+b.select_toggle_name+'">'+b.select_toggle_text+"</button>";a(d).append(c)}var e,f,b=this.options,d=this.$element;g(),e=a("#"+b.select_all_name),f=a("#"+b.select_toggle_name),e.unbind("click").bind("click",function(){return c?(a("."+b.checkbox_name).espcms_checkbox("uncheck"),c=!1,a(this).empty().append(b.select_all_text)):(a("."+b.checkbox_name).espcms_checkbox("check"),c=!0,a(this).empty().append(b.select_clear_text)),!0}),f.unbind("click").bind("click",function(){return a("."+b.checkbox_name).espcms_checkbox("toggle"),c?(c=!1,e.empty().append(b.select_all_text)):(e.empty().append(b.select_clear_text),c=!0),!0})},resume:function(){if(c){var b=this.options;a("."+b.checkbox_name).espcms_checkbox("uncheck"),c=!1,a("#"+b.select_all_name).empty().append(b.select_all_text)}}};a.fn.select_checkbox=function(c){var e=a.extend({select_all_text:'<span class="glyphicon glyphicon-check" aria-hidden="true"></span> '+espcms_lanpack_select_all_bottonname,select_clear_text:'<span class="glyphicon glyphicon-check" aria-hidden="true"></span> '+espcms_lanpack_select_clear_bottonname,select_toggle_text:'<span class="glyphicon glyphicon-share" aria-hidden="true"></span> '+espcms_lanpack_select_toggle_bottonname,select_all_name:"select_all_botton",select_toggle_name:"select_toggle_botton",checkbox_name:"select_id"},c),f=Array.prototype.slice.call(arguments,1);return this.each(function(){var g=a(this),h=g.data("setOption");return h||g.data("setOption",h=new b(g,e)),"string"==typeof c&&a.isFunction(d[c])?d[c].apply(h,f):"object"!=typeof c&&c?!1:d.init.apply(h,f)})}}(jQuery),$.fn.select_checkbox_link=function(){var a=$(this).find("input");a.on("ifClicked",function(){var f,g,h,b=$(this).attr("at_id"),c=$(this).prop("checked"),d=$("#at_"+b),e=b.split("_");2==e.length?(f="#in_"+e[0],c||$(f).espcms_checkbox("check")):3==e.length&&(f="#in_"+e[0],g="#in_"+e[0]+"_"+e[1],c||($(f).espcms_checkbox("check"),$(g).espcms_checkbox("check"))),$("input",d).each(function(){h=$(this).attr("at_id"),c?$("#in_"+h).espcms_checkbox("uncheck"):$("#in_"+h).espcms_checkbox("check")})})};