// ***************************
// js.compressed/jquery/jquery.thumbnail-radio-checkbox.min.js
// ***************************
/*!======================================================================*\
|| #################################################################### ||
|| # vBulletin 5.0
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2014 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
(function(a){function i(){return"radio-checkbox-"+this.attr("name").replace(/\[|\]/g,"")}var b="thumbnailRadioCheckbox",c="radio-checkbox-thumbnail-container",d="radio-checkbox-thumbnail",e="selected",f="disabled";var g={thumbnailClass:"",preselect:null,select:null,unselect:null};var h={init:function(h){var j=this;if(typeof h==="object"){j.settings=a.extend({},g,h)}j.each(function(){var g=a(this);g.hide();a("<div></div>").addClass(c).addClass(function(){return g.attr("type")=="radio"?i.apply(g):""}).insertBefore(g).append(a("<div></div>").attr("id",g.attr("id")?"thumbnail-"+g.attr("id"):"").addClass(d+" "+j.settings.thumbnailClass).addClass(function(){return g.attr("type")=="radio"?"has-hover":"no-hover"}).bind("mousedown."+b,function(){return typeof j.settings.preselect==="function"?j.settings.preselect(a("img",this),g):true}).bind("click."+b,function(){if(a(this).hasClass(f)||g.attr("type")=="radio"&&a(this).hasClass(e)){return}if(g.attr("type")=="checkbox"){a(this).toggleClass(e);if(a(this).hasClass(e)){g.attr("checked","checked");if(typeof j.settings.select==="function")j.settings.select(a("img",this),g)}else{g.removeAttr("checked");if(typeof j.settings.unselect==="function")j.settings.unselect(a("img",this),g)}}else{g.attr("checked","checked");a("."+c+"."+i.apply(g)+" > div."+e).removeClass(e);a(this).addClass(e);if(typeof j.settings.unselect==="function")j.settings.unselect(a("img",this),g);if(typeof j.settings.select==="function")j.settings.select(a("img",this),g)}}).append(a("<img />").attr({src:g.attr("data-thumbnail"),alt:g.next("label").text(),title:""}).css({width:g.attr("data-thumbnail-width")?g.attr("data-thumbnail-width")+"px":"auto",height:g.attr("data-thumbnail-height")?g.attr("data-thumbnail-height")+"px":"auto"})).append(g.nextAll(".radio-checkbox-inside-thumbnail"))).append(g.removeAttr("data-thumbnail").removeAttr("data-thumbnail-width").removeAttr("data-thumbnail-height"),g.nextAll());if(g.is(":checked")){g.prev().addClass(e);if(typeof j.settings.select==="function")j.settings.select(a("img",g.prev()),g)}if(g.is(":disabled")){g.prev().addClass(f)}});return this},enable:function(b,c){b.each(function(){var b=a(this);if(c){b.prev().removeClass(f);b.removeAttr("disabled")}else{b.prev().addClass(f);b.attr("disabled","disabled")}});return this},check:function(b,d){var f=b.prev();var g=a("img",f);if(!d){f.removeClass(e);b.removeAttr("checked");if(typeof this.settings.unselect==="function"){this.settings.unselect(g,b)}}else{if(b.attr("type")=="radio"){a("."+c+"."+i.apply(b)+" > div."+e).removeClass(e);if(typeof this.settings.unselect==="function")this.settings.unselect(g,b)}f.addClass(e);b.attr("checked","checked");if(typeof this.settings.select==="function"){this.settings.select(g,b)}}return this},option:function(){if(arguments.length>=2){this.settings[arguments[0]]=arguments[1];return this}else if(arguments.length===1){return this.settings[arguments[0]]}return this}};a.fn.thumbnailRadioCheckbox=function(){var b=arguments[0];this.settings=this.settings||g;if(h[b]){return h[b].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof b==="object"||!b){return h.init.apply(this,arguments)}else{a.error("Method "+b+" does not exist.")}}})(jQuery);

// ***************************
// js.compressed/jquery/jquery.tinyscrollbar.custom.min.js
// ***************************
/*!
 * Tiny Scrollbar 1.65
 * http://www.baijs.nl/tinyscrollbar/
 *
 * Copyright 2010, Maarten Baijs
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-2.0.php
 *
 * Date: 10 / 05 / 2011
 * Depends on library: jQuery
 * 
 * Modified for vBulletin
 * 		- added namespace to event handlers to prevent affecting other attached similar events when unbinding
 * 		- added 'update' callback to the options to allow custom function to call whenever tinyscrollbar_update() is called
 */
(function(a){function b(b,c){function r(){d.update();t();return d}function s(){if(n<0)n=0;j.obj.css(l,n/h.ratio);g.obj.css(l,-n);p["start"]=j.obj.offset()[l];var a=m.toLowerCase();h.obj.css(a,i[c.axis]);i.obj.css(a,i[c.axis]);j.obj.css(a,j[c.axis])}function t(){j.obj.bind("mousedown."+q,u);j.obj[0].ontouchstart=function(a){a.preventDefault();j.obj.unbind("mousedown."+q);u(a.touches[0]);return false};i.obj.bind("mouseup."+q,x);if(c.scroll&&this.addEventListener){e[0].addEventListener("DOMMouseScroll",v,false);e[0].addEventListener("mousewheel",v,false)}else if(c.scroll){e[0].onmousewheel=v}}function u(b){p.start=k?b.pageX:b.pageY;var c=parseInt(j.obj.css(l));o.start=c=="auto"?0:c;a(document).bind("mousemove."+q,x);document.ontouchmove=function(b){a(document).unbind("mousemove."+q);x(b.touches[0])};a(document).bind("mouseup."+q,w);j.obj.bind("mouseup."+q,w);j.obj[0].ontouchend=document.ontouchend=function(b){a(document).unbind("mouseup."+q);j.obj.unbind("mouseup."+q);w(b.touches[0])};return false}function v(b){if(!(g.ratio>=1)){b=a.event.fix(b||window.event);var d=b.wheelDelta?b.wheelDelta/120:-b.detail/3;n-=d*c.wheel;n=Math.min(g[c.axis]-f[c.axis],Math.max(0,n));j.obj.css(l,n/h.ratio);g.obj.css(l,-n);b.preventDefault()}}function w(b){a(document).unbind("mousemove."+q,x);a(document).unbind("mouseup."+q,w);j.obj.unbind("mouseup."+q,w);document.ontouchmove=j.obj[0].ontouchend=document.ontouchend=null;return false}function x(a){if(!(g.ratio>=1)){o.now=Math.min(i[c.axis]-j[c.axis],Math.max(0,o.start+((k?a.pageX:a.pageY)-p.start)));n=o.now*h.ratio;g.obj.css(l,-n);j.obj.css(l,o.now)}return false}var d=this;var e=b;var f={obj:a(".viewport",b)};var g={obj:a(".overview",b)};var h={obj:a(".scrollbar",b)};var i={obj:a(".track",h.obj)};var j={obj:a(".thumb",h.obj)};var k=c.axis=="x",l=k?"left":"top",m=k?"Width":"Height";var n,o={start:0,now:0},p={};var q="tinyscrollbar";this.update=function(a){f[c.axis]=f.obj[0]["offset"+m];g[c.axis]=g.obj[0]["scroll"+m];g.ratio=f[c.axis]/g[c.axis];h.obj.toggleClass("disable",g.ratio>=1);i[c.axis]=c.size=="auto"?f[c.axis]:c.size;j[c.axis]=Math.min(i[c.axis],Math.max(0,c.sizethumb=="auto"?i[c.axis]*g.ratio:c.sizethumb));h.ratio=c.sizethumb=="auto"?g[c.axis]/i[c.axis]:(g[c.axis]-f[c.axis])/(i[c.axis]-j[c.axis]);n=a=="relative"&&g.ratio<=1?Math.min(g[c.axis]-f[c.axis],Math.max(0,n)):0;n=a=="bottom"&&g.ratio<=1?g[c.axis]-f[c.axis]:isNaN(parseInt(a))?n:parseInt(a);s();if(typeof c.update=="function"){c.update.apply(e)}};return r()}a.tiny=a.tiny||{};a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,size:"auto",sizethumb:"auto",update:null}};a.fn.tinyscrollbar=function(c){var c=a.extend({},a.tiny.scrollbar.options,c);this.each(function(){a(this).data("tsb",new b(a(this),c))});return this};a.fn.tinyscrollbar_update=function(b){return a(this).data("tsb").update(b)};})(jQuery);

// ***************************
// js.compressed/sb_page.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["action","active","ad_list_description","add_modules","add_subforum","adding_multiple_modules_not_allowed","all","applying_new_template","are_you_sure_want_to_delete_ad_x","cancel","cannot_add_system_module","cannot_convert_channel","cannot_remove_system_module","channels","check_to_hide_module","choose_base_module","choose_options_site_logo","click_text_edit_title","confirm_deletion_x","create_new_custom_module","delete","display_order","do_you_want_to_cancel_editing_search_module","do_you_want_to_exit_without_saving_page","do_you_want_to_remove_channel","do_you_want_to_remove_forum","do_you_want_to_remove_module","dropping_container_module_into_container_module_not_allowed","drag_and_drop_module_here","drop_page_here","edit","edit_blog_categories","edit_custom_html_module","edit_locationx_ad","edit_navigation_item","edit_search_module","edit_site_logo","error_adding_widgets","error_cloning_widget","error_deleting_page","error_fetching_channels","error_loading_search_config_script","error_processing_site_logo","error_processing_site_logo_image_hosting","error_renaming_module_title","error_retrieving_cloned_widget_template","error_retrieving_configuration","error_retrieving_list_user_groups","error_retrieving_modules","error_retrieving_navigation_bar_configuration","error_retrieving_page_map","error_retrieving_templates","error_saving_forums","error_saving_forums_code","error_saving_configuration_module","error_saving_navigation_bar_configuration","error_saving_page","error_saving_search_config","error_saving_search_config_code","error_saving_site_logo","error_saving_site_logo_code","error_uploading_logo","exit_without_saving_page","expand","input_navigation_item_name","input_target_url","invalid_image_url","main_navigation_bar","make_category","make_forum","module_configuration","module_icon","move_not_allowed","moving_main_nav_to_own_sub_nav_error","moving_main_nav_with_sub_nav_error","my_custom_modules","new_navigation_item","new_subnavigation_item","next","no","no_ad_added","no_configurations_found","no_modules","no_permission","none","overwrite_template_continue","page_template_title_cannot_be_empty","page_title_cannot_be_empty","please_choose_overwrite_template_options","please_enter_channel_title","please_enter_new_module_title","please_enter_new_template_name","please_enter_page_name","previous","remove_channel","remove_channel_q","remove_forum","remove_forum_q","remove_module_q","rename","rename_custom_module","reset","save","save_new_page","save_page","search_results","select_edit_link_header","special_options","sub_navigation_bar","subchannels_will_be_deleted","switch_template","template_changes_will_be_lost","title","forum_changes_will_be_lost","this_url_is_already_used","unable_to_delete_widget_instances","uncheck_to_unhide_module","url_too_long","user_group_settings","warning_gcpuser","yes","you_are_here","you_must_specify_a_screen_layout","you_can_also_drag_and_drop_modules_here"]);(function(F){var D,C,E,B=[];function A(){var N=F("#edit-page-dropdown .panel .panel-main-content:visible");if(N.length>0){var O=parseFloat(N.css("margin-left"))+parseFloat(N.css("margin-right"))+parseFloat(N.css("border-left-width"))+parseFloat(N.css("border-right-width"))+parseFloat(N.css("padding-left"))+parseFloat(N.css("padding-right"));F("#edit-page-dropdown .panel .panel-main-content").width(F("#edit-page-dropdown .panel:visible").width()-F("#edit-page-dropdown .panel .panel-header-text:visible").outerWidth(true)-O-1);F("#edit-page-dropdown form .form-gutter-right").width(Math.ceil((F("#edit-page-dropdown form:visible").width()-F("#edit-page-dropdown .panel:visible").outerWidth(true))/2));if(B.length){var L=B[D.tabs("option","selected")];if(L){L.tinyscrollbar_update();var M=F("#edit-content > .tabs > .ui-tabs-panel:not(.ui-tabs-hide)");var H=M.find("input:checked").closest(".list-item");if(H.length>0&&!M.find(".scrollbar").hasClass("disable")){var G=H.offset().left;var K=M.find(".scroller");var P=K.offset().left+parseInt(H.css("margin-left"),10);var I=G-P;var J=M.find(".overview").width()-K.width();if(I>J){I=J}L.tinyscrollbar_update(I)}}}}}F(document).ready(function(){var u,k,i,s=[],AC,j,l=false,Y=false,I={},T=false,d=false,W=false,e=false,X=false,U=false,x=false,n=false,z={},Q={};function t(){bindFormReset("#edit-page-dropdown form").trigger("reset",function(){F("#save-content .template-name").addClass("h-hide");F("input[type=hidden]",this).each(function(){this.value=this.defaultValue})});function AF(){if(!F(this).hasClass("selected")&&!F(document.body).hasClass("edit-mode")){F("#main-navbar .main-nav a").removeClass("selected").closest("li").addClass("h-disabled");F(this).addClass("selected").closest("li").removeClass("h-disabled");F(document.body).addClass("edit-mode "+this.id).removeClass("view-mode");F("#main-navbar ul.secondary-nav").addClass("h-disabled")}return false}F("#main-navbar .main-nav li").removeClass("h-disabled");F(document).on("focus click mousedown","#main-navbar li.h-disabled a, #main-navbar ul.secondary-nav.h-disabled li, #main-navbar ul.secondary-nav.h-disabled li a",function(AJ){this.blur();AJ.stopPropagation();return false});F(document).on("click","#sitebuilder-wrapper .lnkExitWithoutSaving",function(){if(F(this).closest("#edit-page-dropdown").length==0){F("#main-navbar ul.secondary-nav").removeClass("h-disabled")}});var AG=F("#main-navbar li.sb-menu:not(.h-disabled)");F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkEditPage",function(){var AJ=this;if(F("#edit-page-dropdown-gutter").is(":hidden")){vBulletin.assertUserHasAdminPermission("canusesitebuilder",AJ,function(){AF.apply(AJ);var AL=[];F(".hidden-widget-placeholder").each(function(){AL.push(F(this).attr("data-widget-instance-id"))});function AK(){n=false;b();AB(false,".container-widget");F(".edit-mode .canvas-widget-list .canvas-widget").addClass("shadow");D.tabs("select",0);F("#header, #header-axd, #save-content").hide();F("#edit-content").show();F("#edit-page-dropdown .lnkSaveChanges .label").text(vBulletin.phrase.get("save_page"));F("#edit-page-dropdown-gutter").removeClass("h-hide").slideDown("slow",V);F(".canvas-widget.axd-widget .widget-content").each(function(){F(this).html(AH(F(this).html(),vBulletin.phrase.get("ad")))})}if(AL.length==0){AK()}else{F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/fetch-hidden-modules",data:({modules:AL}),type:"POST",dataType:"json",complete:function(){console.log("fetch-hidden-modules complete.");AK()},success:function(AM){console.log("fetch-hidden-modules successful! result:"+JSON.stringify(AM));if(F.isArray(AM)){if(AM.length>0){F.each(AM,function(AN,AP){var AO=F(AP.template).addClass("hidden-widget");F('.hidden-widget-placeholder[data-widget-instance-id="'+AP.widgetinstanceid+'"]').replaceWith(AO)})}}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AO,AN,AM){console.log("fetch-hidden-modules failed! error:"+AM);window.vBulletin.loadingIndicator.hide();openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_modules",AO.status),iconType:"error"})}})}})}return false});F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkNewPage",function(){var AJ=this;if(F("#edit-page-dropdown-gutter").is(":hidden")){vBulletin.assertUserHasAdminPermission("canusesitebuilder",AJ,function(){AF.apply(AJ);n=true;F(".canvas-widget-list").empty();D.tabs("select",0);F("#change-layout .layout-border.selected").removeClass("selected");F("#layout-wide-narrow").prev().trigger("click");l=false;F("#header, #header-axd, #save-content").hide();F("#edit-content").show();F("#edit-page-dropdown .lnkSaveChanges .label").text(vBulletin.phrase.get("save_new_page"));F("#edit-page-dropdown-gutter").removeClass("h-hide").slideDown("slow",V)})}return false});var AI=false;F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkHeader",function(){var AJ=this;if(F("#admin-navbar-strip-gutter").is(":hidden")){vBulletin.assertUserHasAdminPermission("canusesitebuilder",AJ,function(){AF.apply(AJ);AI=false;F("#admin-navbar-strip-gutter").addClass("navbar-header").removeClass("h-hide").find(".prompt-text").text(vBulletin.phrase.get("select_edit_link_header"));var AK=F("#header"),AL=F(".header-cell",AK);$siteLogoEditStrip=F("> .admin-only",AL).addClass("h-hide-imp"),w=AL.outerWidth();F(".disable-overlay",AK).width(AK.innerWidth()-w).height(AK.innerHeight()).show();$siteLogoEditStrip.width(w-(parseInt($siteLogoEditStrip.css("padding-left"),10)+parseInt($siteLogoEditStrip.css("padding-right"),10))).removeClass("h-hide-imp")})}return false});function AH(AL,AK){var AJ=F("<div />").append(AL.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,'<span class="axd-placeholder">{0}'.format(vBulletin.phrase.get("x_will_show_up_here_when_saved",AK))).replace(/<vb\:/g,"&lt;vb:").replace(/<\/vb\:/g,"&lt;/vb:"));AJ.find("span.axd-placeholder").not(":first").remove();AJ.find("iframe").remove();return AJ.html()}F(document).on("focus click mousedown",".edit-mode.lnkHeader #header .site-logo > a",function(AJ){this.blur();AJ.stopPropagation();return false});(function(){var AM=null;var AK=null;var AZ=null;var Aa="";var AW="";var AU="";var AP="";var AY=function(Ab){if(!Ab){return false}if(Ab.match(/^https?:\/\//i)){return Ab}if(Ab.substr(0,1)=="/"){return pageData.baseurl+Ab}return pageData.baseurl+"/"+Ab};var AL=function(Ah,Ad,Ae,Ag,Ab,Ac){Ab=Ab||[];console.log("createNavbarItem... Name: "+Ad+" Url: "+Ae+" NewWindow: "+Ag+" UserGroups: "+Ab+" itemAttr: "+Ac);Ad=JShtmlEncode(Ad);var Af=F("<li />").append("<label>{0}</label>".format(Ad)).append(F("<div />").addClass("nav-item-controls h-right").append('<i>|</i><span class="navbar-item-delete" title="{0}"></span>'.format(vBulletin.phrase.get("delete"))).append('<i>|</i><span class="navbar-item-edit" title="{0}"></span>'.format(vBulletin.phrase.get("edit"))).append('<i>|</i><span class="navbar-item-opensubnav" title="{0}"></span>'.format(vBulletin.phrase.get("expand")))).data({"item-phrase":Ah,"item-name":Ad,"item-url":Ae,"item-newwindow":Ag,"item-usergroups":Ab,"item-attr":Ac});return Af};var AO=function(Ab){return Ab.prevAll("li").size()};var AS=function(Ad,Af,Ag){return ;if(Af=="add"){var Ai=Ad.data("item-newwindow")?' target="_blank"':"";F("#channel-tabbar ul").append("<li><a"+Ai+' href="'+AY(Ad.data("item-url"))+'">'+Ad.data("item-name")+"</a></li>")}else{if(Af=="update"){var Ai=Ad.data("item-newwindow")?' target="_blank"':"";var Aj=AO(Ad);var Ae=F("#channel-tabbar ul li");Ae.eq(Aj).replaceWith("<li><a"+Ai+' href="'+AY(Ad.data("item-url"))+'">'+Ad.data("item-name")+"</a></li>")}else{if(Af=="remove"){var Aj=AO(Ad);var Ae=F("#channel-tabbar ul li");Ae.eq(Aj).remove()}else{if(Af=="move"){var Ae=F("#channel-tabbar ul li");var Ab=Ae.eq(Ag.from);Ab.remove();if(Ag.to>0){var Ah=(Ag.to>Ag.from)?(Ag.to):(Ag.to-1);var Ac=Ae.eq(Ah);Ab.insertAfter(Ac)}else{Ab.prependTo("#channel-tabbar ul")}}}}}};var AV=function(){console.log("generateNavbarDisplay");var Ab=(AP=="navbar")?F("#channel-tabbar ul"):F("#footer-tabbar ul.nav-list");var Ac=(AP=="navbar")?F("#channel-subtabbar ul"):F();Ab.html("");Ac.html("");F("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var Ae=F(this);var Ad=Ae.data("item-newwindow")?' target="_blank"':"";var Af=Ae.hasClass("selected")&&AP!="footer"?' class="current"':"";Ab.append('<li{0}><a href="{1}"{2}>{3}</a></li>'.format(Af,AY(Ae.data("item-url")),Ad,Ae.data("item-name")));if(Ae.hasClass("selected")){console.log(Ae.data("subnav-element"));F(Ae.data("subnav-element")).find("li").each(function(){var Ah=F(this);console.log(Ah.data("item-url"));var Ag=Ah.data("item-newwindow")?' target="_blank"':"";var Ai=Ah.hasClass("selected")?' class="current"':"";Ac.append('<li{0}><a href="{1}"{2}>{3}</a></li>'.format(Ai,AY(Ah.data("item-url")),Ag,Ah.data("item-name")))})}})};var AN=function(Ah,Aj,Ac,Ad,Af,Ai,Ae){var Ab=AL(Ah,Aj,Ac,Ad,Af,Ae);console.log("insertNavbarItem... Name: "+Ab.data("item-name")+" Url: "+Ab.data("item-url")+" NewWindow: "+Ab.data("item-newwindow")+" UserGroups: "+Ab.data("item-usergroups")+" itemAttr: "+Ab.data("item-attr"));Ab.appendTo(AK);AS(Ab,"add");var Ag=F("<ul />").addClass("sub-navbar-list navbar-list sortable");F(Ai).each(function(){var Aq=this.phrase?this.phrase:"",Al=this.title?this.title:"",Ao=this.url?this.url:"",Ap=this.newWindow?this.newWindow:false,Ak=this.usergroups?this.usergroups:[],An=this.attr?this.attr:"";var Am=AL(Aq,Al,Ao,Ap,Ak,An);Am.appendTo(Ag)});(function(){var Ak=null;Ag.sortable({start:function(Al,Am){Am.placeholder.html(vBulletin.phrase.get("drop_page_here")).height(Am.item.height()-2)},stop:function(Al,Am){AV()},receive:function(Al,Am){var An=Am.item.data("subnav-element")||F();if(An.is(":visible")){Am.sender.sortable("cancel");openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("moving_main_nav_to_own_sub_nav_error"),iconType:"warning"})}else{if(An.find("li").length>0){Am.sender.sortable("cancel");openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("moving_main_nav_with_sub_nav_error"),iconType:"warning"})}}},connectWith:".sortable",placeholder:"sortable-highlight",forcePlaceholderSize:true}).disableSelection()})();Ag.hide();Ag.appendTo("#navbar-ui-container .subnavbar-list-container");Ab.data("subnav-element",Ag);AV()};var AR=function(Ac,Ae,Af,Ag,Ab,Ad){$newItem=AL(Ac.data("item-phrase"),Ae,Af,Ag,Ab,Ad);console.log("updateNavbarItem... Name: "+$newItem.data("item-name")+" Url: "+$newItem.data("item-url")+" NewWindow: "+$newItem.data("item-newwindow")+" itemAttr: "+$newItem.data("item-attr"));if(Ac.data("subnav-element")){$newItem.data("subnav-element",Ac.data("subnav-element"))}if(Ac.hasClass("selected")){$newItem.addClass("selected")}Ac.replaceWith($newItem);AV()};var AX=function(Ab){AP=Ab;if(AP=="navbar"){Aa=F("#channel-tabbar ul").html();AW=F("#channel-subtabbar ul").html();AU=F("#channel-tabbar ul li.current a").attr("href");F("#channel-subtabbar.h-hide").toggleClass("h-hide default-hide")}else{Aa=F("#footer-tabbar ul.nav-list").html();AU=F("#footer-tabbar ul.nav-list li.current a").attr("href")}F("#admin-navbar-strip-gutter").removeClass().addClass("navbar-"+AP);F("#header").add("#header-axd").hide();F("#edit-navbar #navbar-ui-container .navbar-ui-wrapper").remove();F("#edit-navbar #navbar-ui-container .subnavbar-ui-wrapper").remove();F("#edit-navbar .panel-header-text").hide();F("#edit-navbar #panel-header-"+AP).show();F("#edit-navbar").slideDown("slow",function(){window.vBulletin.loadingIndicator.show();F("body").css("cursor","wait");var Ac=(AP=="navbar")?"loadHeaderNavbar":"loadFooterNavbar";F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/site/"+Ac,data:({siteId:1,edit:1}),type:"POST",dataType:"json",complete:function(){window.vBulletin.loadingIndicator.hide();F("body").css("cursor","auto")},success:function(Ad){console.log(Ac+" successful! result:"+JSON.stringify(Ad));var Ag=F("<ul />").addClass("main-navbar-list navbar-list sortable "+AP);var Af=F("<div />").addClass("new-nav-item main-nav").html(vBulletin.phrase.get("new_navigation_item"));var Ae=F("<h4 />").text(vBulletin.phrase.get("main_navigation_bar"));F("<div />").addClass("navbar-ui-wrapper").append(Ae).append(Ag).append(Af).appendTo("#navbar-ui-container");var Aj=null;Ag.sortable({start:function(Al,Am){Am.placeholder.html(vBulletin.phrase.get("drop_page_here")).height(Am.item.height()-2)},stop:function(Al,Am){AV()},connectWith:".sortable",placeholder:"sortable-highlight",forcePlaceholderSize:true}).disableSelection();AK=Ag;var Ak=F("<div />").addClass("subnavbar-list-container");var Ai=F("<div />").addClass("new-nav-item sub-nav").html(vBulletin.phrase.get("new_subnavigation_item"));var Ah=F("<h4 />").text(vBulletin.phrase.get("sub_navigation_bar"));F("<div />").addClass("subnavbar-ui-wrapper").append(Ah).append(Ak).append(Ai).appendTo("#navbar-ui-container").hide();if(Ad){console.log("result:",Ad);F(Ad).each(function(){var Ar=this.phrase?this.phrase:"",Am=this.title?this.title:"",Ap=this.url?this.url:"",Aq=this.newWindow?true:false,Al=this.usergroups?this.usergroups:[],Ao=this.subnav?this.subnav:[],An=this.attr?this.attr:"";AN(Ar,Am,Ap,Aq,Al,Ao,An)});console.log("Done adding items")}F("#edit-navbar .navbar-ui-wrapper ul li").first().find(".navbar-item-opensubnav").filter(":visible").click()},error:function(Af,Ae,Ad){console.log(Ac+" failed! error:"+Ad);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_navigation_bar_configuration"),iconType:"error",onAfterClose:function(){F("#config-dialog").dialog("close")}});F("#config-dialog .loader").hide()}})})};F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkNavBar",function(){var Ab=this;if(F("#edit-navbar").is(":hidden")){vBulletin.assertUserHasAdminPermission("canusesitebuilder",Ab,function(){AF.apply(Ab);AX("navbar")})}return false});F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkFooter",function(){var Ab=this;if(F("#edit-navbar").is(":hidden")){vBulletin.assertUserHasAdminPermission("canusesitebuilder",Ab,function(){AF.apply(Ab);AX("footer")})}return false});F(document).on("click","#main-navbar .sb-menu:not(.h-disabled) #lnkPageManager",function(){var Ab=this;vBulletin.assertUserHasAdminPermission("canusesitebuilder",Ab,function(){AF.apply(Ab);AB(false);F(".edit-mode .canvas-widget-list .canvas-widget").addClass("shadow");F("#header, #header-axd, #save-content").hide();F("#manage-page").show();F("#manage-page-dropdown .lnkSaveChanges .label").text(vBulletin.phrase.get("save_page"));F("#manage-page-dropdown").removeClass("h-hide").slideDown("slow",L)});return false});var AJ=function(Ab){F("#navbar-edit-item").dialog({autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:400,dialogClass:"dialog-container navbar-item-dialog-container",open:function(){F("#navbar-edit-name").focus()}}).dialog("option","title",Ab||vBulletin.phrase.get("edit_navigation_item")).dialog("open")};F("#edit-navbar").on("click",".new-nav-item",function(){AM=null;if(F(this).closest(".navbar-ui-wrapper").size()>0){AK=F(this).closest(".navbar-ui-wrapper").find("ul")}else{AK=F(this).closest(".subnavbar-ui-wrapper").find("ul").filter(":visible")}F("#navbar-edit-name").val("");F("#navbar-edit-url").val("");F("#navbar-edit-attr").val("");F("#navbar-edit-newwindow").prop("checked",false);AJ(F(this).html());return false});F(document).on("click","#navbar-edit-save",function(){if(F("#navbar-edit-name").val()==""){openAlertDialog({title:vBulletin.phrase.get("edit_navigation_item"),message:vBulletin.phrase.get("input_navigation_item_name"),iconType:"warning",onAfterClose:function(){F("#navbar-edit-name").focus()}})}else{if(F("#navbar-edit-url").val()==""){openAlertDialog({title:vBulletin.phrase.get("edit_navigation_item"),message:vBulletin.phrase.get("input_target_url"),iconType:"warning",onAfterClose:function(){F("#navbar-edit-url").focus()}})}else{console.log("Saving new/edited navbar item");if(!AM){AN("",F("#navbar-edit-name").val(),F("#navbar-edit-url").val(),F("#navbar-edit-newwindow").prop("checked"),F("#navbar-edit-item").data("edit-usergroups"),[],F("#navbar-edit-attr").val())}else{AR(AM,F("#navbar-edit-name").val(),F("#navbar-edit-url").val(),F("#navbar-edit-newwindow").prop("checked"),F("#navbar-edit-item").data("edit-usergroups"),F("#navbar-edit-attr").val())}AM=null;AK=null;F("#navbar-edit-item").dialog("close");console.log("Done saving new/edited navbar item")}}return false});F(document).on("click","#navbar-edit-cancel",function(){F("#navbar-edit-item").dialog("close");return false});var AQ=false;F(document).on("click","#navbar-edit-usergroups",function(){var Ac=function(){F("#navbar-edit-usergroups-dialog .dialog-body input[type=checkbox]").prop("checked",false);var Af=F("#navbar-edit-usergroups-dialog .select_all");var Ad=function(){if(F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox:checked").length==F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox").length&&F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox").eq(0).is(":checked")){Af.prop("checked",true)}else{Af.prop("checked",false)}};F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox").off("change").on("change",Ad);Af.off("change").on("change",function(){if(F(this).prop("checked")){F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox").prop("checked",true)}else{F("#navbar-edit-usergroups-dialog .navbar-usergroup-checkbox").prop("checked",false)}});if(!AM){return false}console.log("Prefilling checked usergroups");console.log(AM.data("item-name"));console.log(AM.data("item-url"));console.log(AM.data("item-usergroups"));if(AM.data("item-usergroups-temp")){var Ae=AM.data("item-usergroups-temp")}else{var Ae=AM.data("item-usergroups")}console.log(Ae);F.each(Ae,function(Ag,Ah){F("#navbar-edit-usergroups-dialog .dialog-body #navbar-usergroup-checkbox-"+Ah).prop("checked",true)});Ad()};var Ab=function(){var Ad=[];F("#navbar-edit-usergroups-dialog .dialog-body input[type=checkbox]").each(function(){if(F(this).prop("checked")){Ad.push(F(this).val())}});F("#navbar-edit-item").data("edit-usergroups",Ad);if(AM){AM.data("item-usergroups-temp",Ad)}console.log("Saving checked usergroups")};if(!AQ){F("#navbar-edit-usergroups-dialog").dialog({title:vBulletin.phrase.get("user_group_settings"),autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:500,dialogClass:"dialog-container pagemap-dialog-container input-dialog",create:function(){F("#navbar-edit-usergroups-dialog .cancel-button").on("click",function(){F("#navbar-edit-usergroups-dialog").dialog("close")});F("#navbar-edit-usergroups-dialog .save-button").on("click",function(){Ab();F("#navbar-edit-usergroups-dialog").dialog("close")});F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/usergroup/fetchUsergroupList",data:({siteId:1}),type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(Ad){console.log("fetchUsergroupList successful! result:"+JSON.stringify(Ad));if(Ad){console.log("result:",Ad);var Ae=[];F(Ad).each(function(){Ae.push('<div class="blockrow"><label><input type="checkbox" class="navbar-usergroup-checkbox" id="navbar-usergroup-checkbox-{0}" value="{0}"><span>{1}</span></label></div>'.format(this.usergroupid,this.title))});F("#navbar-edit-usergroups-dialog .dialog-body").html(Ae.join(""));F("#navbar-edit-usergroups-dialog").dialog("option","position","center");console.log("Done adding usergroups")}Ac()},error:function(Af,Ae,Ad){console.log("fetchUsergroupList failed! error:"+Ad);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_list_user_groups"),iconType:"error",onAfterClose:function(){F("#config-dialog").dialog("close")}});F("#config-dialog .loader").hide()}})},close:function(){},open:function(){Ac()}});AQ=true}else{F("#navbar-edit-usergroups-dialog").dialog("open")}return false});F("#edit-navbar").on("click",".navbar-item-delete",function(){AS(F(this).closest("li"),"remove");F(this).closest("li").remove();AV();return false});F("#edit-navbar").on("click",".navbar-item-edit",function(){var Ab=F(this).closest("li");console.log("Click to edit item... Name: "+Ab.data("item-name")+" Url: "+Ab.data("item-url")+" NewWindow: "+Ab.data("item-newwindow")+" UserGroups: "+Ab.data("item-usergroups"));AM=Ab;AK=Ab.closest("ul");AM.data("item-usergroups-temp",null);F("#navbar-edit-name").val(Ab.data("item-name"));F("#navbar-edit-url").val(Ab.data("item-url"));F("#navbar-edit-attr").val(Ab.data("item-attr"));F("#navbar-edit-newwindow").prop("checked",Ab.data("item-newwindow"));AJ(F(this).html());return false});F("#edit-navbar").on("click",".navbar-item-opensubnav",function(){var Ab=F(this).closest("li");console.log("Click to open item subnav ... Name: "+Ab.data("item-name")+" Url: "+Ab.data("item-url")+" NewWindow: "+Ab.data("item-newwindow")+" UserGroups: "+Ab.data("item-usergroups"));F("#edit-navbar li").removeClass("h-disabled selected");Ab.addClass("selected");F("#edit-navbar .subnavbar-ui-wrapper ul").hide();F(Ab.data("subnav-element")).show();F("#edit-navbar .subnavbar-ui-wrapper").show();AV();return false});F(document).on("click",".navbar-navbar #admin-navbar-strip .lnkExitWithoutSaving, .navbar-footer #admin-navbar-strip .lnkExitWithoutSaving",function(){F("#edit-navbar").slideUp();F("#header").add("#header-axd").show();if(AP=="navbar"){F("#channel-tabbar ul").html(Aa);F("#channel-subtabbar ul").html(AW).parent(".default-hide").toggleClass("h-hide default-hide")}else{F("#footer-tabbar ul.nav-list").html(Aa)}});var AT=function(){var Ab=[];F("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var Ae=F(this);var Ad=[];Ae.data("subnav-element").find("li").each(function(){$subLi=F(this);Ad.push({phrase:$subLi.data("item-phrase"),title:$subLi.data("item-name"),url:$subLi.data("item-url"),newWindow:$subLi.data("item-newwindow"),usergroups:$subLi.data("item-usergroups"),attr:$subLi.data("item-attr")})});Ab.push({phrase:Ae.data("item-phrase"),title:Ae.data("item-name"),url:Ae.data("item-url"),newWindow:Ae.data("item-newwindow"),usergroups:Ae.data("item-usergroups"),subnav:Ad,attr:Ae.data("item-attr")})});var Ac=(AP=="navbar")?"saveHeaderNavbar":"saveFooterNavbar";F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/site/"+Ac,data:({siteId:1,data:Ab}),type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(Ae){if(Ae.errors){console.log(Ac+" failed! error:"+JSON.stringify(Ae));openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_navigation_bar_configuration"),iconType:"error"});return }console.log(Ac+" successful! result:"+JSON.stringify(Ae));F("#edit-navbar").slideUp();F("#header").add("#header-axd").show();F("#main-navbar ul.main-nav li").removeClass("h-disabled").find("a").removeClass("selected");F("#admin-navbar-strip-gutter").addClass("h-hide");F(document.body).removeClass("edit-mode lnkEditPage lnkNewPage lnkHeader lnkNavBar lnkFooter").addClass("view-mode");F("#main-navbar ul.secondary-nav").removeClass("h-disabled");if(AP=="navbar"){var Ad=false;F("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var Af=F(this);if(AY(Af.data("item-url"))==AU){Ad=true;F("#edit-navbar .navbar-ui-wrapper ul li").removeClass("selected");Af.addClass("selected");return false}});if(Ad){AV()}else{F("#channel-tabbar ul li").removeClass("current");F("#channel-subtabbar ul").html("")}}else{F("#footer-tabbar ul.nav-list li").removeClass("current");F("#footer-tabbar ul.nav-list li").filter(function(){var Af=F(this).find("a").attr("href");return(Af==AU)}).addClass("current")}},error:function(Af,Ae,Ad){console.log(Ac+" failed! error:"+Ad);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_navigation_bar_configuration"),iconType:"error",onAfterClose:function(){F("#config-dialog").dialog("close")}});F("#config-dialog .loader").hide()}})};F(document).on("click",".navbar-navbar #admin-navbar-strip .lnkSaveChanges",function(){AT()});F(document).on("click",".navbar-footer #admin-navbar-strip .lnkSaveChanges",function(){AT()})})();F("#main-navbar .main-nav").removeClass("h-hide");F(document).on("click","#admin-navbar-strip .lnkSaveChanges",function(){});F(document).on("click",".lnkHeader #admin-navbar-strip .lnkSaveChanges",function(){F("body").css("cursor","wait");if(Number(F("#header .site-logo img").attr("data-fileid"))>0){var AJ=AI?function(){location.reload(true)}:null;K(AJ)}else{if(AI){location.reload(true)}else{F("body").css("cursor","auto");F("#main-navbar li").removeClass("h-disabled").find("a").removeClass("selected");F("#admin-navbar-strip-gutter").addClass("h-hide").find(".prompt-text").text("");F(document.body).removeClass("edit-mode lnkHeader").addClass("view-mode");F("#header .disable-overlay").hide();F("#main-navbar ul.secondary-nav").removeClass("h-disabled")}}});F(document).on("click",".lnkHeader #admin-navbar-strip .lnkExitWithoutSaving",function(AK){if(AI){AK.stopImmediatePropagation();location.reload(true);return false}else{var AJ=F("#header .site-logo img");if(AJ.attr("src")!=AJ.attr("data-orig-src")){AJ.attr("src",AJ.attr("data-orig-src")).removeAttr("data-fileid")}F("#admin-navbar-strip-gutter").find(".prompt-text").text("");F("#header .disable-overlay").hide()}});F(document).on("click","#admin-navbar-strip .lnkExitWithoutSaving",function(){F("#main-navbar li").removeClass("h-disabled").find("a").removeClass("selected");F("#admin-navbar-strip-gutter").addClass("h-hide");F(document.body).removeClass("edit-mode lnkEditPage lnkNewPage lnkHeader lnkNavBar lnkFooter").addClass("view-mode");F("#header").add("#header-axd").show();F("#edit-navbar").hide()});F("#header-axd .axdnum").change(function(){var AJ=F(this),AK=parseInt(AJ.val());window.vBulletin.loadingIndicator.show();F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/ad/saveNumberOfHeaderAds",type:"post",data:{number:AK},dataType:"json",success:function(AL){if(AL!==null&&typeof AL.errors!=="undefined"){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AL.errors[0]),iconType:"error"})}else{if(AK==1){F("#header-axd").removeClass("axdnum_2").addClass("axdnum_1")}else{F("#header-axd").removeClass("axdnum_1").addClass("axdnum_2")}}},complete:function(){window.vBulletin.loadingIndicator.hide()}})});F(document).off("click",".axd-edit-button").on("click",".axd-edit-button",function(){var AJ=F(this).attr("data-location"),AO=F(this).closest(".axd-container");if(AO.length==0){AO=F('.axd-container[data-widget-instance-id="'+AJ+'"]')}AN();function AN(AP){AP=AP||false;F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/ad/listAdsByLocation",type:"post",data:{adlocation:AJ},dataType:"json",cache:false,success:function(AQ){if(AQ!==null&&typeof AQ.errors!=="undefined"){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AQ.errors[0]),iconType:"error"})}else{if(AQ){AK(AQ)}else{if(!AP){AL({adlocation:AJ})}else{AK([])}}}},complete:function(){F("body").css("cursor","default")}})}function AK(AP){if(typeof z.axd_list_dialog=="undefined"){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/dialog_axd_list",success:function(AQ){z.axd_list_dialog=AQ;F("body").append(AQ);AK(AP)},error_phrase:"error_fetching_dialog"});return }F("#axd-list-dialog").dialog({title:vBulletin.phrase.get("edit_locationx_ad",AJ),autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:600,dialogClass:"dialog-container ad-list-dialog-container input-dialog",open:function(){var AQ=F(this);var AS=[];for(var AR in AP){AS.push([AP[AR].title,AP[AR].active,AP[AR].displayorder,AP[AR].adid])}F(".title",AQ).text(vBulletin.phrase.get("ad_list_description",AJ));F(".axdtable",AQ).dataTable({bPaginate:false,bLengthChange:false,bInfo:false,bAutoWidth:false,bDestroy:true,aaSorting:[[2,"asc"]],aoColumns:[{sTitle:vBulletin.phrase.get("title")+"<span></span>",sClass:"axdtable-title axd-cell"},{sTitle:vBulletin.phrase.get("active"),sClass:"axdtable-active axd-cell",bSortable:false,bSearchable:false,fnRender:function(AU,AT){return'<input type="checkbox" class="isactive" data-id="{0}"{1} />'.format(AU.aData[3],((AT=="1")?' checked="checked"':""))}},{sTitle:vBulletin.phrase.get("display_order")+"<span></span>",sClass:"axdtable-display-order axd-cell",bSearchable:false,bUseRendered:false,fnRender:function(AU,AT){return'<input type="text" class="displayorder textbox" value="{0}" data-id="{1}" />'.format(AU.aData[2],AU.aData[3])}},{sTitle:vBulletin.phrase.get("action"),sClass:"axdtable-action axd-cell",bSearchable:false,bSortable:false,bUseRendered:false,fnRender:function(AU,AT){return'<a href="#" class="editlink" data-id="{0}" title="{1}"><span></span></a> <a href="#" class="deletelink" data-id="{0}" title="{2}"><span></span></a>'.format(AU.aData[3],vBulletin.phrase.get("edit"),vBulletin.phrase.get("delete"))}}],aaData:AS});F(".dataTables_filter input[type=text]",AQ).addClass("axdfilter textbox").on("keyup",function(){F(this).next()[this.value!=""?"removeClass":"addClass"]("h-hide")}).after('<button type="button" class="axdSearchBtn button secondary h-hide">{0}</button>'.format(vBulletin.phrase.get("reset")));F(".axdSearchBtn",AQ).on("click",function(){F(this).addClass("h-hide").prev().val("").trigger("keyup")});F(".axdtable .editlink",AQ).off("click").on("click",function(){var AT=F(this).attr("data-id");AQ.dialog("close");AQ.dialog("destroy");AL(AP[AT]);return false});F(".axdtable .deletelink",AQ).off("click").on("click",function(){var AT=F(this).attr("data-id"),AU=F(this).closest("tr").find(".isactive").prop("checked");AQ.dialog("close");AQ.dialog("destroy");openConfirmDialog({title:vBulletin.phrase.get("confirm_deletion_x",AP[AT].title),message:vBulletin.phrase.get("are_you_sure_want_to_delete_ad_x",AP[AT].title,"adid",AT),iconType:"warning",onClickYes:function(){F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/ad/delete",type:"post",data:{adid:AT},dataType:"json",success:function(AV){if(AV.errors){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AV.errors[0]),iconType:"error"})}else{AN(true);if(AU){AI=true}}}})},onClickNo:function(){AN()}});return false});F(".axdlist",AQ).show();F(".btnAddAxd",AQ).off("click").on("click",function(){AQ.dialog("close");AQ.dialog("destroy");AL({adlocation:AJ});return false});F(".btnCancelAxd",AQ).off("click").on("click",function(){AQ.dialog("close");AQ.dialog("destroy")});F(".btnSaveAxd",AQ).off("click").on("click",function(){if(F(".isactive",AQ).length==0){AQ.dialog("close");AQ.dialog("destroy");return false}F("body").css("cursor","wait");var AT={},AU=[];F(".isactive",AQ).each(function(){var AV=F(this).attr("data-id");AT[AV]={};AT[AV]["displayorder"]=F('.displayorder[data-id="'+AV+'"]',AQ).val();if(F(this).is(":checked")){AT[AV]["active"]=1;var AW=AT[AV];AW.snippet=AP[AV].snippet;AW.title=AP[AV].title;AU.push(AW)}else{AT[AV]["active"]=0}});F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/ad/quickSave",type:"post",data:{data:AT},dataType:"json",success:function(AV){if(AV.errors){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AV.errors[0]),iconType:"error"})}else{var AW=F(".axd_"+AJ,AO);if(AW.length==0){AW=F(".widget-content",AO)}if(AU.length>0){AU.sort(function(Aa,AZ){return Aa.displayorder-AZ.displayorder});var AY="",AX="";F.map(AU,function(Aa,AZ){if(Aa.snippet){AX+=AH(Aa.snippet,Aa.title);AY+=Aa.snippet}});AW.html(AX);AI=AM(AY)}else{AW.html("")}AW.show();AQ.dialog("close");AQ.dialog("destroy");F("html,body").animate({scrollTop:0},"slow")}},complete:function(){F("body").css("cursor","default")}})})}})}function AL(AQ){var AP=AQ.adlocation;if(typeof z.axd_config_dialog=="undefined"){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/dialog_axd_config",success:function(AR){z.axd_config_dialog=AR;F("body").append(AR);AL(AQ)},error_phrase:"error_fetching_dialog"});return }F("#axd-config-dialog").dialog({title:vBulletin.phrase.get("edit_locationx_ad",AP),autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:720,dialogClass:"dialog-container axd-dialog-container input-dialog",open:function(){var AR=F(this);if(AQ.adid){F(".title",AR).val(AQ.title);F(".axd_html",AR).val(AQ.snippet);if(AQ.active=="1"){F(".active",AR).prop("checked",true)}else{F(".active",AR).prop("checked",false)}F(".axdid",AR).val(AQ.adid);for(var AS in AQ.criterias){F("[name=data\\[criteria\\]\\["+AQ.criterias[AS].criteriaid+"\\]\\[active\\]]",AR).prop("checked",true);F("[name=data\\[criteria\\]\\["+AQ.criterias[AS].criteriaid+"\\]\\[condition1\\]]",AR).val(AQ.criterias[AS].condition1);F("[name=data\\[criteria\\]\\["+AQ.criterias[AS].criteriaid+"\\]\\[condition2\\]]",AR).val(AQ.criterias[AS].condition2);F("[name=data\\[criteria\\]\\["+AQ.criterias[AS].criteriaid+"\\]\\[condition3\\]]",AR).val(AQ.criterias[AS].condition3)}}else{F(".axdid",AR).val(0);F(".configform",AR).trigger("reset")}F(".axd_location",AR).val(AP);F(".blockrow select.custom-dropdown",AR).selectBox();F(".blockrow a.custom-dropdown, .blockrow input[type=text]",AR).on("click",function(AU){return false});F(".btnAttachHtmlAxd",AR).off("click").on("click",function(){var AU=F(".configform",AR).serialize();F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/ad/save",type:"post",data:AU,dataType:"json",success:function(AV){if(AV){if(AV.errors){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AV.errors[0]),iconType:"error"})}else{AT();AI=AM(F(".configform .axd_html",AR).val())}}},complete:function(){F("body").css("cursor","default")}})});F(".btnCancelEditHtmlAxd",AR).off("click").on("click",function(){AT(true)});function AT(AU){AU=AU||false;F(":checkbox",AR).prop("checked",false);F("select",AR).val("");AR.dialog("close");AR.dialog("destory");AN(AU)}}})}function AM(AR){var AQ=F("<div>"+AR+"</div>");if(AQ.filter("script").length>0){return true}else{var AP=AQ.find("*").filter(function(){return(this.nodeName.toLowerCase().indexOf("vb:")==0)?this:null});return(AP.length>0||(/\{vb\s*\:\s*[a-z]+\s+.*\}/).test(AR))}}return false});F("#header .header-cell .edit.button").on("click",function(){F(".header-edit-box.selected").removeClass("selected");F(this).closest(".header-edit-box").addClass("selected");F("#edit-site-logo-dialog").dialog({title:vBulletin.phrase.get("edit_site_logo")+'<span class="dialog-subtitle">'+vBulletin.phrase.get("choose_options_site_logo")+"</span>",autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:520,dialogClass:"dialog-container site-logo-dialog-container input-dialog",create:function(){F("#btnCancelEditSiteLogo").on("click",function(){F("#edit-site-logo-dialog").dialog("close")});F("#btnSaveEditSiteLogo").on("click",function(){if(Number(F("#header .site-logo img").attr("data-fileid"))>0){K(function(){F("#edit-site-logo-dialog").dialog("close")})}else{F("#edit-site-logo-dialog").dialog("close")}});F("#edit-site-logo-dialog .styleselection").change(function(){F("#header .site-logo img").attr({"data-styleselection":F(this).val()})});F("#edit-site-logo-dialog").fileupload({dropZone:null,dataType:"json",add:function(AK,AJ){F("body").css("cursor","wait");F(AK.target).find(".upload-progress-bar:first").removeClass("h-hide");AJ.submit()},done:function(AK,AJ){if(AJ.result&&AJ.result.filedataid){F("#header .site-logo img").attr({src:AJ.result.imageUrl,"data-fileid":AJ.result.filedataid,"data-styleselection":F("#edit-site-logo-dialog .styleselection:checked").val()})}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_uploading_logo"),iconType:"error"})}},fail:function(AK,AJ){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_uploading_logo"),iconType:"error"})},always:function(AK,AJ){F("body").css("cursor","auto");F(AK.target).find(".upload-progress-bar:first").addClass("h-hide")}});F("#edit-site-logo-dialog #btnAttachLogo").on("click",function(){var AJ=F.trim(F("#edit-site-logo-dialog #imageUrl").val());if(AJ){F("body").css("cursor","wait");F(this).closest(".dialog-content").find(".upload-progress-bar:last").removeClass("h-hide");F.ajax({url:vBulletin.getAjaxBaseurl()+"/uploader/Url",data:({urlupload:AJ}),type:"POST",dataType:"json",complete:function(){console.log("uploader/url complete.");F("body").css("cursor","auto");F("#edit-site-logo-dialog .upload-progress-bar:last").addClass("h-hide")},success:function(AK){console.log("saving site logo successful! result:"+AK);if(AK&&!AK.error){F("#header .site-logo img").attr({src:AK.imageUrl,"data-fileid":AK.filedataid,"data-styleselection":F("#edit-site-logo-dialog .styleselection:checked").val()})}else{if(AK.error){openAlertDialog({title:vBulletin.phrase.get("edit_site_logo"),message:vBulletin.phrase.get("invalid_image_url"),iconType:"warning",onAfterClose:function(){F("#edit-site-logo-dialog #imageUrl").select().focus()}})}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_processing_site_logo"),iconType:"error",onAfterClose:function(){F("#edit-site-logo-dialog #imageUrl").focus()}})}}},error:function(AM,AL,AK){console.log("remote url site logo failed! error:"+AK);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_processing_site_logo_image_hosting",AM.status),iconType:"error",onAfterClose:function(){F("#edit-site-logo-dialog #imageUrl").focus()}})}})}else{F("#edit-site-logo-dialog #imageUrl").focus()}})}})});F(".admin-button-flat").disableSelection();D=F("#edit-content .tabs").tabs({show:function(AJ,AK){S(AK.index);A()},select:function(AK,AL){F("#save-content").hide();if(AL.index==1){if(e){F("#edit-page-dropdown .layout-list .layout-border.selected").removeClass("selected");var AJ=F("#edit-page-dropdown .layout-list input[type=radio][value={0}]".format(F(".canvas-layout:visible").attr("data-layout-id")));AJ.prev().addClass("selected");u="canvas-"+AJ.attr("id")}}}});F("#lnkAddModules").on("click",function(){D.tabs("select",0);return false});y();F(document).on("click",".module-buttons .hide-icon input",function(){var AK=F(this);AK.closest(".canvas-widget")[this.checked?"addClass":"removeClass"]("hidden-widget");var AJ=AK.attr("title");AK.attr("title",AK.data("toggle-title")).data("toggle-title",AJ)});F(".canvas-layout-container .canvas-layout").each(function(){s[this.id]=F("#"+this.id+' div[class*="section-"]').length});if(!n){u="canvas-"+F("#edit-page-dropdown .layout-list input[type=radio][value={0}]".format(F(".canvas-layout:visible").attr("data-layout-id"))).prop("checked",true).attr("id")}k=F("#edit-page-dropdown .layout-list input[type=radio]").thumbnailRadioCheckbox({thumbnailClass:"layout-border"});k.thumbnailRadioCheckbox("option","select",function(AK,AJ){F(".canvas-layout").addClass("h-hide");F("#canvas-"+AJ.attr("id")).removeClass("h-hide");g("canvas-"+AJ.attr("id"));c();AD();l=true});(function(){F(".lnkPageMap").on("click",function(){F("#page-map-dialog").dialog({title:vBulletin.phrase.get("page_map"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:500,dialogClass:"dialog-container pagemap-dialog-container input-dialog",create:function(){F("#btnClosePageMapDialog").on("click",function(){F("#page-map-dialog").dialog("close")});F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/page/fetchPageMapHierarchy",data:({pageId:pageData.pageid}),type:"POST",dataType:"json",complete:function(){console.log("/ajax/api/page/fetchPageMapHierarchy complete");F("body").css("cursor","auto")},success:function(AU){console.log("/ajax/api/page/fetchPageMapHierarchy successful");if(AU&&F.isArray(AU.pageMap)){var AP,AO,AM="",AQ,AS,AT,AL,AJ,AK,AN,AR;for(AP=0;AP<AU.pageMap.length;++AP){AQ=AU.pageMap[AP].page;AS=AU.pageMap[AP].siblings;AM+="<ul>";for(AO=0;AO<AS.length;++AO){AT=AS[AO];AJ=(AT.pageid==AQ.pageid)?' class="current-path"':"";AJ=(AT.pageid==AQ.pageid&&((AP+1)==AU.pageMap.length))?' class="current-path-end"':AJ;AL=((AP+1)==AU.pageMap.length)?"":"<span>&gt;</span>";AK=(AT.pageid==AQ.pageid&&((AP+1)==AU.pageMap.length))?'<div id="you-are-here" class="round-corner7"><div class="arrow"><div class="arrow-inner"></div></div>'+vBulletin.phrase.get("you_are_here")+"</div>":"";AM+="<li"+AJ+">"+AL+'<a href="'+pageData.baseurl+AT.url+'">'+vBulletin.htmlEntities(AT.title)+"</a>"+AK+"</li>"}AM+="</ul>"}F("#page-map-content").html(AM);AN=F("#you-are-here").parent().outerWidth()+10;F("#you-are-here").css({left:AN,top:-10})}else{console.log(AU);console.log("/ajax/api/page/fetchPageMapHierarchy successful, but response was not an array");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AL,AK,AJ){console.log("/ajax/api/page/fetchPageMapHierarchy failed, error: "+AJ);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_page_map",AL.status),iconType:"error"})}})},close:function(){}});F("#page-map-dialog").dialog("open");return false})})()}function g(AH){if(!u){F(".canvas-layout.h-hide input[type=hidden]").prop("disabled",true);F("#"+AH+" input[type=hidden]").prop("disabled",false);u=AH;return }else{if(u==AH){return }else{F(".canvas-layout.h-hide input[type=hidden]").prop("disabled",true);F("#"+AH+" input[type=hidden]").prop("disabled",false);var AF=s[AH];var AI=false;var AG=0;F("#"+u+" > .canvas-layout-row > div.canvas-widget-list").each(function(){AG=a(this);AI=F("#"+AH+" > .canvas-layout-row > div.section-"+AG);if(!AI.length){var AJ=AF;while(AJ>=0&&F("#"+AH+" > .canvas-layout-row > div.section-"+AJ).length==0){AJ--}AI=F("#"+AH+" > .canvas-layout-row > div.section-"+AJ)}F(this).children("div.canvas-widget").appendTo(AI)})}}u=AH}function a(AH){var AG=/section-(\d+)/gi;var AF=null;F(F(AH).attr("class").split(" ")).each(function(AJ,AK){var AI=AG.exec(AK);if(AI&&!isNaN(AI[1])){AF=AI[1]}});return AF}function H(AF){if(!F.isArray(AF)||AF.length==0){return }window.vBulletin.loadingIndicator.show();F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/admin-template/widget",data:({widgets:AF,pagetemplateid:F("#save-page-form #pagetemplateid-yes").val()}),type:"POST",dataType:"json",complete:function(){console.log("admin-template/widget complete. moduleLoaded="+d);if(d){window.vBulletin.loadingIndicator.hide()}F("body").css("cursor","auto")},success:function(AG){console.log("admin-template/widget successful! result:"+JSON.stringify(AG));W=true;if(AG&&F.isArray(AG.widgets)){F.each(AG.widgets,function(AH,AJ){if(!AJ.widgetid||Number(AJ.widgetid)<1||!F.trim(AJ.template)){return true}var AK=(AJ.displaysection&&Number(AJ.displaysection)>0)?AJ.displaysection:0;var AI=F(AJ.template);AI.appendTo(F(".canvas-layout:not(.h-hide) .canvas-widget-list.section-"+AK).height("auto")).filter(":not(.container-widget)").find(".toggle-button").trigger("click",[true]);AI.find(".tabs").tabs()})}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AI,AH,AG){console.log("admin-template/widget failed! error:"+AG);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_adding_widgets",AI.status),iconType:"error"})}});return false}function v(AF,AG){if(AF.text()=="<"){AF.text(">");AF.closest(".channel-item-container").children(".sub-channel-container").children(".channel-item-container").slideDown(150)}else{if(typeof (AG)==="undefined"||!AG){AF.text("<");AF.closest(".channel-item-container").children(".sub-channel-container").children(".channel-item-container").slideUp(150)}}}function Z(){F(".channel-config-dialog .channel-list").sortable({placeholder:"main-channel-container-highlight drag-highlight h-clear",update:function(AF,AG){AG.item.css("z-index","0");I.forum=true;Y=true},sort:function(AF,AG){},start:function(AF,AG){if(F.browser.msie&&parseInt(F.browser.version,10)==8){AG.item.height(AG.item.height()-4)}AG.item.css("z-index","99999");AG.placeholder.height(AG.item.outerHeight())},over:function(AF,AG){},receive:function(AF,AG){},out:function(AF,AG){},handle:".grip-icon-main",items:".main-channel-container"})}function r(AF){AC=AF.find(".main-channel-container").sortable({connectWith:".sub-channel-container",placeholder:"channel-item-highlight drag-highlight",revert:true,update:function(AG,AH){var AI=AH.item.closest(".main-channel-container");if(AH.sender&&AH.sender.hasClass("main-channel-container")){if(F("> .channel-item-container",AH.sender).length==0){AH.sender.slideUp("fast",function(){F(this).remove()})}}I.forum=true;Y=true},sort:function(AG,AH){},activate:function(AG,AH){},start:function(AG,AH){},stop:function(AG,AH){F(".main-channel-container, .sub-channel-container").height("auto")},over:function(AG,AH){},receive:function(AG,AH){},out:function(AG,AH){},handle:".channel-item-inner > .grip-icon-item",items:".channel-item-container"})}function J(AF){j=AF.find(".sub-channel-container").sortable({connectWith:".sub-channel-container",revert:true,placeholder:"channel-item-highlight drag-highlight",update:function(AG,AH){if(AH.sender&&AH.sender.hasClass("main-channel-container")){if(F("> .channel-item-container",AH.sender).length==0){AH.sender.slideUp("fast",function(){F(this).remove()})}}I.forum=true;Y=true},sort:function(AG,AH){},start:function(AG,AH){},stop:function(AG,AH){F(".main-channel-container, .sub-channel-container").height("auto")},over:function(AH,AI){var AG=F(this).closest(".channel-item-container").children(".channel-item").find(".toggle-button");v(AG,true)},receive:function(AG,AH){},out:function(AG,AH){},handle:".channel-item-inner > .grip-icon-item",items:".channel-item-container"})}function AE(AF,AI,AJ,AK,AN,AP,AM){var AL='<div class="'+(AN?"category-to-channel":"channel-to-category")+'"><a href="#">'+vBulletin.phrase.get((AN?"make_forum":"make_category"))+"</a></div>";var AO=F(('<div class="main-channel-container">					<div class="grip-icon grip-icon-main h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>					<div class="channel-item-container">						<div class="channel-item shadow" data-channel-id="{0}" data-parent-id="{2}">							<div class="channel-item-inner">								<div class="grip-icon grip-icon-item h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>								<div class="channel-title"><div title="'+vBulletin.phrase.get("click_text_edit_title")+'">{1}</div><input type="text" name="channeltitle" value="{1}" /></div>								<div class="close-button" title="'+vBulletin.phrase.get("remove_forum")+'">x</div>								<div class="toggle-button"><</div>								<div class="num-subchannels">'+AM+'</div>								<div class="add-subchannel-button h-right" title="'+vBulletin.phrase.get("add_subforum")+'"><a href="#">+</a></div>								'+AL+'								<div class="h-clear"></div>							</div>						</div>						<div class="sub-channel-container"></div>					</div>			 </div>').format(AI,AK,AJ)).appendTo(AF);if(AP){var AG=F("#top-level-forum .channel-config-dialog .channel-list");var AH=AG.find(".main-channel-container").last();F("html, body").animate({scrollTop:AH.offset().top},"fast")}I.forum=true;Y=true;return AO}function AA(AH,AI,AJ,AM,AG,AL){var AK='<div class="'+(AM?"category-to-channel":"channel-to-category")+'"><a href="#">'+vBulletin.phrase.get((AM?"make_forum":"make_category"))+"</a></div>";var AN=AG.hasClass("main-channel-container")?F("> .channel-item-container > .sub-channel-container",AG):F("> .sub-channel-container",AG);var AF=F(('<div class="channel-item-container">					<div class="channel-item shadow" data-channel-id="{0}" data-parent-id="{2}">						<div class="channel-item-inner">							<div class="grip-icon grip-icon-item h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>							<div class="channel-title"><div title="Click text to edit title">{1}</div><input type="text" name="channeltitle" value="{1}" /></div>							<div class="close-button" title="'+vBulletin.phrase.get("remove_forum")+'">x</div>							<div class="toggle-button"><</div>							<div class="num-subchannels">'+AL+'</div>							<div class="add-subchannel-button h-right" title="'+vBulletin.phrase.get("add_subforum")+'"><a href="#">+</a></div>							'+AK+'							<div class="h-clear"></div>						</div>				 </div>				 <div class="sub-channel-container"></div>				</div>').format(AH,AJ,AI)).hide().appendTo(AN);I.forum=true;Y=true;return AF}function q(){window.vBulletin.loadingIndicator.show();F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/fetch-widget-admin-template-list",dataType:"json",complete:function(){console.log("fetch-widget-admin-template-list complete. templatesLoaded="+T);if(T){window.vBulletin.loadingIndicator.hide()}F("body").css("cursor","auto");A();F(window).resize(A)},success:function(AH){console.log("fetch-widget-admin-template-list successful! result:");console.dir({result:AH});d=true;if(F.isArray(AH)){if(AH.length>0){var AI={},AM=0,AJ=[];AI.customized_copy={count:0,title:vBulletin.phrase.get("my_custom_modules")};F.each(AH,function(AO,AP){if(!AP.widgetid||Number(AP.widgetid)<1){return true}AM++;if(!AI[AP.category]){AI[AP.category]={count:1,title:AP.category_title}}else{AI[AP.category].count++}var AN=F("#edit-page-dropdown .module-list .module-icon-template").clone();AN.attr("data-widget-id",AP.widgetid).attr("data-title",F.trim(AP.title).toLowerCase()).data("canbemultiple",AP.canbemultiple).removeClass("module-icon-template").addClass(("module-item list-item category-{0}"+(AP.cloneable=="1"?" module-cloneable":"")).format(AP.category));F(".module-icon",AN).html(F("<img />").attr("src",pageData.baseurl+"/"+pageData.admincpdir+"/img/"+F.trim(AP.icon)).attr("height",60).attr("width",60).attr("alt",vBulletin.phrase.get("module_icon")));F(".module-title .main-title",AN).html(F.trim(AP.title));AN.appendTo("#edit-page-dropdown .module-list").removeClass("h-hide");if(AP.category=="customized_copy"){AJ.push(AP.widgetid)}});F(".canvas-layout-container .canvas-widget").filter(function(){var AN=F(this).attr("data-widget-id");return(F.inArray(AN,AJ)!=-1)}).find(".module-buttons .edit-button").hide();F('<div class="custom-module-manage-links">								<a href="#" class="edit">'+vBulletin.phrase.get("edit")+'</a> 								<a href="#" class="rename">'+vBulletin.phrase.get("rename")+'</a> 								<a href="#" class="delete">'+vBulletin.phrase.get("delete")+"</a>							</div>").appendTo("#add-modules .module-list .category-customized_copy");F("#add-modules").on("click",".custom-module-manage-links a",function(AQ){AQ.preventDefault();var AS=F(this).attr("class");var AP=F(this).closest(".canvas-widget");if(AS=="edit"){AP.find(".module-buttons .admin-only .edit-button").click()}else{if(AS=="rename"){AP.draggable("disable");var AO=F(this);AO.hide();var AR=F(".main-title",AP);var AN=AR.text();AR.html('<input type="text" class="titleinput textbox" autocomplete="off" style="-moz-user-select:text;width:100%;" value="'+AN+'"> <a href="#" class="save">'+vBulletin.phrase.get("save")+'</a> <a href="#" class="cancel">'+vBulletin.phrase.get("cancel")+"</a>");F("a.save",AR).on("click",function(AT){AT.preventDefault();if(F(".titleinput",AR).val()==""){openAlertDialog({title:vBulletin.phrase.get("rename_custom_module"),message:vBulletin.phrase.get("please_enter_new_module_title"),iconType:"warning",onAfterClose:function(){F(".titleinput",AR).focus()}})}F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/renameWidget",type:"POST",data:{widgetId:AP.attr("data-widget-id"),newtitle:F(".titleinput",AR).val()},dataType:"json",success:function(AU){F("body").css("cursor","auto");if(AU===true){AN=F(".titleinput",AR).val();AR.text(AN);AO.show()}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){F("#config-dialog .action-buttons button").prop("disabled",false)}})}},error:function(AW,AV,AU){F("body").css("cursor","auto");openAlertDialog({title:vBulletin.phrase.get("rename_custom_module"),message:vBulletin.phrase.get("error_renaming_module_title"),iconType:"error",onAfterClose:function(){F(".titleinput",AR).focus()}})},complete:function(AV,AU){AP.draggable("enable")}})});F("a.cancel",AR).on("click",function(AT){AT.preventDefault();AR.text(AN);AO.show();AP.draggable("enable")})}else{if(AS=="delete"){alert("Deleting is not yet implemented")}}}});F('<div id="create-custom-module" class="non-module-item canvas-widget module-item list-item category-customized_copy h-hide">								<div class="widget-header">									<div class="module-icon"><a href="#" title="'+vBulletin.phrase.get("create_new_custom_module")+'"><img width="60" height="60" alt="Create New Custom Module" src="'+pageData.baseurl+'/admincp/img/module-icon-create-new.png"></a></div>									<div class="module-title h-left"><a href="#" title="'+vBulletin.phrase.get("create_new_custom_module")+'">'+vBulletin.phrase.get("create_new_custom_module")+'</a></div>									<div class="h-clear"></div>								</div>							</div>').prependTo("#edit-page-dropdown .module-list");F("#create-custom-module a").on("click",function(){F("#create-new-module-dialog").dialog({title:vBulletin.phrase.get("choose_base_module"),autoOpen:true,modal:true,resizable:false,closeOnEscape:true,showCloseButton:true,width:950,dialogClass:"dialog-container pagemap-dialog-container input-dialog",create:function(){F("#create-new-module-dialog .cancel-button").on("click",function(){F("#create-new-module-dialog").dialog("close")});$modulelist=F(".module-list-container").clone();F("#create-new-module-dialog .dialog-body").append($modulelist);F("#create-new-module-dialog #create-custom-module").remove();F("#create-new-module-dialog .module-item").not(".module-cloneable").remove();F("#create-new-module-dialog .categories .category").each(function(){var AN=F(this).attr("id").substr("category-".length);var AO=F("#create-new-module-dialog .module-item").filter(".category-"+AN).size();if(AN=="all"){F(this).text("All ({0})".format(F("#create-new-module-dialog .module-item").size()))}else{if(AO<1){F(this).hide()}else{F(this).text((AI[AN].title+" ({0})").format(AO))}}});F("#create-new-module-dialog .module-list").css("width","800px");F("#create-new-module-dialog .module-item").css("cursor","pointer");F("#create-new-module-dialog .module-item").on("click",function(){window.vBulletin.loadingIndicator.show();var AN=F(this).attr("data-widget-id");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/cloneWidget",data:({widgetId:AN}),type:"POST",dataType:"json",complete:function(){console.log("/ajax/api/widget/cloneWidget complete");F("body").css("cursor","auto")},success:function(AO){if(AO&&typeof AO.widget=="object"){console.log("/ajax/api/widget/cloneWidget successful");console.log(AO);F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/fetch-widget-admin-template-list",data:({widgetids:[AO.widget.widgetid]}),type:"POST",dataType:"json",success:function(AP){if(F.isArray(AP)&&AP.length==1){var AR=AP[0];console.log("/ajax/fetch-widget-admin-template-list successful");console.log(AR);++AI[AR.category].count;var AQ=F("#edit-page-dropdown .module-list .module-icon-template").clone();AQ.attr("data-widget-id",AR.widgetid).attr("data-title",F.trim(AR.title).toLowerCase()).data("canbemultiple",AR.canbemultiple).removeClass("module-icon-template").addClass(("module-item list-item category-{0}"+(AR.cloneable=="1"?" module-cloneable":"")).format(AR.category));F(".module-icon",AQ).html(F("<img />").attr("src",pageData.baseurl+"/"+pageData.admincpdir+"/img/"+F.trim(AR.icon)).attr("height",60).attr("width",60).attr("alt",vBulletin.phrase.get("module_icon")));F(".module-title .main-title",AQ).html(F.trim(AR.title));AQ.insertAfter("#add-modules #create-custom-module").removeClass("h-hide");AQ.draggable({connectToSortable:".canvas-layout-row > .canvas-widget-list:visible",helper:"clone",revert:"invalid",appendTo:"#add-modules .module-list-container",zIndex:2000,start:function(AT,AU){if(F(this).data("canbemultiple")=="0"&&F("#content .canvas-layout .canvas-widget[data-widget-id={0}]".format(F(this).attr("data-widget-id"))).length>0){openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("adding_multiple_modules_not_allowed",F(".main-title",this).html()),iconType:"warning"});return false}X=true},stop:function(AT,AU){X=false}}).disableSelection();var AS=F("#add-modules .module-item").filter(".category-customized_copy").not(".non-module-item").size();F("#add-modules #category-customized_copy").text((AI.customized_copy.title+" ({0})").format(AS));F("#add-modules #category-all").click();F("#add-modules #category-customized_copy").click();F('<div class="custom-module-manage-links">																		<a href="#" class="edit">'+vBulletin.phrase.get("edit")+'</a> 																		<a href="#" class="rename">'+vBulletin.phrase.get("rename")+'</a> 																		<a href="#" class="delete">'+vBulletin.phrase.get("delete")+"</a>																	</div>").appendTo(AQ);window.vBulletin.loadingIndicator.hide();AQ.css("background-color","#2E3741");AQ.effect("highlight",{color:"#FFFF00"},2000,function(){F(this).css("background-color","transparent")})}else{console.log("/ajax/fetch-widget-admin-template-list successful, but response was not an array");console.log(AP);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AR,AQ,AP){console.log("/ajax/fetch-widget-admin-template-list failed, error: "+AP);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_cloned_widget_template",AR.status),iconType:"error"})}});F("#create-new-module-dialog").dialog("close")}else{console.log("/ajax/api/widget/cloneWidget successful, but response was not an array");console.log(AO);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AQ,AP,AO){console.log("/ajax/api/widget/cloneWidget failed, error: "+AO);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_cloning_widget",AQ.status),iconType:"error"})}})})},close:function(){F("#create-new-module-dialog .dialog-body").html("");F("#create-new-module-dialog").dialog("destroy")},open:function(){var AN=function(){var AO=F("#create-new-module-dialog .list-item");var AP=Math.max(AO.outerWidth(true)*AO.filter(":visible").length,parseFloat(AO.parent().css("min-width"),10));AO.parent().width(AP)};AN();B[3]=F("#create-new-module-dialog .module-list-container");B[3].tinyscrollbar({sizethumb:14,axis:"x",update:function(){}});B[3].tinyscrollbar_update();F("#create-new-module-dialog .categories .category").on("click",function(AQ){AQ.stopPropagation();var AO=F(this).closest(".module-list-container");var AR=F(".module-item",AO);F(".category.selected",AO).removeClass("selected");F(this).addClass("selected");AR.hide();F(".empty-module",AO).hide();var AP=this.id;if(AP=="category-all"){AR.show();F(".non-module-item",AO).hide();AN();B[3].tinyscrollbar_update()}else{if(AP=="category-result"){F("#search-module-keyword").triggerHandler("keyup",[true])}else{F(".module-item.{0}".format(AP),AO).show();AN();B[3].tinyscrollbar_update()}}return false}).disableSelection();F("#create-new-module-dialog #category-all").click()}});return false});F(('<div class="category-arrow-left h-left" title="'+vBulletin.phrase.get("previous")+'">&lsaquo;</div>								<div class="scroller category h-left">									<div class="categories h-left">										<div id="category-all" class="category selected">'+vBulletin.phrase.get("all")+' ({0})</div>										<div id="category-result" class="category h-hide">'+vBulletin.phrase.get("search_results")+' (<span></span>)</div>									</div>								</div>								<div class="category-arrow-right h-left" title="'+vBulletin.phrase.get("next")+'">&rsaquo;</div>								<div class="h-clear"></div>').format(AM)).insertBefore("#edit-page-dropdown .module-list-container .scroller");var AG=0;F.each(AI,function(AO,AP){var AN=F('<div id="category-{0}" class="category">{1} ({2})</div>'.format(AO,AP.title,AP.count)).insertBefore("#category-result");AG+=AN.outerWidth(true)});var AL=AG+F("#category-all").outerWidth(true);F(".categories").width(AL);if(F(".categories").width()<=F(".scroller.category").width()){F(".category-arrow-left, .category-arrow-right").css("visibility","hidden")}else{F(".category-arrow-right").css("visibility","visible")}S(0);B[0]=F("#add-modules .module-list-container");B[0].tinyscrollbar({sizethumb:14,axis:"x",update:function(){if(F("#add-modules .module-list-container").innerHeight()<F("#add-modules .panel-header-text").height()){F("#add-modules .panel-header-text").height(F("#add-modules .module-list-container").innerHeight())}}});F("#edit-page-dropdown .module-list .module-item").not(".non-module-item").draggable({connectToSortable:".canvas-layout-row > .canvas-widget-list:visible",helper:"clone",revert:"invalid",appendTo:"#add-modules .module-list-container",zIndex:2000,start:function(AN,AO){if(F(this).data("canbemultiple")=="0"&&F("#content .canvas-layout .canvas-widget[data-widget-id={0}]".format(F(this).attr("data-widget-id"))).length>0){openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("adding_multiple_modules_not_allowed",F(".main-title",this).html()),iconType:"warning"});return false}X=true},stop:function(AN,AO){X=false}}).disableSelection();var AF=false;F("#search-module-keyword").on("keyup",function(AN,AV){var AU=F("#add-modules");var AR=F("#category-result");var AO=F(".categories",AU);var AP=F(".scroller.category",AU);var AQ=false;F(".module-item",AU).hide();if(!AV){F(".category.selected",AU).removeClass("selected")}var AT=F.trim(this.value.toLowerCase());if(AT){F('.module-item[data-title*="{0}"]'.format(AT),AU).show();AR.removeClass("h-hide").addClass("selected")}else{F(".module-item",AU).show();F("#category-all").removeClass("h-hide").addClass("selected");AR.addClass("h-hide").removeClass("selected");AQ=true}var AW=F(".module-item:visible",AU).length;F("span",AR).text(AW);S(0);B[0].tinyscrollbar_update();if(AW==0){F(".empty-module",AU).show()}else{F(".empty-module",AU).hide()}if(AQ){AO.width(AL)}else{AO.width(AL+AR.outerWidth(true))}if(AO.width()<=AP.width()){F(".category-arrow-left, .category-arrow-right",AU).css("visibility","hidden");AP.scrollLeft(0)}else{if(AQ){F(".category-arrow-left",AU).css("visibility","hidden");F(".category-arrow-right",AU).css("visibility","visible");AP.scrollLeft(0)}else{F(".category-arrow-left",AU).css("visibility","visible");F(".category-arrow-right",AU).css("visibility","hidden");var AS=AP.get(0);AP.scrollLeft(AS.scrollWidth-AS.clientWidth)}}return true});F("#add-modules .categories .category").on("click",function(AP){AP.stopPropagation();if(F(this).hasClass("selected")){return false}var AN=F(this).closest(".module-list-container");var AQ=F(".module-item",AN);F(".category.selected",AN).removeClass("selected");F(this).addClass("selected");AQ.hide();F(".empty-module",AN).hide();var AO=this.id;if(AO=="category-all"){AQ.show();F(".non-module-item",AN).hide();S(0);B[0].tinyscrollbar_update()}else{if(AO=="category-result"){F("#search-module-keyword").triggerHandler("keyup",[true])}else{F(".module-item.{0}".format(AO),AN).show();S(0);B[0].tinyscrollbar_update()}}return false}).disableSelection();var AK;F(".category-arrow-left").on({mousedown:function(){F(".category-arrow-right").css("visibility","visible");AK=setInterval(function(){var AN=F(".scroller.category");AN.scrollLeft(AN.scrollLeft()-20);if(AN.scrollLeft()==0){F(".category-arrow-left").css("visibility","hidden");clearInterval(AK)}},50)},mouseup:function(){clearInterval(AK)}}).disableSelection();F(".category-arrow-right").on({mousedown:function(){F(".category-arrow-left").css("visibility","visible");AK=setInterval(function(){var AO=F(".scroller.category");AO.scrollLeft(AO.scrollLeft()+20);var AN=AO.get(0);if(AO.scrollLeft()==AN.scrollWidth-AN.clientWidth){F(".category-arrow-right").css("visibility","hidden");clearInterval(AK)}},50)},mouseup:function(){clearInterval(AK)}}).disableSelection()}else{F('<div class="empty-module">'+vBulletin.phrase.get("no_modules")+"</div>").appendTo("#edit-page-dropdown .module-list")}}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(AH,AG,AF){console.log("fetch-widget-admin-template-list failed! error:"+AF);window.vBulletin.loadingIndicator.hide();openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_modules",AH.status),iconType:"error"})}})}function G(){window.vBulletin.loadingIndicator.show();F("body").css("cursor","wait");F("#edit-page-dropdown .template-list").empty();F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/pagetemplate/fetchPageTemplateList",dataType:"json",complete:function(){console.log("fetchPageTemplateList complete.");if(d){window.vBulletin.loadingIndicator.hide()}F("body").css("cursor","auto")},success:function(AF){console.log("fetchPageTemplateList successful! result:");console.dir({templates:AF});T=true;if(F.isArray(AF)&&AF.length>0){F.each(AF,function(AG,AH){F('<div class="template-item list-item h-left">									<input type="radio" id="pagetemplateid-{0}" name="pagetemplateid" value="{0}" data-thumbnail="{1}/{2}/img/template-icon-default.png"{3} />									<label class="label">{4}</label>								</div>'.format(AH.pagetemplateid,pageData.baseurl,pageData.admincpdir,(!n&&F("#save-page-form #pagetemplateid-yes").val()==AH.pagetemplateid)?' checked="checked"':"",AH.title)).appendTo("#edit-page-dropdown .template-list").data({screenlayoutid:AH.screenlayoutid,widgetinstances:AH.widgetinstances})});F(".template-item",F("#edit-page-dropdown .template-list")).each(function(AG){F(this).attr("data-title",F(".label",F(this)).text().toLowerCase())});F("#search-template-keyword").on("keyup",function(AK){if(AK.keyCode==13){AK.preventDefault();return false}var AH=F("#select-template");var AL=F(".scroller",AH);var AJ=false;F(".template-item",AH).hide();var AG=F.trim(this.value.toLowerCase());if(AG){F('.template-item[data-title*="{0}"]'.format(AG),AH).show()}else{F(".template-item",AH).show();AJ=true}var AI=F(".template-item:visible",AH).length;S(2);B[2].tinyscrollbar_update();if(AI==0){F(".empty-template",AH).show()}else{F(".empty-template",AH).hide()}return true});F("#search-template-keyword").on("keydown",function(AG){if(AG.keyCode==13){AG.preventDefault();return false}});i=F("#edit-page-dropdown .template-list .template-item input[type=radio]").thumbnailRadioCheckbox({thumbnailClass:"template-border",preselect:function(AH,AG){if(AG.is(":checked")){return false}if(l||Y){openConfirmDialog({title:vBulletin.phrase.get("switch_template"),message:vBulletin.phrase.get("template_changes_will_be_lost"),iconType:"warning",onClickYes:function(){l=false;Y=false;e=true;i.thumbnailRadioCheckbox("check",AG,true)}});return false}e=true;return true},select:function(AK,AG){F(".canvas-layout").addClass("h-hide");var AI=AG.closest(".template-item").data("screenlayoutid");F(".canvas-layout[data-layout-id="+AI+"]").removeClass("h-hide");c();AD();F("#save-page-form #pagetemplateid-yes, #config_pagetemplateid").val(AG.val());if(e){F(".canvas-widget-list").empty();var AH=AG.closest(".template-item").data("widgetinstances");if(F.isArray(AH)&&AH.length>0){W=false;var AJ=[];F.each(AH,function(AL,AM){AJ.push({widgetid:AM.widgetid,widgetinstanceid:AM.widgetinstanceid})});H(AJ,true);b()}else{window.vBulletin.loadingIndicator.hide()}}F("body").removeClass("lnkNewPage").addClass("lnkEditPage");F("#save-page-form .new-page-template input").prop("disabled",true);F("#save-page-form .edit-page-template input").prop("disabled",false);e=true},unselect:function(){}});S(2);B[2]=F("#select-template .template-list-container");B[2].tinyscrollbar({sizethumb:14,axis:"x",update:function(){if(F("#select-template .template-list-container").innerHeight()<F("#select-template .panel-header-text").height()){F("#select-template .panel-header-text").height(F("#select-template .template-list-container").innerHeight())}}})}else{window.vBulletin.loadingIndicator.hide();openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_templates"),iconType:"error"})}},error:function(AH,AG,AF){console.log("fetchPageTemplateList failed! error:"+AF);window.vBulletin.loadingIndicator.hide();openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_modules",AH.status),iconType:"error"})}})}function K(AF,AH,AG){F.ajax({url:vBulletin.getAjaxBaseurl()+"/uploader/set_logo",data:({filedataid:F("#header .site-logo img").attr("data-fileid"),styleselection:F("#header .site-logo img").attr("data-styleselection")}),type:"POST",dataType:"text",complete:function(){console.log("uploader/set_logo complete.");F("body").css("cursor","auto")},success:function(AI){console.log("saving site logo successful! result:"+AI);if(F.trim(AI)==="true"){F("#header .site-logo img").removeAttr("data-styleselection").removeAttr("data-fileid").attr("data-orig-src",F("#header .site-logo img").attr("src"));F("#main-navbar li").removeClass("h-disabled").find("a").removeClass("selected");F("#admin-navbar-strip-gutter").addClass("h-hide").find(".prompt-text").text("");F(document.body).removeClass("edit-mode lnkHeader").addClass("view-mode");F("#header .disable-overlay").hide();F("#main-navbar ul.secondary-nav").removeClass("h-disabled");if(typeof AF=="function"){AF()}}else{console.log("saving site logo failed!");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_site_logo"),iconType:"error"});if(typeof AH=="function"){AH()}}},error:function(AK,AJ,AI){console.log("saving site logo failed! error:"+AI);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_site_logo_code",AK.status),iconType:"error"});if(typeof AG=="function"){AG()}}})}function O(AF,AG){F.each(AF,function(AI,AH){var AJ=F(('<div class="sub-channel channel" data-channel-id="{0}" data-parent-id="{6}">					<div class="avatar h-left"></div>					<div class="title"><a href="{1}{2}">{3}</a></div>					<div class="info">						<span class="label">'+vBulletin.phrase.get("last_post")+':</span>						<span class="title">{4}</span>					</div>					<div class="h-clear"></div>').format(AH.nodeid,pageData.baseurl,AH.url,AH.title,(AH.lastPostTitle?AH.lastPostTitle:"<em>"+vBulletin.phrase.get("none")+"</em>"),pageData.baseurl_core,AH.parentid)).appendTo(AG);O(AF[AI].subchannels,AJ.eq(0))})}function h(AG,AF){F.each(AG,function(AH,AJ){var AI=F.map(AJ.subchannels,function(AM,AL){return AL}).length;var AK=AA(AJ.nodeid,AJ.parentid,AJ.title,AJ.category,AF,AI);h(AJ.subchannels,AK)})}function P(){D.tabs("select",0);var AL=F("#add-modules").height();D.tabs("select",1);var AF=F("#change-layout").height();D.tabs("select",2);var AG=F("#select-template").height();F("#edit-page-dropdown .lnkSaveChanges").trigger("click");var AI=F("#save-page-form").height();D.tabs("select",0);var AK=Math.max(AL,AF,AG,AI);var AH=F("#edit-page-dropdown .panel-header-text");AH.each(function(){var AM=F(this);AM.css("min-height",AK-parseFloat(AM.css("margin-top"))-parseFloat(AM.css("margin-bottom"))-parseFloat(AM.css("padding-top"))-parseFloat(AM.css("padding-bottom")))});var AJ=F("#edit-page-dropdown .panel-main-content");AJ.each(function(){var AM=F(this);AM.css("min-height",AK-parseFloat(AM.css("margin-top"))-parseFloat(AM.css("margin-bottom"))-parseFloat(AM.css("padding-top"))-parseFloat(AM.css("padding-bottom")))})}function S(AF){var AG=F("#edit-page-dropdown #edit-content > .tabs > .tab:eq({0}) .list > .list-item".format(AF));AG.parent().width(Math.max(AG.outerWidth(true)*AG.filter(":visible").length),parseFloat(AG.parent().css("min-width")))}function AB(AF,AG){var AH=(AG&&AG.length>0)?F(".canvas-layout .canvas-widget").not(AG).find(".widget-content"):F(".canvas-layout .canvas-widget .widget-content");if(AF){AH.each(function(){if(F(this).is(":hidden")){F(this).closest(".canvas-widget").find(".widget-header .toggle-button").trigger("click",[true])}})}else{AH.each(function(){if(!F(this).is(":hidden")){F(this).closest(".canvas-widget").find(".widget-header .toggle-button").trigger("click",[true])}})}}function R(AG,AF){if(AF){if(AG.find(".widget-content").is(":hidden")){AG.find(".toggle-button").trigger("click",[true])}}else{if(!AG.find(".widget-content").is(":hidden")){AG.find(".toggle-button").trigger("click",[true])}}}function b(){if(!n){var AF=F(".canvas-layout:visible .canvas-widget.subchannel-widget");if(AF.length==1){AF.find(".close-button").hide()}else{AF.find(".close-button").show()}}}function M(AH,AF){var AG=AH.attr("data-widget-id");if(Q[AG]==null){window.vBulletin.loadingIndicator.show();F("body").css("cursor","wait");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/fetch-widget-template",data:({widgetid:AG}),type:"POST",dataType:"json",complete:function(){window.vBulletin.loadingIndicator.hide();F("body").css("cursor","auto")},success:function(AI){console.log("Fetching module template successful");var AK=F.trim(AI);if(AK){var AJ=F(AK.replace(/\<\s*script[^\>]*\>(.*?)\<\s*\/\s*script\>/g,""));AJ.attr("data-title",function(){var AL=F(".module-title",AJ).clone();AL.find(".hide-on-viewmode").children().unwrap();AL.find("*:hidden").remove();return F.trim(AL.text()).toLowerCase()});Q[AG]=AJ;if(typeof AF=="function"){AF(AJ.clone(true))}}},error:function(AK,AJ,AI){console.log("Fetching module template failed, error: "+AI);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_cloned_widget_template",AK.status),iconType:"error"})}})}else{if(typeof AF=="function"){AF(Q[AG].clone(true))}}}function N(AF,AG){F(".edit-mode .canvas-widget.youtube-widget .widget-content").css("visibility",AF);if(AG){AG.find(".widget-content").css("visibility",(AF=="hidden"?"visible":"hidden"))}}function y(){F(document).off("click",".canvas-widget.default-widget .edit-button").on("click",".canvas-widget.default-widget .edit-button",function(){F("body").css("cursor","wait");var AK=F(this).closest(".canvas-widget");var AI=AK.attr("data-widget-id");var AG=F("> .widget-header .module-title",AK);var AH;if(F("span.admin-only",AG).length>0){AH=F("span.admin-only",AG).text()}else{AH=F(".hide-on-viewmode",AG).length>0?F(".hide-on-viewmode",AG).text():AG.text()}var AJ=AK.data("widget-type")||"";F("#config-dialog .loader").show();F("#config-dialog .widget-name h1").html(AH);F("#config-dialog .dialog-content .widget-config-container").hide().empty().removeClass("error notice");F("#config-dialog").data("selected-module",AK);N("hidden");F("#config-dialog").dialog("open");F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/fetchConfigSchema",data:({widgetid:AI,widgetinstanceid:AK.attr("data-widget-instance-id")||"",pagetemplateid:F("#config_pagetemplateid").val()||F("#select-template input[type=radio]:checked").val()||"",configtype:"admin"}),type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(Ab){console.log("fetchConfigSchema successful! result:"+JSON.stringify(Ab));if(Ab){F("#config_widgetid").val(Ab.widgetid);F("#config_widgetinstanceid").val(Ab.widgetinstanceid);F("#config_pagetemplateid, #save-page-form #pagetemplateid-yes, #save-page-form #pagetemplateid-new").val(Ab.pagetemplateid);AK.attr("data-widget-instance-id",Ab.widgetinstanceid);if(!Ab.configs||Ab.configs.length==0){F("#config-dialog .widget-config-container").html(vBulletin.phrase.get("no_configurations_found")).addClass("notice");F("#btnSaveConfig").prop("disabled",true);F("#btnCloseConfig").focus()}else{var AW=0;var AT=F("#config-dialog .dialog-content .widget-config-container");F('<input type="hidden" name="data[widget_type]" />').addClass("widget-type").val(AJ).appendTo(AT);var Aa=false,AZ=false,AP=false,AY=false,AQ,AX=false,AL=(F("#debug-information").length==1);F.each(Ab.configs,function(Ai,Ae){var Ad;switch(Ae.type){case"ChannelSetup":F("#config-dialog .dialog-content .channel-config-dialog").css("display","block");return true;break;case"Text":Ad=F('<input type="text" name="data[{0}]" id="data[{0}]" />'.format(Ae.name)).addClass("textbox config-textbox").val(Ae.defaultvalue||"");break;case"LongText":Ad=F('<textarea name="data[{0}]" id="data[{0}]" rows="3" />'.format(Ae.name)).addClass("textbox config-textbox").val(Ae.defaultvalue||"");break;case"YesNo":var Ah={option_1:F('<input type="radio" value="1" name="data[{0}]" id="data[{0}_1]" />'.format(Ae.name)),label_1:F("<label />").attr({"for":"data["+Ae.name+"_1]"}).text(vBulletin.phrase.get("yes")),option_0:F('<input type="radio" value="0" name="data[{0}]" id="data[{0}_0]" />'.format(Ae.name)),label_0:F("<label />").attr({"for":"data["+Ae.name+"_0]"}).text(vBulletin.phrase.get("no"))};var Am=Ah["option_"+Ae.defaultvalue];if(Am){Am.prop("checked",true)}Ad=F("<div />").append(Ah.option_1,Ah.label_1,Ah.option_0,Ah.label_0);break;case"Select":AX=true;Ad=F('<select name="data[{0}]" />'.format(Ae.name));var Ag;if(Ae.data!=""){for(Ag in Ae.data){if(Ae.defaultvalue==Ag){F("<option />").attr("value",Ag).attr("selected","selected").text(Ae.data[Ag]).appendTo(Ad)}else{F("<option />").attr("value",Ag).text(Ae.data[Ag]).appendTo(Ad)}}}break;case"ChannelSelect":AX=true;Ad=F('<select name="data[{0}]" />'.format(Ae.name));var Ak=F('<optgroup label="{0}" />'.format(vBulletin.phrase.get("special_options"))),Af=F('<optgroup label="{0}" />'.format(vBulletin.phrase.get("channels"))),Aj=false,Al=false;if(Ae.data){F.each(Ae.data,function(An,Ao){var Ap=null;if(Ae.defaultvalue==Ao.nodeid){Ap=F("<option />").attr("value",Ao.nodeid).attr("selected","selected").html(Ao.text)}else{Ap=F("<option />").attr("value",Ao.nodeid).html(Ao.text)}if(Ao.nodeid<1){Ap.appendTo(Ak);Aj=true}else{Ap.appendTo(Af);Al=true}});if(Aj){Ak.appendTo(Ad)}if(Al){Af.appendTo(Ad)}}break;case"ProfileFieldSelect":AX=true;Ad=F('<select name="data[{0}]" />'.format(Ae.name));if(Ae.data){F.each(Ae.data,function(An,Ap){var Ao=null;if(Ae.defaultvalue==Ap.field){Ao=F("<option />").attr("value",Ap.field).attr("selected","selected").html(Ap.title)}else{Ao=F("<option />").attr("value",Ap.field).html(Ap.title)}Ao.appendTo(Ad)})}break}$requiredMark=F("<div />").addClass("config-required-mark h-left").append(function(){return(Ae.isRequired==1)?"*":"&nbsp;"});if(Ae.isEditable==0){if(Ae.type=="YesNo"){Ad.find("input").prop("disabled",false)}else{Ad.prop("disabled",false)}}var Ac=F("<div />").addClass("config-label h-left").addClass(Ae.name).html(Ae.label);if(AL){Ac.prop("title",Ae.name)}AT.append(F("<div></div>").addClass(function(){return"h-clearfix config-row"+(((++AW)%2!=0)?" odd":"")}).append(Ac,$requiredMark,F("<div></div>").addClass("config-value h-left").addClass(Ae.name).append(Ad)));if(Ae.name=="default_tab"){Aa=true}if(Ae.name=="display_tabs"){AZ=true}if(Ae.name=="tab_order"){AP=true}if(Ae.name=="axd"){AY=true}});var AM=null;var AV=function(){AQ=AF(AK);var Af=AK.attr("data-widget-default-tab"),Ad=F('select[name="data[default_tab]"]',AT),Ae;Ad.empty();for(var Ac in AQ){if(AZ){if(!F('input:checkbox[value="'+AQ[Ac].selector+'"]',AR).is(":checked")){continue}}else{if(!AQ[Ac].displayed){continue}}Ae=F('<option value="'+AQ[Ac].selector+'">'+AQ[Ac].label+"</option>");if(AM&&AM==AQ[Ac].selector){Ae.attr("selected","selected")}else{if(Af==AQ[Ac].selector){Ae.attr("selected","selected")}}Ad.append(Ae)}};var AS=function(){AQ=AF(AK);var Ad=F(".config-value.tab_order",AT),Ae,Af;Ad.empty().append("<ul>");for(var Ac in AQ){if(AZ){if(!F('input:checkbox[value="'+AQ[Ac].selector+'"]',AR).is(":checked")){continue}}else{if(!AQ[Ac].displayed){continue}}Ae=F('<li id="'+AQ[Ac].selector+'">'+AQ[Ac].label+"</li>");F("ul",Ad).append(Ae);Af=F('<input name="data[tab_order]['+AQ[Ac].selector.substring(1)+']" value="'+Ac+'" type="hidden">');Ad.append(Af)}F("ul",Ad).sortable({stop:function(){var Ag=F(this).sortable("toArray");Ad.find("input:hidden").remove();for(Ac in Ag){Af=F('<input name="data[tab_order]['+Ag[Ac].substring(1)+']" value="'+Ac+'" type="hidden">');Ad.append(Af)}}});F("ul",Ad).disableSelection()};if(AZ){AQ=AF(AK);var AR=F(".config-value.display_tabs",AT),AU;for(var AO in AQ){AU=F('<label><input type="checkbox" name="data[display_tabs][]" value="'+AQ[AO].selector+'">'+AQ[AO].label+"</label>");if(AQ[AO].displayed){AU.find("input:checkbox").attr("checked","checked")}AR.append(AU)}if(Aa){F("input:checkbox",AR).on("click",function(){AV();AS()})}}if(AP){AS();F('select[name="data[default_tab]"]',AT).change(function(){AM=F(this).val()})}if(Aa){AV()}if(AY){var AN=F(".config-value.axd",AT);AN.append('<button class="axd-edit-button button secondary" data-location="'+Ab.widgetinstanceid+'">'+vBulletin.phrase.get("edit")+"</button>")}}}F("#config-dialog .dialog-content .widget-config-container").show();F("#config-dialog .loader").hide();if(AX){F("#config-dialog .dialog-content .widget-config-container select").selectBox()}},error:function(AN,AM,AL){console.log("fetchConfigSchema failed! error:"+AL);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_configuration",AH),iconType:"error",onAfterClose:function(){F("#config-dialog").dialog("close")}});F("#config-dialog .loader").hide()}});return false});function AF(AH){var AG=[];F("ul.widget-tabs-nav li a, .widget-header ul.ui-tabs-nav li a, .widget-tabs-nav ul.ui-tabs-nav li a",AH).each(function(){var AI=F(this),AJ;if(F(this).closest("li").hasClass("h-hide")){AJ=false}else{AJ=true}AG.push({selector:AI.attr("href"),label:AI.text(),displayed:AJ})});return AG}}function c(){F(".edit-mode .canvas-layout:visible > .canvas-widget-list").width("").each(function(){F(this).width(F(this).width())})}function AD(){if(F.browser.msie&&parseInt(F.browser.version,10)==8){var AF=F(".edit-mode .canvas-layout:visible > .canvas-widget-list");AF.each(function(){var AG=F(".canvas-widget",this),AM=F(this);var AH=AG.outerHeight(true)||50;var AI=AG.length*AG.outerHeight(true);var AL=AM.height()-AI;console.log("offset:",AL);if(AL>=0&&AL<AH){var AK=F(window);var AJ=AK.scrollTop();AM.height(AM.height()+(AH-AL));AK.scrollTop(AJ);return false}else{if((AL>AH&&AM.height()>parseInt(AM.css("min-height"),10))||AL<0){var AK=F(window);var AJ=AK.scrollTop();AM.height(AI+AH);AK.scrollTop(AJ);return false}}})}}function f(){window.console.log("Fetching page manager forums (initializeForumEditor)");vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/fetchPageManagerForums",complete:function(){F("#config-dialog .loader").hide();F("body").css("cursor","auto")},success:function(AF){window.console.log("Successfully fetched page manager forums (initializeForumEditor)");p=true;var AH=F("<div>").addClass("channel-list");F.each(AF,function(AJ,AL){var AK=F.map(AL.subchannels,function(AN,AM){return AM}).length;var AI=AE(AH,AL.nodeid,AL.parentid,AL.title,AL.category,false,AK);h(AL.subchannels,AI)});var AG=F("#top-level-forum .channel-config-dialog");AG.find(".channel-list").remove();r(AH);J(AH);AG.append(AH);F(document).on("mousedown",".main-channel-container > .channel-item-container > .channel-item .grip-icon",function(){F(this).closest(".main-channel-container").height(F(this).closest(".main-channel-container").height())});F(document).on("mousedown",".sub-channel-container > .channel-item-container > .channel-item .grip-icon",function(){F(this).closest(".sub-channel-container").height(F(this).closest(".sub-channel-container").height())});Y=false;Z()},error_phrase:"error_fetching_channels"});F(document).on("click keydown",".channel-config-dialog .add-channel-fieldset .add-button, .channel-config-dialog .add-channel-fieldset input",function(AF){if(((AF.type=="click"||AF.which!=13)&&this.type=="text")||(AF.type=="keydown"&&this.type=="button"&&AF.which!=13)){return true}var AI=(this.type=="text")?F(this):F(this).prev();var AG=F.trim(AI.val());if(AG&&AG!=AI.prop("defaultValue")){var AH=F("#top-level-forum .channel-config-dialog .channel-list");AE(AH,"","",vBulletin.htmlEntities(AG),0,true,0);r(AH);Z();AI.val("");if(this.type=="button"){AI.focus()}}else{openAlertDialog({title:vBulletin.phrase.get("warning_gcpuser"),message:vBulletin.phrase.get("please_enter_channel_title"),iconType:"warning",onAfterClose:function(){AI.focus()}})}});F(document).on("click",".channel-config-dialog .main-channel-container .channel-item .channel-title div",function(){F(this).hide();var AF=F(this).next();AF.show();AF.select();AF.focus()});F(document).on("keydown blur",".channel-config-dialog .main-channel-container .channel-item .channel-title input",function(AF){if(AF.type=="focusout"||(AF.type=="keydown"&&AF.which==13)){if(!F.trim(this.value)&&AF.type=="focusout"){this.value=this.defaultValue}if(F.trim(this.value)){F(this).hide();F(this).prev().html(vBulletin.htmlEntities(this.value));F(this).prev().show()}}});F(document).on("click",".channel-config-dialog .channel-item .category-to-channel a",function(){var AF=F(this).closest(".channel-item");AF.attr("data-switch-category",0);F(this).parent().removeClass("category-to-channel").addClass("channel-to-category");F(this).html(vBulletin.phrase.get("make_category"));return false});F(document).on("click",".channel-config-dialog .channel-item .channel-to-category a",function(){var AF=F(this).closest(".channel-item");AF.attr("data-switch-category",1);F(this).parent().removeClass("channel-to-category").addClass("category-to-channel");F(this).html(vBulletin.phrase.get("make_forum"));return false});F(document).on("click",".channel-config-dialog .channel-item .toggle-button",function(){v(F(this));return false});F(document).on("click",".channel-config-dialog .channel-item .add-subchannel-button a",function(){var AF=F(this).parent().siblings(".toggle-button");v(AF,true);var AH=F(this).closest(".channel-item-container");var AG=AA("","",vBulletin.phrase.get("new_channel"),0,AH,0);J(AH);AG.slideDown(100,function(){var AI=AH.find(".channel-item-inner").first().find(".num-subchannels");AI.text(parseInt(AI.text())+1);F(".channel-title div",AG).click();F(".channel-title input",AG).get(0).scrollIntoView(false);Z()});return false});F(document).on("click",".channel-config-dialog .channel-list .channel-item .close-button",function(){var AF=F(this);var AG=F("> .sub-channel-container > .channel-item-container",AF.closest(".channel-item-container")).length>0;openConfirmDialog({title:vBulletin.phrase.get("remove_forum_q"),message:vBulletin.phrase.get("do_you_want_to_remove_forum",F(this).prev().text(),(AG)?" "+vBulletin.phrase.get("subchannels_will_be_deleted"):""),iconType:"warning",onClickYes:function(){var AL=AF.closest(".channel-item-container");var AJ=AL.parent();var AI=AF.closest(".channel-item").attr("data-channel-id");F("body").css("cursor","wait");var AH=function(){AL.remove();if(AJ.hasClass("main-channel-container")){AJ.slideUp("fast",function(){F(this).remove()})}};var AK=function(){F("body").css("cursor","auto")};if(AI){F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/content_channel/delete",data:{nodeid:AI},type:"POST",dataType:"json",complete:AK,success:function(AM){console.log("Delete channel successful! result:"+JSON.stringify(AM));if(AM.errors){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AM.errors[0]),iconType:"error"})}else{AH()}},error:function(AO,AN,AM){console.log("Delete channel failed! result:"+AM);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_deleting_page",AO.status),iconType:"error"})}})}else{AH();AK()}}})})}function o(AG){function AF(AI,AJ,AH){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+("/ajax/render/{0}_list").format(AI),data:{page:AJ},complete:function(){F("#config-dialog .loader").hide();F("body").css("cursor","auto")},success:function(AK){F(("#top-level-{0} .channel-config-dialog").format(AI)).html(AK);if(AH){vBulletin.pagination({context:("#top-level-{0} .channel-config-dialog").format(AI),onPageChanged:function(AL,AM){AF(AI,AL)}})}},error_phrase:"error_fetching_channels"})}AF(AG,1,true);F(document).on("click",".page_manager_table .channel_name div",function(){F(this).hide();var AH=F(this).next();AH.show();AH.select();AH.focus()});F(document).on("keydown blur",".page_manager_table .channel_name input",function(AJ){if(AJ.type=="focusout"||(AJ.type=="keydown"&&AJ.which==13)){if(!F.trim(this.value)&&AJ.type=="focusout"){this.value=this.defaultValue}var AI=F.trim(this.value);var AH=F(this);if(AI&&AH.prev().html()!=AI){F("body").css("cursor","wait");vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/Content_Channel/update",data:{nodeid:AH.parents(".channel_row").data("nodeid"),data:{title:AI}},complete:function(){F("#config-dialog .loader").hide();F("body").css("cursor","auto")},success:function(AK){AH.hide();AH.prev().html(AI);AH.prev().show()},error_phrase:"error_saving_page"})}}});F(document).on("click",".page_manager_table .delete",function(){var AH=F(this);openConfirmDialog({title:vBulletin.phrase.get("remove_channel_q"),message:vBulletin.phrase.get("do_you_want_to_remove_channel",AH.parents(".channel_row").find(".channel_name_val").text()),iconType:"warning",onClickYes:function(){F("body").css("cursor","wait");vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/content_channel/delete",data:{nodeid:AH.parents(".channel_row").data("nodeid")},complete:function(){F("body").css("cursor","auto")},success:function(AI){AH.parents(".channel_row").remove()}})}})})}var p=false;function L(){F("body").css("cursor","wait");C=F("#manage-page .tabs").tabs({show:function(AF,AG){if(AG.index==0&&!p){f()}if(AG.index!=0&&Y){openConfirmDialog({title:vBulletin.phrase.get("exit_without_saving_page"),message:vBulletin.phrase.get("forum_changes_will_be_lost"),iconType:"warning",onClickYes:function(){Y=false}});return false}},select:function(AF,AG){}});C.tabs("select",0);E=F("#manage-pages").tabs({show:function(AF,AG){if((AG.index==1||AG.index==2)){o(F(AG.tab).data("top-level"))}}});E.tabs("select",0);F("#manage-page-dropdown .lnkSaveChanges").on("click",function(){console.log("Saving forum/channel data");var AF=F(this);if(AF.hasClass("h-disabled")){console.log("We're busy saving already. Try again later.");return }AF.addClass("h-disabled");vBulletin.loadingIndicator.show();F("body").css("cursor","wait");var AG=[];function AH(AK,AI,AJ){var AL=F("> .channel-item-container",AK);if(AL.length>0){AL.each(function(AN){var AM=F("> .channel-item",this);var AO=AM.attr("data-channel-id");var AP=AM.attr("data-parent-id");subchannelObj={nodeid:AO||"0",previousParentId:AP,title:F(".channel-title div",AM).html(),displayorder:AN+1,parentid:AJ||"0",subchannels:[]};if(AM.attr("data-switch-category")!=null){subchannelObj.switchCategory=AM.attr("data-switch-category")}AI.subchannels.push(subchannelObj);AH(AM.next(".sub-channel-container"),AI.subchannels[AN],AO)})}}if(I.forum){F(".channel-config-dialog .channel-list .main-channel-container").each(function(AK){var AJ=F("> .channel-item-container > .channel-item",this);var AL=AJ.attr("data-channel-id");var AM=AJ.attr("data-parent-id");var AI={nodeid:AL,previousParentId:AM,title:F(".channel-title div",AJ).html(),displayorder:AK+1,subchannels:[]};if(AJ.attr("data-switch-category")!=null){AI.switchCategory=AJ.attr("data-switch-category")}AH(AJ.next(".sub-channel-container"),AI,AL);AG.push(AI)});vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/saveForums",data:{data:JSON.stringify(AG)},complete:function(){F("body").css("cursor","auto");vBulletin.loadingIndicator.hide();AF.removeClass("h-disabled")},success:function(AI){console.log("Forum/channel changes successfully saved");if(AI&&AI.forums&&AI.forums.length>0){Y=false;I.forum=false;location.reload(true)}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_forums"),iconType:"error"});return false}},error_phrase:"error_saving_channels_code"})}else{console.log("No forum/channel changes to save");vBulletin.loadingIndicator.hide();F("body").css("cursor","auto");AF.removeClass("h-disabled")}});F(document).on("click","#manage-page-dropdown .lnkExitWithoutSaving",function(){if(Y){openConfirmDialog({title:vBulletin.phrase.get("exit_without_saving_page"),message:vBulletin.phrase.get("do_you_want_to_exit_without_saving_page"),iconType:"warning",onClickYes:function(){location.reload(true)}})}else{location.reload(true)}})}function V(){F(document).on("focus click",".edit-mode .widget-content a, .edit-mode #channel-tabbar a, .edit-mode #btnSearch, .edit-mode #q",function(AL){this.blur();return false});if(!d){q()}if(!T){G()}else{i.thumbnailRadioCheckbox("check",F("#select-template .template-border.selected").next("input"),false);if(!n){F("#select-template .template-item input[value={0}]".format(F("#pagetemplateid-yes").val())).prev().trigger("click")}}B[1]=F("#change-layout .layout-list-container");B[1].tinyscrollbar({sizethumb:14,axis:"x",update:function(){if(F("#change-layout .layout-list-container").innerHeight()<F("#change-layout .panel-header-text").height()){F("#change-layout .panel-header-text").height(F("#change-layout .layout-list-container").innerHeight())}}});F("#config_pagetemplateid").val("");if(n){F("#save-page-form #pagetitle").val("");F("#save-page-form #pageurl").val("");F("#save-page-form #pagetemplateid").val("0");F("#save-page-form #pageid").val("0")}F("#edit-page-dropdown .lnkSaveChanges").on("click",function(){F("#edit-page-dropdown .tabs li").removeClass("ui-tabs-selected ui-state-active");F("#edit-page-dropdown .tabs .tab").addClass("ui-tabs-hide");F("#save-content").show();F("#save-page-form .edit-page-template").css("display","");F("#save-page-form .edit-page-template").prev("label").css("display","");if(F("body").hasClass("lnkNewPage")){F("#save-page-form .new-page-template input").prop("disabled",false);F("#save-page-form .edit-page-template input").prop("disabled",true)}else{if(!F("#pagetemplateid-yes").prop("checked")&&!F("#pagetemplateid-no").prop("checked")){F("#pagetemplateid-yes").prop("checked",true)}F("#save-page-form .edit-page-template input").prop("disabled",false);F("#save-page-form .new-page-template input").prop("disabled",true);if(n&&(!l&&!Y)){F("#save-page-form .edit-page-template").css("display","none");F("#save-page-form .edit-page-template").prev("label").css("display","none")}if(F("#pagetemplateid-yes").prop("checked")){F("#save-page-form #templatetitle").prop("disabled",false);F("#save-page-form #templatetitle-edit").prop("disabled",true)}else{F("#save-page-form #templatetitle").prop("disabled",true);F("#save-page-form #templatetitle-edit").prop("disabled",false)}}});F(document).on("click","#edit-page-dropdown .lnkExitWithoutSaving",function(){if(l||Y||e||(!n&&(F("#pagetitle").val()!=F("#pagetitle").prop("defaultValue")||F("#pageurl").val()!=F("#pageurl").prop("defaultValue")))||(n&&(F("#pagetitle").val()!=""||F("#pageurl").val()!=""))){openConfirmDialog({title:vBulletin.phrase.get("exit_without_saving_page"),message:vBulletin.phrase.get("do_you_want_to_exit_without_saving_page"),iconType:"warning",onClickYes:function(){location.reload(true)}})}else{location.reload(true)}});var AF=0;F(window).on("resize.canvas",function(){clearTimeout(AF);AF=setTimeout(c,200)});var AI=function(AL){return'<label class="hide-icon module-button-item"><input type="checkbox" title="{0}" data-toggle-title="{1}"{2} /></label>'.format(vBulletin.phrase.get("check_to_hide_module"),vBulletin.phrase.get("uncheck_to_unhide_module"),AL?' checked="checked"':"")};F(".canvas-widget.container-widget .canvas-widget:not(.dummy-widget)").each(function(){var AL=F(this).hasClass("hidden-widget");F(".module-buttons .admin-only",this).prepend(AI(AL));if(AL){F(".module-buttons .admin-only .hide-icon input",this).trigger("click").prop("checked",true)}});var AK=function(AN,AO,AQ){var AP=AO.item,AQ=AO.item.hasClass("module-item");var AL=F("> .canvas-widget.container-widget {0}".format(AQ?".module-item":".canvas-widget.container-widget"),this);if(AL.length>0){var AM=AL.closest(".canvas-widget.container-widget");if(AM.attr("data-widget-id")==AL.attr("data-widget-id")){if(AQ){AL.remove()}else{if(AO.sender){AO.sender.sortable("cancel")}else{F(this).sortable("cancel")}}AJ=true;openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("dropping_container_module_into_container_module_not_allowed"),iconType:"warning"});return true}return false}return false};var AH=function(AL){if(AL.parents(".canvas-widget.container-widget").length>0){if(F(".module-buttons .admin-only .hide-icon",AL).length==0){F(".module-buttons .admin-only",AL).prepend(AI())}}else{AL.removeClass("hidden-widget").find("> .widget-header .module-buttons .admin-only .hide-icon").remove()}};var AJ=false;F(".edit-mode .canvas-layout .canvas-widget-list").sortable({revert:true,tolerance:"pointer",connectWith:".edit-mode .canvas-layout:visible .canvas-widget-list",placeholder:"canvas-widget canvas-widget-highlight drag-highlight h-clear",create:function(){c();AD()},update:function(AL,AM){var AN=this;if(U){if(!AJ){M(AM.item,function(AO){AM.item.replaceWith(AO);AO.filter(":not(.container-widget)").find(".toggle-button").trigger("click",[true]);if(!AK.apply(AN,[AL,AM])){AH(AO);AO.addClass("shadow").find(".widget-tabs").andSelf().filter(".widget-tabs").tabs();b();AO.parents(".canvas-widget.container-widget").find(".canvas-widget.dummy-widget").remove();var AP=AO.parents(".canvas-widget.container-widget");if(AP.length==1){AP.find(".canvas-widget-highlight").remove();AP.find(".module-item").remove()}}})}}else{if(!AK.apply(AN,[AL,AM])){AH(AM.item);b()}}l=true},out:function(AL,AM){},sort:function(AL,AM){if(X){U=true}var AN=AM.placeholder.closest(".canvas-widget.container-widget");if(AN.length==1&&AN.find(".canvas-widget:last-child").hasClass("canvas-widget-highlight")){AM.placeholder.css({"margin-bottom":0,"margin-top":-3})}else{AM.placeholder.css({"margin-bottom":"","margin-top":""})}},start:function(AL,AM){N("hidden",AM.item)},over:function(AL,AM){},stop:function(AM,AN){AJ=false;AD();U=false;AN.item.height("auto");N("visible");F(".canvas-layout .canvas-widget-list .canvas-widget-highlight").remove();var AL=F(".canvas-layout > .canvas-layout-row .canvas-widget-list > .canvas-widget.container-widget");F(".canvas-layout > .canvas-layout-row .canvas-widget-list > .canvas-widget.container-widget").each(function(){var AO=F(".canvas-widget-list",this);if(AO.children().length==0){AO.append('<div class="canvas-widget dummy-widget"><span>{0}</span></div>'.format(vBulletin.phrase.get("you_can_also_drag_and_drop_modules_here")))}else{if(AO.find(".canvas-widget.dummy-widget").length>0&&AO.find(".canvas-widget:not(.dummy-widget,.canvas-widget-highlight)").length>0){AO.find(".canvas-widget.dummy-widget").remove()}}})},receive:function(AL,AM){if(AM.item.hasClass("module-item")){AK.apply(this,[AL,AM,true])}},handle:".move-icon",items:".canvas-widget"}).find(".canvas-widget .widget-header").disableSelection();F(document).on("click",".edit-mode .canvas-widget .close-button",function(){var AL=F(this);openConfirmDialog({title:vBulletin.phrase.get("remove_module_q"),message:vBulletin.phrase.get("do_you_want_to_remove_module",AL.closest(".widget-header").find(".module-title").text()),iconType:"warning",onClickYes:function(){var AN=AL.closest(".canvas-widget"),AM=AN.parents(".canvas-widget.container-widget");AN.remove();AD();b();l=true;if(AM.find(".canvas-widget").length==0){AM.find(".canvas-widget-list").append('<div class="canvas-widget dummy-widget"><span>{0}</span></div>'.format(vBulletin.phrase.get("you_can_also_drag_and_drop_modules_here")))}}})});F(document).on("click",".edit-mode .search-widget .edit-button",function(){N("hidden");AG(F(this).closest(".search-widget"));F("#search-config-dialog").dialog("open");return false});F(document).on("click","#save-page-form #btnOK",function(AS,AR){var AL=F("#edit-page-dropdown .lnkSaveChanges .label").text();if(!AR){if(!F.trim(F("#save-page-form #pagetitle").val())){openAlertDialog({title:AL,message:vBulletin.phrase.get("please_enter_page_name"),iconType:"warning",onAfterClose:function(){F("#save-page-form #pagetitle").focus()}});return false}if(F("body").hasClass("lnkEditPage")){var AQ=F("#save-page-form #pagetemplateid-yes");var AM=F("#save-page-form #pagetemplateid-no");if(!AQ.prop("checked")&&!AM.prop("checked")){openAlertDialog({title:AL,message:vBulletin.phrase.get("please_choose_overwrite_template_options"),iconType:"warning",onAfterClose:function(){F("#save-page-form #pagetemplateid-yes").focus()}});return false}else{if(AM.prop("checked")){var AN=F("#save-page-form #templatetitle-edit");var AV=F.trim(AN.val());if(!AV||AV==AN.prop("defaultValue")){openAlertDialog({title:AL,message:vBulletin.phrase.get("please_enter_new_template_name"),iconType:"warning",onAfterClose:function(){F("#save-page-form #templatetitle-edit").focus()}});return false}openConfirmDialog({title:AL,message:vBulletin.phrase.get("applying_new_template",F("#save-page-form #templatetitle-edit").val()),buttonLabel:{yesLabel:vBulletin.phrase.get("save_page"),noLabel:vBulletin.phrase.get("cancel")},iconType:"warning",onClickYes:function(){F("#save-page-form #btnOK").trigger("click",true)}});return false}else{if(AQ.prop("checked")){if(n&&(!l&&!Y)){F("#save-page-form #btnOK").trigger("click",true)}else{openConfirmDialog({title:AL,message:vBulletin.phrase.get("overwrite_template_continue"),buttonLabel:{yesLabel:vBulletin.phrase.get("save_page"),noLabel:vBulletin.phrase.get("cancel")},iconType:"warning",onClickYes:function(){F("#save-page-form #btnOK").trigger("click",true)}})}return false}}}}else{var AN=F("#save-page-form #templatetitle-new");var AV=F.trim(AN.val());if(!AV||AV==AN.prop("defaultValue")){openAlertDialog({title:AL,message:vBulletin.phrase.get("please_enter_new_template_name"),iconType:"warning",onAfterClose:function(){F("#save-page-form #templatetitle-new").focus()}});return false}}}var AU=F(".canvas-layout:visible");u=AU.attr("id");F("#save-page-form #screenlayoutid").val(AU.attr("data-layout-id"));function AO(AY){var AZ={widgetId:AY.attr("data-widget-id"),widgetInstanceId:(AY.attr("data-widget-instance-id")||"0")};if(AY.hasClass("container-widget")){var AW=[];var AX=[];F("div.canvas-widget-list > div.canvas-widget",AY).each(function(Aa){if(!F(this).hasClass("hidden-widget")){AX.push(F(this).attr("data-widget-instance-id"))}AW.push(AO(F(this)))});AZ.subModules=AW;AZ.displaySubModules=AX}return AZ}F('input[type=hidden][name*="displaysections"]',AU).clone().appendTo(F("#moduleData").empty());F("#"+u+" > .canvas-layout-row > div.canvas-widget-list").each(function(){var AW=[];var AX=a(this);F(this).children("div.canvas-widget").each(function(){AW.push(AO(F(this)))});F('#save-page-form input[name="displaysections['+AX+']"]').val(JSON.stringify(AW))});var AT={};var AP=F("#save-page-form").serializeArray();F.each(AP,function(AW,AX){AT[AX.name]=AX.value});F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/page/pageSave",data:{input:AT},type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(AW){console.log("savePage successful! result:"+JSON.stringify(AW));if(AW&&AW.url!=null){window.location.href=pageData.baseurl+AW.url}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(AW.errors[0]),iconType:"error"})}},error:function(AY,AX,AW){console.log("saveChannelWidgetConfig failed! result:"+AW);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_page",AY.status),iconType:"error"})}})});F("#config-dialog").dialog({title:vBulletin.phrase.get("module_configuration"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,height:500,width:800,dialogClass:"dialog-container config-dialog-container input-dialog",open:function(){F("#config-dialog .loader").show();F("body").css("cursor","wait")},create:function(){F(document).on("submit",".sitebuilder-widget-form",function(){function AM(AQ){F("body").css("cursor","wait");F("#config-dialog .action-buttons button").prop("disabled",true);var AR=F("#config-dialog").data("selected-module");var AO=F(AQ).find("#config_widgetid");var AN=AR.hasClass("category-customized_copy");var AP=AN?AQ.action.replace(/saveAdminConfig/,"saveDefaultConfig"):AQ.action;F.ajax({url:AP,type:AQ.method,data:(F(AQ).serializeArray()),dataType:"json",success:function(AT){console.log("saveAdminConfig successful!");F("body").css("cursor","auto");if(AT&&AT.data){var AX=F("#config-dialog").data("selected-module");var AS=AT.data.title||AT.data.searchResultTitle;if(AS){AX.find(".main-title").text(AS)}switch(AT.data.widget_type){case"custom-html-widget":AX.find(".widget-content").html(AT.data.html);R(AX,true);break;case"video-widget":var AU=AT.data.embed_data;if(AU){var AY=AX.find(".widget-content .videocontainer");if(AY.length==0){AY=F("<div />").addClass("videocontainer").appendTo(AX.find(".widget-content"))}var AW={code:AU.code,provider:AU.provider,width:"100%",height:260};F.get(vBulletin.getAjaxBaseurl()+"/ajax/render/bbcode_video",AW,function(AZ){if(AZ){AY.empty().append(AZ);R(AX,true)}},"json");AX.find(".widget-content").find(".note").addClass("h-hide")}break}var AV=F('select[name="data[default_tab]"]',F(AQ));if(AV.length>0){AX.attr("data-widget-default-tab",AV.val())}}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){F("#config-dialog .action-buttons button").prop("disabled",false)}});F("#config-dialog .loader").hide()}F("#config-dialog").dialog("close")},error:function(AU,AT,AS){console.log("saveAdminConfig failed! error:"+AS);F("body").css("cursor","auto");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_configuration_module",F("#config-dialog .widget-name h1").text()),iconType:"error",onAfterClose:function(){F("#config-dialog .action-buttons button").prop("disabled",false)}});F("#config-dialog .loader").hide()}})}var AL=this;AM(AL);return false});F("#btnCloseConfig").on("click",function(){F(".channel-config-dialog .channel-list").empty();F("#config-dialog").dialog("close")})},close:function(){N("visible");F("#config-dialog .dialog-content .channel-config-dialog").css("display","none");F("#config-dialog .action-buttons button").prop("disabled",false)}});F("#pagetitle").on("keyup blur",function(AL){if(n){F("#pageurl").val(this.value.replace(/[^\w-]+/g,""))}return true});F("#save-page-form #pagetemplateid-yes").on("click",function(){F("#save-page-form .template-name").addClass("h-hide");F("#save-page-form #templatetitle").prop("disabled",false);F("#save-page-form #templatetitle-edit").prop("disabled",true)});F("#save-page-form #pagetemplateid-no").on("click",function(){F("#save-page-form .template-name").removeClass("h-hide");F("#save-page-form #templatetitle").prop("disabled",true);F("#save-page-form #templatetitle-edit").prop("disabled",false)});function AG(AL){if(typeof z.search_config_dialog=="undefined"){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/dialog_search_config",success:function(AM){z.search_config_dialog=AM;F("body").append(AM);AG(AL)},error_phrase:"error_fetching_dialog"});return }if(AL){F("#search-config-dialog").data("search-widget",AL)}F("#search-config-dialog").dialog({title:vBulletin.phrase.get("edit_search_module"),autoOpen:true,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:800,dialogClass:"dialog-container search-config-dialog-container input-dialog",close:function(){N("visible")},open:function(){var AM=this;F("#customSearchDialog",AM).addClass("h-invisible");F("body").css("cursor","wait");setTimeout(function(){vBulletin.search=vBulletin.search||{};var AP=function(){x=new vBulletin.search.SearchControl("#customSearchDialog");m(x)};var AO=F("#search-config-dialog").data("search-widget");var AR={id:AO.attr("data-widget-id"),instanceid:AO.attr("data-widget-instance-id")};if(typeof vBulletin.search.SearchControl=="undefined"){var AQ=["/js/jquery/jquery.qtip.min.js","/js/tag-editor.js","/js/sb_search.js"];var AN=function(){if(AQ.length==0){F("body").css("cursor","auto");F("#customSearchDialog",AM).removeClass("h-invisible");AP();return }var AS=AQ.shift();F.getScript(vBulletin.getAjaxBaseurl()+AS+"?"+pageData.simpleversion,AN).error(function(AW,AV,AT){var AU=(AT&&AT.message)?"{0}: {1}".format(vBulletin.phrase.get("error"),AT.message):"HTTP {0}: {1}".format(AW.status,AW.statusText);F("#search-config-dialog").dialog("close");openAlertDialog({title:vBulletin.phrase.get("error"),message:"{0}<br /><br />({1})".format(vBulletin.phrase.get("error_loading_search_config_script"),AU),iconType:"error"})}).complete(function(){})};AN()}else{F("#customSearchDialog",AM).removeClass("h-invisible");AP()}},1);Y=false},create:function(){F("#btnSaveSearchConfig").on("click",function(){F("body").css("cursor","wait");var AN=F("#search-config-dialog").data("search-widget");var AR={id:AN.attr("data-widget-id"),instanceid:AN.attr("data-widget-instance-id")};var AP={pageid:pageData.pageid,widgetid:AR.id,widgetinstanceid:AR.instanceid,pagetemplateid:F("#select-template input[type=radio]:checked").val(),searchJSON:{}};var AQ=F("#searchTitle");if(AQ.length>0&&F.trim(AQ.val()).length>0){AP.searchTitle=F.trim(AQ.val());AQ.data("defaultValue",AP.searchTitle)}var AM=F("#resultsPerPage");if(AM.length>0&&F.trim(AM.val()).length>0){AP.resultsPerPage=F.trim(AM.val());AM.data("defaultValue",AP.resultsPerPage)}var AO=F("#searchconfig_hide_avatars_yes");if(AO.length>0&&AO.prop("checked")){AP.hide_avatars="1";AO.data("defaultValue","1")}else{AP.hide_avatars="0";AO.data("defaultValue","0")}AP.searchJSON=x.load();F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/saveSearchWidgetConfig",data:{data:JSON.stringify(AP)},type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(AS){console.log("savesearchWidgetConfig successful! result:"+JSON.stringify(AS));if(AS&&AS.widgetinstanceid>0&&AS.searchJSON){AN.attr("data-widget-instance-id",AS.widgetinstanceid);AN.find(".main-title").text(AP.searchTitle);F("#config_widgetinstanceid").val(AS.widgetinstanceid);F("#config_pagetemplateid").val(AS.pagetemplateid);F("#pagetemplateid-new").val(AS.pagetemplateid);F("#search-config-dialog").dialog("close");R(AN,true);Y=true}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_search_config"),iconType:"error"})}},error:function(AU,AT,AS){console.log("saveSearchWidgetConfig failed! result:"+AS);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_saving_search_config_code",AU.status),iconType:"error"})}})});F("#btnCancelSearchConfig").on("click",function(){function AM(){F("#search-config-dialog").dialog("close");x.set("{}");var AQ=F("#search-config-dialog #searchTitle");AQ.val(AQ.data("defaultValue"));var AO=F("#search-config-dialog #resultsPerPage");AO.val(AO.data("defaultValue"));var AP=F("#search-config-dialog #searchconfig_hide_avatars_yes");if(AP.data("defaultValue")=="1"){AP.prop("checked",true)}else{F("#search-config-dialog #searchconfig_hide_avatars_no").prop("checked",true)}}if(Y){var AN=F(this);openConfirmDialog({title:vBulletin.phrase.get("cancel_edit"),message:vBulletin.phrase.get("do_you_want_to_cancel_editing_search_module"),iconType:"warning",onClickYes:AM})}else{AM()}})}})}F("#blog-category-dialog").dialog({title:vBulletin.phrase.get("edit_blog_categories"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:800,dialogClass:"dialog-container blog-category-dialog-container input-dialog",close:function(){N("visible")},open:function(){var AL=this;Y=false},create:function(){F("#blog-category-dialog #btnSaveCategories").on("click",function(){F("body").css("cursor","wait");F("#blog-category-dialog dialog-content loader").show();var AL=F("#search-config-dialog").data("blog-category-widget");var AM={id:AL.attr("data-widget-id"),instanceid:AL.attr("data-widget-instance-id")};vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/saveBlogCategories",data:{},complete:function(){F("body").css("cursor","auto");F("#blog-category-dialog dialog-content loader").hide()},success:function(AN){F("#blog-category-dialog dialog-content widget-config-container").html(AN)},error_phrase:"error_saving_blog_categories"})});F("#blog-category-dialog #btnNewCategory").on("click",function(){});F("#blog-category-dialog #btnCloseCategories").on("click",function(){if(Y){var AL=F(this);openConfirmDialog({title:vBulletin.phrase.get("cancel_edit"),message:vBulletin.phrase.get("do_you_want_to_cancel_editing_blog_categories_module"),iconType:"warning",onClickYes:F("#blog-category-dialog").dialog("close")})}else{F("#blog-category-dialog").dialog("close")}})}})}function m(AF){var AH=F(this).closest(".canvas-widget");var AG=F("#search-config-dialog").data("search-widget");var AI={id:AG.attr("data-widget-id"),instanceid:AG.attr("data-widget-instance-id")};F.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/widget/fetchSearchConfig",data:({widgetid:AI.id,widgetinstanceid:AI.instanceid||"",pagetemplateid:F("#config_pagetemplateid").val()||F("#select-template input[type=radio]:checked").val()||"",configtype:"admin"}),type:"POST",dataType:"json",complete:function(){F("body").css("cursor","auto")},success:function(AJ){console.log("fetchConfig successful! result:"+JSON.stringify(AJ));if(AJ.searchTitle){var AM=F("#searchTitle");if(AM.length>0){AM.val(AJ.searchTitle)}}if(AJ.resultsPerPage){var AK=F("#resultsPerPage");if(AK.length>0){AK.val(AJ.resultsPerPage)}}if(AJ.hide_avatars&&parseInt(AJ.hide_avatars,10)==1){var AL=F("#searchconfig_hide_avatars_yes");if(AL.length>0){AL.prop("checked",true)}}else{F("#searchconfig_hide_avatars_no").prop("checked",true)}AF.set(AJ.searchJSON||{},AJ.contentTypes||{},AJ.channels||{});F("#config-dialog .dialog-content .widget-config-container").show();F("#search-config-dialog .form_layout .form_row .field_column select").selectBox();F("#config-dialog .loader").hide()},error:function(AL,AK,AJ){console.log("fetchConfigSchema failed! error:"+AJ);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_retrieving_configuration",widgetName),iconType:"error",onAfterClose:function(){F("#config-dialog").dialog("close")}});F("#config-dialog .loader").hide()}})}t()})})(jQuery);;

// ***************************
// js.compressed/vbulletin_stylegenerator.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["style_generator_browser_not_supported","show_tooltips","hide_tooltips","enter_hex_value","enter_distance_angle","enter_complement_hue","enter_hue","err_invalid_name","err_order_need_name","err_order_need_order","err_order_negative","err_order_too_large","ok_js","cancel_js","done","error","saved_style_x_successfully","complementary_color","secondary_color_a","primary_color","enter_hex","primary0_info","primary1_info","primary2_info","primary3_info","primary4_info","secondary0_info","secondary1_info","secondary2_info","secondary4_info","warning"]);var drag={on:false,dot:null};var defs={FPSlimiter:10,MaxRedrawRate:200,dotSize:6,wheelMid:{X:190,Y:190},sliderMid:{X:95,Y:95},sliderWidth:140,CBPreview:0};var API={on:false};var SchemeID,styleGeneratorContent;$("#edit-content .tab-item a[id!=colorStyleTab]").on("click",function(){changePreview("","default")});$("#colorStyleTab").on("click",function(){var A=parseInt($.browser.version,10);if($.browser.msie&&A<7){openAlertDialog({title:vBulletin.phrase.get("warning"),message:vBulletin.phrase.get("style_generator_browser_not_supported"),iconType:"warning"});return }if(typeof styleGeneratorContent=="undefined"){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/style_generator",success:function(B){styleGeneratorContent=B;$("#color-style").html(B);showStyleGenerator()},error_phrase:"error_fetching_dialog"});return }showStyleGenerator()});function showStyleGenerator(){$("#jscheck").hide();$("#color-style").show().find("select.custom-dropdown").selectBox().end().find("a").on("click",function(){$(this).blur()});$("#model a").on("click",function(){setScheme(this.id);return false});$("#tab-wheel").on("click",function(){togglePane("wheel");return false});$("#tab-vars").on("click",function(){togglePane("vars");return false});$("#wheel,#saturation,#contrast").on("mousedown",function(H){H.preventDefault();var J=$(this);var I=J.offset();drag.on=true;drag.dW=J.width();drag.dH=J.height();drag.dX=I.left+drag.dW/2;drag.dY=I.top+drag.dH/2;J.on("mousemove",function(K){K.preventDefault();dragMove(K,this)});if(!drag.dot){dragMove(H,this)}}).on("mouseup",function(H){H.preventDefault();$(this).off("mousemove");drag.on=false;drag.dot=null;updateColorData()});$(".dot").on("mousedown",function(H){drag.dot=this}).on("mouseup",function(H){drag.dot=null});$("#dot1").on("dblclick",enterHue);$("#hue-val").on("click",enterHue);$("#dot2").on("dblclick",enterComplHue);$("#dot3").on("dblclick",enterDist);$("#dist-val").on("click",enterDist);$("#rgb-val").on("click",enterRGB);$("#sample-val").on("dblclick",function(I){var H=prompt(vBulletin.phrase.get("enter_hex"))});toggleContrast();$("#tab-light-ps").on("click",function(){pagePreview("light-ps");return false});$("#tab-light-pt").on("click",function(){pagePreview("light-pt");return false});$("#tab-grey").on("click",function(){pagePreview("grey");return false});$("#tab-dark").on("click",function(){pagePreview("dark");return false});$("#menu a").on("click",function(H){H.preventDefault();$(this).blur()});$("#menu-undo").on("click",function(){History.back();return false});$("#menu-redo").on("click",function(){History.fwd();return false});$("#save-color-style").on("click",function(){exportCols();return false});$("#menu-tooltips").on("click",function(){useShowTooltips();return false});$("#preview-palette .cbox").on("click",function(){if($("#tab-vars").hasClass("sel")&&UseManualVars){var H=$(this).attr("rel");var I=H.split("-");I=I[0];$("#manualvars a.ttl").filter(function(){return $(this).attr("rel")==I}).click();$("#manualvars a.col").filter(function(){return $(this).attr("rel")==H}).click()}return false});showTooltips();History.updateMenu();var D=document.location.search.substring(1);if(D){D=D.split("&");var C,A,E,B,G;API.data={};for(C=0,A=D.length;C<A;C++){E=D[C].split("=");B=E[0].toString();G=E[1].toString();API.data[B]=G}if(API.data.returnurl){API.on=true;if(API.data.format!="hex"&&API.data.format!="rgb"){API.data.format="hex"}if(API.data.method!="get"&&API.data.method!="post"){API.data.format="get"}}}var F=document.location.hash.substring(1);if(F){loadScheme(F)}else{loadScheme("3E11TvVw5w0w0");usePreset("default");updateScheme();if(Palette.UseVarsOverlay){toggleContrast()}}populatePaletteText("light-ps");changePreview()}function setStyleAttr(D,A,C,B){if(D instanceof $&&D.length>0){return D.each(function(){var E=$(this),G=E.attr("style")?E.attr("style").split(";"):[],F=[];$.each(G,function(I,H){if(A==$.trim(H.split(":")[0])){F.push("{0}:{1}{2}".format(A,C,(B?" !important":"")))}else{F.push(H)}});if(!E.data("orig-style")&&E.attr("style")){E.data("orig-style",E.attr("style"))}E.attr("style",F.join(";"))})}return $()}function loadScheme(A){Palette.unserialize(A);updateScheme();if(Palette.UseVarsOverlay){toggleContrast()}}function togglePane(B,A){if(A==undefined){var A=true}if(!$("#tab-"+B).hasClass("sel")){$(".pane").hide();$("#pane-"+B).fadeIn(250);$("#tabs-color a").removeClass("sel");$("#tab-"+B).addClass("sel").blur()}if(B=="wheel"){updateWheel();$("#manualvars a.sel").removeClass("sel");$("#manualvars a#pal-pri-0").addClass("sel")}else{if((B=="vars")&&(A)){updateVars();setOriginalColor()}}}function toggleContrast(A){if(A=="c1"){Palette.resetVarsOverlay()}else{$("#manualvars, #ttl-c2").fadeIn(750);UseManualVars=true}updateVars()}function setScheme(A){Palette.setScheme(A);updateScheme()}function usePreset(B){if(!B){return }var A=Palette.usePreset(B);updateVars()}function useColorBlind(A){defs.CBPreview=A;$("#menu-vision, #colorblind a").removeClass("sel");if(A>0){$("#menu-vision").addClass("sel");$("#colorblind a").eq(A).addClass("sel");$("#cb-warning").show()}else{$("#cb-warning").hide()}colorize()}function useShowTooltips(){var A=!$("#menu-tooltips").hasClass("sel");if(A){showTooltips()}else{hideTooltips()}}function checkFPS_on(){}function checkFPS_off(){}function updateScheme(){var A=Palette.Scheme;$("#model a").removeClass("sel");$("#"+A).addClass("sel").blur();$("#dot3").css("display",Boolean(Palette.Sec1)?"block":"none");$("#dist-val").css("display",Boolean(Palette.Sec1)?"block":"none");updateWheel();if($("#tab-vars").hasClass("sel")){updateVars()}}function updateWheel(){checkFPS_on();moveDot(1,Palette.Primary);moveDot(3,Palette.Sec1);var A=Palette.Primary.Col[0].RGB;$("#hue-val span").html(Palette.H+"&deg;");$("#rgb-val span").text(A.getHex());$("#rgb-r").html(Math.round(A.R/255*100)+" %");$("#rgb-g").html(Math.round(A.G/255*100)+" %");$("#rgb-b").html(Math.round(A.B/255*100)+" %");$("#dist-val span").html(Palette.Dist+"&deg;");colorize();checkFPS_off()}function updateVars(){if(UseManualVars){updateManualVars()}else{$("#saturation").css("background-color",Palette.Primary.Base.RGB.getCSS());updateContrast()}updateSV()}function updateSV(){checkFPS_on();var A,C;if(UseManualVars){var B=Palette.getVarOverlay(VarSelected[0],VarSelected[1]);A=B[0];C=B[1];A=A-0.5;C=C-0.5;moveSliderDot("#dots,#dotv"+VarSelected[1],A,-C)}else{A=Palette.dS;C=Palette.dV;A=A<0?(A+1)*0.9-0.5:0.4+A*0.1;C=C<0?(C+1)*0.9-0.5:0.4+C*0.1;moveSliderDot("#dots",A,-C)}colorize();checkFPS_off()}function updateContrast(){checkFPS_on();var A=Palette.cL,B=Palette.cS;moveSliderDot("#dotc",A-0.5,0.5-B);colorize();checkFPS_off()}var UseManualVars=false;var VarSelected=[0,0];var ColorHash={pri:0,sec1:1,sec2:2,compl:3};function updateManualVars(){function A(J,I,C){var H,F,D,G='<a class="ttl" rel="'+I+'" href="#"></a>';G+='<ul class="var-set" id="">';for(var E=0;E<5;E++){H=J.getVarRGB(E).getHex();F=I+"-"+E;G+='<li><a class="col" id="pal-'+F+'" rel="'+F+'" href="#"><img src="'+pageData.baseurl+'/images/style_generator/e.png" id="cbox-bg-'+F+'" class="cbox bg-'+F+'" />';G+='<span id="info-'+I+"-"+E+'" class="paletteInfo"></span>';G+="</a></li>"}G+="</ul>";return G}var B='<ul class="palettedisplay">';B+="<li>"+A(Palette.Primary,"pri","")+"</li>";B+="<li>"+A(Palette.Sec1,"sec1","")+"</li>";B+="</ul>";$("#manualvars").html(B);$("#manualvars a.ttl").on("click",function(){var D,C,E=$(this).attr("rel");for(D=0;D<5;D++){C=Palette.getVarOverlay(ColorHash[E],D);moveSliderDot("#dotv"+D,C[0]-0.5,-C[1]+0.5)}if($(this).next(".var-set").hasClass("sel")){return false}$("#manualvars .var-set.sel").removeClass("sel").slideUp("fast");$(this).blur().next(".var-set").addClass("sel").slideDown("fast").find("a.col").eq(0).click();return false});$("#manualvars a.col").on("mouseenter",function(){var C=$("#preview-palette").find(".bg-"+$(this).attr("rel")).addClass("hilite")}).on("mouseleave",function(){var C=$("#preview-palette").find(".bg-"+$(this).attr("rel")).removeClass("hilite")}).on("click",function(){$("#manualvars a.sel").removeClass("sel");$(this).blur().addClass("sel");VarSelected=$(this).attr("rel").split("-");VarSelected[0]=ColorHash[VarSelected[0]];$("#saturation").css("background-color",Palette.getColorByIdx(VarSelected[0]).Base.RGB.getCSS());setOriginalColor();updateSV();return false});$("#manualvars a.ttl").eq(0).click();$("#manualvars a.col").on("click",function(){togglePane("vars",false)});populatePaletteText($("#tabs-preview a.sel").attr("id").replace(/tab-/g,""))}function exportCols(){if(check_save_valid!==undefined){if(!check_save_valid()){return false}}function B(H){var G=[];for(var F=0;F<5;F++){v=H.getVarRGB(F);G.push({hex:v.getHex(),r:v.R,g:v.G,b:v.B})}return G}var A={primary:B(Palette.Primary)};if(Palette.Sec1){A.secondary=B(Palette.Sec1)}if(Palette.Compl){A.complement=B("Palette.Compl")}var E=$("#styleform #form-name").val();var C=$("#styleform select[name=parentid]");var D=C.val();vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/style/saveGeneratedStyle",error_phrase:"style_errors",data:{type:$(".previewtab.sel").data("type"),id:SchemeID,scheme:A,name:E,parentid:D,displayorder:$("#styleform #form-displayorder").val(),userselect:$("#styleform input:radio[name=userselect]:checked").val()},success:function(F){var G=$("#styleform select[name=parentid] option[value={0}]".format(D));var H=G.data("depth")+2;G.after('<option value="{0}" data-depth="{2}">{1}</option>'.format(F.overwritestyleid,str_repeat(C.data("indent"),H)+E,H));C.val(F.overwritestyleid);$("#styleform #form-name").val("");openAlertDialog({title:vBulletin.phrase.get("done"),message:vBulletin.phrase.get("saved_style_x_successfully",E)})}})}function pagePreview(A){var B=$("#tabs-preview a.sel").attr("id").replace("tab-","");$("a.previewtab").removeClass("sel");$("#tab-"+A).addClass("sel").blur();$("a.previewing").removeClass("selected");$("li.savemenu").removeClass("selected");$("#menu-"+A).addClass("selected").blur();$("#menu-export-"+A).addClass("selected").blur();populatePaletteText(A);changePreview(B,A);colorize()}function changePreview(B,G){function A(I){$.each(I,function(J,K){$(J).removeClass(K);$(J).attr("style",$(J).data("orig-style"))})}function F(I){$.each(I,function(J,K){$(J).addClass(K);$(J).css("background-color","")})}var E={"#vb-page-body":"bg-pri-0","#vb-page-body":"col-pri-0","#wrapper":"bg-pri-3","#header":"bg-pri-2","#channel-tabbar, #channel-subtabbar, #footer-subtabbar, #footer-tabbar":"bg-pri-2","#channel-tabbar ul, #channel-subtabbar ul, #footer-subtabbar ul, #footer-tabbar ul.nav-list":"bg-sec1-0","#channel-tabbar ul li, #channel-subtabbar ul li, #footer-subtabbar ul li, #footer-tabbar ul.nav-list li":"bg-sec1-0","#channel-tabbar ul li a, #channel-subtabbar ul li a, #footer-subtabbar ul li a,  #footer-tabbar ul.nav-list li a":"col-pri-1",".canvas-widget":"bg-pri-1","#subforumdescription":"bg-pri-3","#footer-tabbar":"bg-pri-2",".topic-title":"col-pri-2",".b-post-control__label":"col-pri-2",".widget-content, .post-content":"col-pri-0",};var D={"#wrapper":"bg-wh-sec0","#vb-page-body":"col-pri-1","#channel-tabbar, #channel-subtabbar, #footer-subtabbar, #footer-tabbar":"bg-pri-1","#channel-tabbar ul, #channel-subtabbar ul, #footer-subtabbar ul, #footer-tabbar ul.nav-list":"bg-pri-1","#channel-tabbar ul li, #channel-subtabbar ul li, #footer-subtabbar ul li, #footer-tabbar ul.nav-list li":"bg-pri-2","#channel-tabbar ul li a, #channel-subtabbar ul li a, #footer-subtabbar ul li a,  #footer-tabbar ul.nav-list li a":"col-pri-1",".canvas-widget":"bg-wy-sec0",".topic-title":"col-pri-0",".b-post-control__label":"col-pri-0",".widget-content, .post-content":"col-pri-0",".list-item":"bg-wy-sec0"};var C={"#vb-page-body":"bg-gy-pri0","#wrapper":"bg-gy-sec0","#header":"bg-gy-pri0","#channel-tabbar, #channel-subtabbar, #footer-subtabbar, #footer-tabbar":"bg-gy-pri0","#channel-tabbar ul, #channel-subtabbar ul, #footer-subtabbar ul, #footer-tabbar ul.nav-list":"bg-pri-0","#channel-tabbar ul li, #channel-subtabbar ul li, #footer-subtabbar ul li, #footer-tabbar ul.nav-list li":"bg-pri-0",".canvas-widget":"bg-gy-sec0","#subforumdescription":"bg-gy-pri0",".topic-title":"col-pri-3",".b-post-control__label":"col-pri-3",".widget-content, .post-content":"col-pri-0",".list-item":"bg-gy-sec0"};var H={"#vb-page-body":"bg-dk-pri0","#wrapper":"bg-dk-pri0","#header":"bg-dk-pri0","#channel-tabbar, #channel-subtabbar, #footer-subtabbar, #footer-tabbar":"bg-dk-pri0","#channel-tabbar ul, #channel-subtabbar ul, #footer-subtabbar ul, #footer-tabbar ul.nav-list":"bg-pri-0","#channel-tabbar ul li, #channel-subtabbar ul li, #footer-subtabbar ul li, #footer-tabbar ul.nav-list li":"bg-pri-0",".canvas-widget":"bg-pri-0","#subforumdescription":"bg-dk-pri0",".topic-title":"col-pri-3",".b-post-control__label":"col-pri-3",".widget-content, .post-content":"col-dk-sec0",".list-item":"bg-dk-sec0"};switch(B){case"light-ps":A(E);break;case"light-pt":A(D);break;case"grey":A(C);break;case"dark":A(H);break;default:A(E);A(D);A(C);A(H)}switch(G){case"light-pt":F(D);break;break;case"grey":F(C);break;case"dark":F(H);break;case"default":break;case"light-ps":default:F(E)}}var LastRefresh=0,RefreshTimerID;function colorize(){var A=new Date().valueOf();var B=A-LastRefresh;if(B<defs.MaxRedrawRate){if(!RefreshTimerID){RefreshTimerID=setTimeout(doColorize,defs.MaxRedrawRate-B)}}else{doColorize()}}function doColorize(){if(RefreshTimerID){clearTimeout(RefreshTimerID)}RefreshTimerID=null;LastRefresh=new Date().valueOf();var F,E,G,A;$(".bg-pri").css("background-color",Palette.Primary.Base.RGB.getCSS());for(var D=0;D<5;D++){G=Palette.Primary.Col[D];if(Palette.Sec1){A=Palette.Sec1.Col[D]}else{A=Palette.Primary.Col[3]}F=G.RGB;E=A.RGB;if(defs.CBPreview){F="#"+ColorBlind.getHex(F.R,F.G,F.B,defs.CBPreview);E="#"+ColorBlind.getHex(E.R,E.G,E.B,defs.CBPreview)}else{F=F.getCSS();E=E.getCSS()}var C=parseInt($.browser.version,10);if($.browser.msie&&C==7){$("#cbox-bg-pri-"+D).attr("title",rgb2hex(F));$("#cbox-bg-sec1-"+D).attr("title",rgb2hex(E))}$(".col-pri-"+D).css("color",F);$(".col-sec1-"+D).css("color",E);$(".bg-pri-"+D).css("background-color",F).each(function(){this.paletteInfo={col:G,out:F}});$(".bg-sec1-"+D).css("background-color",E).each(function(){this.paletteInfo={col:A,out:E}});$("#currentcolor").css("background-color",$(".var-set .sel img").css("background-color"));$(".brd-pri-"+D).css("border-color",F);$(".brd-sec1-"+D).css("border-color",E)}SchemeID=Palette.serialize();var B=SchemeID;if(B.length>64){B="ID too long to display"}$("#schemeid a").html(B).attr("href",document.location.pathname+"#"+SchemeID);if(!drag.on){updateColorData()}}function updateColorData(){History.add();var A=parseInt($.browser.version,10);if($.browser.msie&&A==7){return }colorTooltips()}var History={List:[],Ptr:-1,add:function(){setOriginalColor();if(this.Ptr<0||this.List[this.Ptr]!=SchemeID){if(this.List.length>this.Ptr+1){this.List=this.List.splice(0,this.Ptr+1)}this.List.push(SchemeID);this.Ptr++;this.updateMenu()}},back:function(){if(this.Ptr<1){return }this.Ptr--;loadScheme(this.List[this.Ptr]);this.updateMenu()},fwd:function(){if(this.Ptr>=this.List.length-1){return }this.Ptr++;loadScheme(this.List[this.Ptr]);this.updateMenu()},updateMenu:function(){if(this.Ptr>0){$("#menu-undo").removeClass("h-disabled")}else{$("#menu-undo").addClass("h-disabled")}if(this.Ptr<this.List.length-1){$("#menu-redo").removeClass("h-disabled")}else{$("#menu-redo").addClass("h-disabled")}}};var moveTimer=0;function dragMove(B,C){var A=new Date();if(A-moveTimer<defs.FPSlimiter){return false}moveTimer=A;if(C.id=="wheel"){moveOnWheel(B)}else{moveOnSlider(B,C)}}function moveOnWheel(E){var A,H,C,D,G=false,F=false;if(E){A=E.pageX-drag.dX;H=E.pageY-drag.dY;C=Math.round(((Math.atan2(-A,H)*180/Math.PI)+180)%360);D=Math.sqrt(A*A+H*H)}else{G=true,F=true}if(D>60&&D<160){var B="dot1";if(drag.dot){B=drag.dot.id}if(B=="dot1"||B=="dot2"){if(D>125){if(D<135){C=(Math.floor((C-7.5)/15+1)*15)%360}else{C=(Math.floor((C-15)/30+1)*30)%360}}if(B=="dot2"){C=(C+180)%360}G=Palette.setHue(C)}else{if(Palette.Scheme=="m1"&&B=="dot4"){C=(C+180)%360}F=Palette.setDist(C)}}if(G||F){updateWheel()}}function moveOnSlider(F,H){var B=F.pageX-drag.dX;var G=F.pageY-drag.dY;B=B/defs.sliderWidth;G=G/defs.sliderWidth;if(B<-0.5){B=-0.5}if(B>0.5){B=0.5}if(G<-0.5){G=-0.5}if(G>0.5){G=0.5}if(H.id=="saturation"){var E,C;if(UseManualVars){E=B+0.5;C=-G+0.5;Palette.setVarOverlay(VarSelected[0],VarSelected[1],E,C)}else{E=B>0.4?(B-0.4)/0.1:(B+0.5)/0.9-1;G=-G;C=G>0.4?(G-0.4)/0.1:(G+0.5)/0.9-1;Palette.setSV(E,C)}updateSV()}else{if(H.id=="contrast"){var A=B+0.5;var D=0.5-G;Palette.setContrast(D,A);updateContrast()}}}function moveDot(D,A){if(!A){return }var B=A.Col[0].HSV.H;var C=(B-90)/360*2*Math.PI;x=Math.round(defs.wheelMid.X+109*Math.cos(C))-defs.dotSize;y=Math.round(defs.wheelMid.Y+109*Math.sin(C))-defs.dotSize;$("#dot"+D).css("left",x+"px").css("top",y+"px")}function moveSliderDot(B,A,C){A=defs.sliderMid.X+A*defs.sliderWidth-defs.dotSize+1;C=defs.sliderMid.Y+C*defs.sliderWidth-defs.dotSize+3;$(B).css("left",A+"px").css("top",C+"px")}function myPrompt(B,A,C){openPromptDialog({message:B,initialValue:A,validation:{type:"string"},onClickOK:C})}function getExpr(s){if(!s){return""}s=String(s);if(s.match(/[0-9\.\+\-\*/ ]+/)){s=eval(s)}return s}function enterHue(){myPrompt(vBulletin.phrase.get("enter_hue")+" (0&deg;-360&deg;)",Palette.H,enterHue2)}function enterHue2(A){A=parseInt(getExpr(A),10)%360;if(A>=0&&A<=360){Palette.setHue(A%360);updateWheel()}}function enterComplHue(){myPrompt(vBulletin.phrase.get("enter_complement_hue")+" (0&deg;&ndash;360&deg;)",(Palette.H+180)%360,enterComplHue2)}function enterComplHue2(A){A=parseInt(getExpr(A),10)%360;if(A>=0&&A<=360){Palette.setHue((A+180)%360);updateWheel()}}function enterDist(){var B=Palette.SchemeModel.minD,A=Palette.SchemeModel.maxD;myPrompt(vBulletin.phrase.get("enter_distance_angle")+" ("+B+"&deg;&ndash;"+A+"&deg;)",Palette.Dist,enterDist2)}function enterDist2(B){var C=Palette.SchemeModel.minD,A=Palette.SchemeModel.maxD;B=Math.abs(parseInt(getExpr(B),10));if(B>=C&&B<=A){Palette.setDistNum(B);updateWheel()}}function enterRGB(){myPrompt(vBulletin.phrase.get("enter_hex_value")+" (000000&ndash;FFFFFF)",Palette.Primary.getVarRGB(0).getHex(),enterRGB2)}function enterRGB2(D){if(!D){return""}D=String(D);if(D.match(/^\s*#?([0-9a-f]{6}|[0-9a-f]{3})\s*$/i)){if(D.length==3){D="#"+D}if(D.length==4){D=D.substr(1,1)+D.substr(1,1)+D.substr(2,1)+D.substr(2,1)+D.substr(3,1)+D.substr(3,1)}if(D.length==6){D="#"+D}D=D.substr(1,6);var F=hex2dec(D.substring(0,2));var E=hex2dec(D.substring(2,4));var A=hex2dec(D.substring(4,6));var C=new RGB(F,E,A);var B=ColorWheel.getColorByRGB(C);Palette.setHSV(B);updateWheel()}}function colorTooltips(){}function showTooltips(){$("#menu-tooltips").addClass("sel").html(vBulletin.phrase.get("hide_tooltips"))}function hideTooltips(){$("#menu-tooltips").removeClass("sel").html(vBulletin.phrase.get("show_tooltips"))}function populatePaletteText(B){var G=$("#debug-information").length==1;switch(B){case"light-ps":var E=palInfoColorPri;var F=palInfoColorSec;break;case"light-pt":var E=palInfoWhitePri;var F=palInfoWhiteSec;break;default:var E=palInfoDarkPri;var F=palInfoDarkSec}for(var D=0;D<5;D++){$("#pal-pri-"+D).parent().css("display",E[D]==""?"none":"");$("#pal-sec1-"+D).parent().css("display",F[D]==""?"none":"");var C=parseInt($.browser.version,10);if($.browser.msie&&C==7){var A=$("#cbox-bg-pri-"+D).css("background-color");var H=rgb2hex(A);$("#cbox-bg-pri-"+D).attr("title",H);$("#cbox-bg-sec1-"+D).attr("title",H)}$("#info-pri-"+D).html(vBulletin.phrase.get(E[D])+(G?" (Primary "+D+")":""));$("#info-sec1-"+D).html(vBulletin.phrase.get(F[D])+(G?" (Secondary "+D+")":""))}}function rgb2hex(A){A=A.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!A){return""}return"#"+hex(A[1])+hex(A[2])+hex(A[3])}function hex(A){hexDigits=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");return isNaN(A)?"00":hexDigits[(A-A%16)/16]+hexDigits[A%16]}function setOriginalColor(){$("#originalcolor").css("background-color",$("#manualvars a.sel img").css("background-color"))}function check_save_valid(){var B=document.getElementById("form-name");if(B===null){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_need_name"),iconType:"warning"});return false}B.value=$.trim(B.value);if(B.value==""){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_need_name"),iconType:"warning",onAfterClose:function(){B.focus()}});return false}if(B.value.length>128||B.value.indexOf("'")!==-1||B.value.indexOf('"')!==-1){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_invalid_name"),iconType:"warning",onAfterClose:function(){B.focus()}});return false}var A=document.getElementById("form-displayorder");if(A===null){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_need_order"),iconType:"warning"});return false}if(isNaN(parseInt(A.value))){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_need_order"),iconType:"warning",onAfterClose:function(){A.focus()}});return false}if(parseInt(A.value)<=0){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_negative"),iconType:"warning",onAfterClose:function(){A.focus()}});return false}if(parseInt(A.value)>=1000){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("err_order_too_large"),iconType:"warning",onAfterClose:function(){A.focus()}});return false}return true}var palInfoColorPri=["primary0_info","primary1_info","primary2_info","primary3_info","primary4_info"];var palInfoColorSec=["secondary0_info","secondary1_info","secondary2_info","","secondary4_info"];var palInfoWhitePri=["primary0_info","primary1_info","primary2_info","",""];var palInfoWhiteSec=["","","","",""];var palInfoDarkPri=["primary0_info","","","primary3_info",""];var palInfoDarkSec=["","","","",""];;

// ***************************
// js.compressed/vbulletin_stylegeneratorcolor.js
// ***************************
function HSV(C,B,A){this.set=function(F,E,D){this.H=F;this.S=E;this.V=D};this.copy=function(){return new HSV(this.H,this.S,this.V)};this.set(C,B,A)}function RGB(C,A,D){this.set=function(F,E,H){this.R=Math.round(F);this.G=Math.round(E);this.B=Math.round(H)};this.copy=function(){return new RGB(this.R,this.G,this.B)};this.toWebCol=function(){this.R=Math.round(this.R/51)*51;this.G=Math.round(this.G/51)*51;this.B=Math.round(this.B/51)*51};this.getCSS=function(){return"rgb("+this.R+","+this.G+","+this.B+")"};this.getHex=function(){return dec2hex(this.R)+dec2hex(this.G)+dec2hex(this.B)};this.set(C,A,D)}var Primary={R:{RGB:new RGB(255,0,0),HSV:new HSV(0,1,1)},RG:{RGB:new RGB(255,255,0),HSV:new HSV(120,1,1)},G:{RGB:new RGB(0,255,0),HSV:new HSV(180,1,0.8)},GB:{RGB:new RGB(0,255,255),HSV:new HSV(210,1,0.6)},B:{RGB:new RGB(0,0,255),HSV:new HSV(255,0.85,0.7)},BR:{RGB:new RGB(255,0,255),HSV:new HSV(315,1,0.65)}};function gInc(B,A,C){return(C==-1)?B:B+(A-B)/(1+C)}function gDec(B,A,C){return(C==-1)?A:A+(B-A)/(1+C)}var ColorWheel={getArc:function(A){if(A<120){return this.RRG}if(A<180){return this.RGG}if(A<210){return this.GGB}if(A<255){return this.GBB}if(A<315){return this.BBR}return this.BRR},RRG:{a:Primary.R,b:Primary.RG,f:function(A){if(A==0){return -1}return Math.tan((120-A)/120*Math.PI/2)*0.5},fi:function(A){if(A==-1){return 0}return 120-Math.atan(A/0.5)*120/Math.PI*2},g:gInc,orderRGB:function(A,B,C){return new RGB(A,B,C)}},RGG:{a:Primary.RG,b:Primary.G,f:function(A){if(A==180){return -1}return Math.tan((A-120)/60*Math.PI/2)*0.5},fi:function(A){if(A==-1){return 180}return 120+Math.atan(A/0.5)*60/Math.PI*2},g:gDec,orderRGB:function(A,B,C){return new RGB(B,A,C)}},GGB:{a:Primary.G,b:Primary.GB,f:function(A){if(A==180){return -1}return Math.tan((210-A)/30*Math.PI/2)*0.75},fi:function(A){if(A==-1){return 180}return 210-Math.atan(A/0.75)*30/Math.PI*2},g:gInc,orderRGB:function(A,B,C){return new RGB(C,A,B)}},GBB:{a:Primary.GB,b:Primary.B,f:function(A){if(A==255){return -1}return Math.tan((A-210)/45*Math.PI/2)*1.33},fi:function(A){if(A==-1){return 255}return 210+Math.atan(A/1.33)*45/Math.PI*2},g:gDec,orderRGB:function(A,B,C){return new RGB(C,B,A)}},BBR:{a:Primary.B,b:Primary.BR,f:function(A){if(A==255){return -1}return Math.tan((315-A)/60*Math.PI/2)*1.33},fi:function(A){if(A==-1){return 255}return 315-Math.atan(A/1.33)*60/Math.PI*2},g:gInc,orderRGB:function(A,B,C){return new RGB(B,C,A)}},BRR:{a:Primary.BR,b:Primary.R,f:function(A){if(A==0){return -1}return Math.tan((A-315)/45*Math.PI/2)*1.33},fi:function(A){if(A==-1){return 0}return 315+Math.atan(A/1.33)*45/Math.PI*2},g:gDec,orderRGB:function(A,B,C){return new RGB(A,C,B)}},getBaseColorByHue:function(E){E=E%360;var D,A,C=this.getArc(E);var B=C.f(E);A=C.g(C.a.HSV.V,C.b.HSV.V,B);D=C.g(C.a.HSV.S,C.b.HSV.S,B);return{HSV:new HSV(E,D,A),RGB:this._getRGB(E,D,A,C,B)}},getRGB:function(E,D,A){var C=this.getArc(E);var B=C.f(E);return this._getRGB(E,D,A,C,B)},_getRGB:function(J,E,C,A,D){var G,I,F,B=A.a.RGB;G=Math.max(B.R,Math.max(B.G,B.B));G=G*C;F=G*(1-E);if(D==-1){I=F}else{I=(G+F*D)/(1+D)}return A.orderRGB(G,I,F)},getColorByRGB:function(F){var J,D,B;if(F.R==F.B&&F.R==F.G){J=0;D=0;B=getLum(F)}else{var G,I,E,A,C;G=Math.max(F.R,Math.max(F.G,F.B));E=Math.min(F.R,Math.min(F.G,F.B));if(G==F.R){if(E==F.B){I=F.G;A=this.RRG}else{I=F.B;A=this.BRR}}else{if(G==F.G){if(E==F.R){I=F.B;A=this.GGB}else{I=F.R;A=this.RGG}}else{if(E==F.R){I=F.G;A=this.GBB}else{I=F.R;A=this.BBR}}}if(I==E){C=-1}else{C=(G-I)/(I-E)}J=A.fi(C);D=(G-E)/G;B=G/255}return new HSV(J,D,B)}};var Model={m1:{getH:function(B,A){return{S1:(B+A)%360,S2:(B-A+360)%360}},minD:5,maxD:360,getD:function(B,A){var C=Math.abs(angleDiff(B,A));return C}}};function angleDiff(C,B){if(B>C){var A=B-C}else{var A=360-(C-B)}return A}var CModel={shadow:[{dS:-0.5,dV:-0.5},{dS:1,dV:-0.7}],light:[{dS:-0.5,dV:1},{dS:-0.9,dV:1}],get:function(D,B){var C,A=[];A.push({dS:this.shadow[0].dS*D,dV:this.shadow[0].dV*D});A.push({dS:this.shadow[1].dS*D,dV:this.shadow[1].dV*D});A.push({dS:this.light[0].dS*B,dV:this.light[0].dV*B});A.push({dS:this.light[1].dS*B,dV:this.light[1].dV*B});return A}};function ColorVar(D,F,B,E,G){this.getVariant=function(M,L,K){function J(N,O){return(O<=0)?N*(O+1):N+(1-N)*O}var I=new HSV(M.H,J(M.S,L),J(M.V,K));var H=ColorWheel.getRGB(I.H,I.S,I.V);return{HSV:I,RGB:H}};this.getOverlayVariant=function(L,K,H){var J=new HSV(L.H,K,H);var I=ColorWheel.getRGB(J.H,J.S,J.V);return{HSV:J,RGB:I}};this.setCol=function(J,I,H){this.Col[J]=this.getVariant(this.Col0.HSV,I,H)};this.getVarHSV=function(H){return this.Col[H].HSV};this.getVarRGB=function(H){return this.Col[H].RGB};this.H=D;this.Base=ColorWheel.getBaseColorByHue(D);this.Col0=this.getVariant(this.Base.HSV,F,B);this.Col=[];if(G[0]){this.Col.push(this.getOverlayVariant(this.Base.HSV,G[0][0],G[0][1]))}else{this.Col.push(this.Col0)}for(var C=0,A=E.length;C<A;C++){if(G[C+1]){this.Col[C+1]=this.getOverlayVariant(this.Base.HSV,G[C+1][0],G[C+1][1])}else{this.Col[C+1]=this.getVariant(this.Col0.HSV,E[C].dS,E[C].dV)}}}var Palette={Scheme:"m1",SchemeModel:Model.m1,H:0,Dist:15,dS:0,dV:0,cS:0.5,cL:0.5,ContrastModel:CModel.get(0.5,0.5),UseVarsOverlay:false,VarsOverlay:[[],[],[],[]],setScheme:function(A){this.Scheme=A;this.SchemeModel=Model[this.Scheme];this.resetVarsOverlay(false);if(this.Sec1){this.setDist(this.Sec1.H)}},setHue:function(A){if(this.H===A){return false}this.H=Math.round(A)%360;this.resetVarsOverlay(false);return true},setHSV:function(A){this.setHue(A.H);var B=this.Primary.Base.HSV;if(B.S==0){this.dS=0}else{if(A.S>B.S){this.dS=(A.S-B.S)/(1-B.S)}else{this.dS=A.S/B.S-1}}if(B.V==0){this.dV=0}else{if(A.V>B.V){this.dV=(A.V-B.V)/(1-B.V)}else{this.dV=A.V/B.V-1}}this.resetVarsOverlay(false)},setDist:function(A){this.Dist=this.SchemeModel.getD(this.H,A);this.resetVarsOverlay(false);return true},setDistNum:function(A){this.Dist=A;this.resetVarsOverlay(false);return true},setSV:function(B,A){this.dS=B;this.dV=A;this.resetVarsOverlay(false)},setContrast:function(B,A){this.UseVarsOverlay=false;this.cS=B;this.cL=A;this.ContrastModel=CModel.get(B,A);this.resetVarsOverlay(false)},resetVarsOverlay:function(A){this.UseVarsOverlay=false;this.VarsOverlay=[[],[],[],[]];if(!A){this.update()}},setVarOverlay:function(C,B,E,D,A){this.UseVarsOverlay=true;this.VarsOverlay[C][B]=[E,D];if(!A){this.update()}},getVarOverlay:function(C,B){var A=this.VarsOverlay[C][B];if(A){return A}var D=this.getColorByIdx(C).Col[B].HSV;return[D.S,D.V]},update:function(A){var B=this.SchemeModel.getH(this.H,this.Dist);if(!A){this.Primary=new ColorVar(this.H,this.dS,this.dV,this.ContrastModel,this.VarsOverlay[0]);this.Compl=B.C==undefined?null:new ColorVar(B.C,this.dS,this.dV,this.ContrastModel,this.VarsOverlay[3])}this.Sec1=B.S1==undefined?null:new ColorVar(B.S1,this.dS,this.dV,this.ContrastModel,this.VarsOverlay[1]);this.Sec2=B.S2==undefined?null:new ColorVar(B.S2,this.dS,this.dV,this.ContrastModel,this.VarsOverlay[2])},serialize:function(){var C="";C+=myB64.encodeInt(this.H,2);C+=this.Scheme.substring(1);C+=myB64.encodeInt(this.Dist+90,2);C+=myB64.encodeFloat((this.dS+1)/2,2);C+=myB64.encodeFloat((this.dV+1)/2,2);C+=myB64.encodeFloat(this.cS,2);C+=myB64.encodeFloat(this.cL,2);if(this.UseVarsOverlay){var B,A;for(B=0;B<4;B++){for(A=0;A<5;A++){if(this.VarsOverlay[B][A]){C+=myB64.encodeInt(8*B+A,1);C+=myB64.encodeFloat((this.VarsOverlay[B][A][0]+1)/2,2);C+=myB64.encodeFloat((this.VarsOverlay[B][A][1]+1)/2,2)}}}}return C},unserialize:function(H){var C,A=[];var F=0;C=H.substring(F,F+2);C=myB64.decodeInt(C);if(C>=0&&C<360){A.push(C)}else{return false}F+=2;C="m"+H.substring(F,F+1);if(Model[C]){A.push(C)}else{return false}F+=1;C=H.substring(F,F+2);C=myB64.decodeInt(C)-90;if(C>=-180&&C<=180){A.push(C)}else{return false}F+=2;C=H.substring(F,F+2);C=myB64.decodeFloat(C,2,5)*2-1;if(C>=-1&&C<=1){A.push(C)}else{return false}F+=2;C=H.substring(F,F+2);C=myB64.decodeFloat(C,2,5)*2-1;if(C>=-1&&C<=1){A.push(C)}else{return false}F+=2;C=H.substring(F,F+2);C=myB64.decodeFloat(C,2,5);if(C>=0&&C<=1){A.push(C)}else{return false}F+=2;C=H.substring(F,F+2);C=myB64.decodeFloat(C,2,5);if(C>=0&&C<=1){A.push(C)}else{return false}F+=2;this.setAll(A[1],A[0],A[2],A[3],A[4],A[5],A[6]);if(H.length>F){var E,D,G,B;while(H.length>F){C=H.substring(F,F+1);C=myB64.decodeInt(C);E=Math.floor(C/8);D=C-E*8;if(E<0||E>3||D<0||D>4){return false}F+=1;C=H.substring(F,F+2);G=myB64.decodeFloat(C,2,5)*2-1;if(G<-1||G>1){return false}F+=2;C=H.substring(F,F+2);B=myB64.decodeFloat(C,2,5)*2-1;if(B<-1||B>1){return false}F+=2;this.setVarOverlay(E,D,G,B,true);push}this.update()}},setAll:function(C,E,G,F,B,D,A){this.Scheme=C;this.SchemeModel=Model[this.Scheme];this.H=E;this.Dist=G;this.dS=F;this.dV=B;this.cS=D;this.cL=A;this.ContrastModel=CModel.get(this.cS,this.cL);this.resetVarsOverlay()},Presets:[{id:"default",name:"Default Scheme",dS:0,dV:0,cS:0.5,cL:0.5}],getPreset:function(C){for(var B=0,A=this.Presets.length;B<A;B++){if(this.Presets[B].id==C){return this.Presets[B]}}return this.Presets[0]},usePreset:function(B){this.resetVarsOverlay();var A=this.getPreset(B);this.setSV(A.dS,A.dV);this.setContrast(A.cS,A.cL)},getColorByIdx:function(B){var A=["Primary","Sec1"];if(!A[B]){B=0}return this[A[B]]}};Palette.update();function dec2hex(C,A){if(!A){A=2}var B=C.toString(16);while(B.length<A){B="0"+B}return B.toUpperCase()}function hex2dec(A){return parseInt(A,16)}function flags2dec(B){var A=0;for(var C=0;C<8;C++){if(B[C]){A|=Math.pow(2,C)}}return A}function dec2flags(C){var A=[];for(var B=0;B<8;B++){A[B]=C&Math.pow(2,B)}return A}function rgb2hex(A){return dec2hex(A.R)+dec2hex(A.G)+dec2hex(A.B)}function getLum(A){return lum=(A.R*0.299+A.G*0.587+A.B*0.114)/255}function col2Gray(B){var A=Math.round(getLum(B)*255);return rgb2hex({R:A,G:A,B:A})}var myB64={_key:"0123456789abcdefghijklmnopqrstuvwxyz.ABCDEFGHIJKLMNOPQRSTUVWXYZ-",_pad:"0000000000000000",encodeInt:function(E,B){var D="",C,A=E;if(!E){D="0"}while(A){C=A&63;D=this._key.charAt(C)+D;A>>=6}if(B){D=this._pad+D;D=D.substring(D.length-B)}return D},decodeInt:function(D){var B,C,E=0;if(!D){return 0}for(var C=0,A=D.length;C<A;C++){E<<=6;B=this._key.indexOf(D.charAt(C));E|=B}return E},encodeFloat:function(B,A){if(!A){A=1}var C=Math.round((Math.pow(64,A)-1)*B);return this.encodeInt(C,A)},decodeFloat:function(D,B,F){var E=this.decodeInt(D);if(!E){return 0}var A=E/(Math.pow(64,B)-1);if(F){var C=Math.pow(10,F);A=Math.round(A*C)/C}return A}};var ColorBlind={getHex:function(A,G,N,L){function E(T,Q,S,R){return Math.round(T-Math.abs((S-R)/51)*(T-Q))}var D=Math.round(A/51)*51;var B=Math.round(G/51)*51;var O=Math.round(N/51)*51;var C=(D<A)?D+51:((D>A)?D-51:D);var P=(B<G)?B+51:((B>G)?B-51:B);var M=(O<N)?O+51:((O>N)?O-51:O);var I=this.colTbl[dec2hex(D)+dec2hex(B)+dec2hex(O)][L];var H=this.colTbl[dec2hex(C)+dec2hex(P)+dec2hex(M)][L];var F=E(hex2dec(I.substring(0,2)),hex2dec(H.substring(0,2)),D,A);var K=E(hex2dec(I.substring(2,4)),hex2dec(H.substring(2,4)),B,G);var J=E(hex2dec(I.substring(4,6)),hex2dec(H.substring(4,6)),O,N);return dec2hex(F)+dec2hex(K)+dec2hex(J)},typeDesc:["Normal vision (85.5 % of population)","Protanopy (1 % of men, 0.02 % of women)","Deuteranopy (1 % of men, 0.1 % of women)","Tritanopy (0.003 % of population)","Protanomaly (1 % of men, 0.01% of women)","Deuteranomaly (5 % of men, 0.4 % of women)","Tritanomaly (0.01 % of population)","Full colorblindness (0.005 % of population)","Atypical monochromatism (0.005 % of population)"],colTbl:{FFFFFF:["FFFFFF","FFFAFA","FFE8EF","F4F0FF","FFFCFC","FFF3F7","F9F7FF","FFFFFF","FFFFFF"],FFFFCC:["FFFFCC","FFF2C8","FFDFC8","FDEFFF","FFF8CA","FFEFCA","FEF7E5","EEEEEE","F1F1E7"],FFFF99:["FFFF99","FFEDA2","FFDAAD","FFEAF9","FFF69D","FFECA3","FFF4C9","DDDDDD","E3E3CF"],FFFF66:["FFFF66","FFEA86","FFD79D","FFE6F5","FFF476","FFEB81","FFF2AD","CCCCCC","D6D6B7"],FFFF33:["FFFF33","FFE975","FFD594","FFE5F3","FFF454","FFEA63","FFF293","BBBBBB","C8C89F"],FFFF00:["FFFF00","FFE871","FFD592","FFE4F2","FFF338","FFEA49","FFF179","AAAAAA","BBBB88"],FFCCFF:["FFCCFF","CFD7FF","E1D8FD","FBD1E1","E7D1FF","F0D2FE","FDCEF0","EEEEEE","F1E7F1"],FFCCCC:["FFCCCC","DED8D2","F1D2CB","FFCAD8","EED2CF","F8CFCB","FFCBD2","DDDDDD","E3D9D9"],FFCC99:["FFCC99","E5D69D","FCCD99","FFC4D1","F2D19B","FDCC99","FFC8B5","CCCCCC","D6CCC1"],FFCC66:["FFCC66","E9D469","FFCA6F","FFC0CD","F4D067","FFCB6A","FFC699","BBBBBB","C8BEAA"],FFCC33:["FFCC33","ECD435","FFC857","FFBFCA","F5D034","FFCA45","FFC57E","AAAAAA","BBB092"],FFCC00:["FFCC00","ECD30F","FFC750","FFBECA","F5CF07","FFC928","FFC565","999999","ADA37A"],FF99FF:["FF99FF","AABDFF","B0BCF9","F6A9B5","D4ABFF","D7AAFC","FAA1DA","DDDDDD","E3CFE3"],FF99CC:["FF99CC","B1B8E0","C5B5C7","FC9FAA","D8A8D6","E2A7C9","FD9CBB","CCCCCC","D6C1CC"],FF9999:["FF9999","BDB6A8","D2B095","FF99A2","DEA7A0","E8A497","FF999D","BBBBBB","C8B4B4"],FF9966:["FF9966","C4B470","DAAC62","FF959E","E1A66B","ECA264","FF9782","AAAAAA","BBA69C"],FF9933:["FF9933","C7B43A","DEAB2A","FF949D","E3A636","EEA22E","FF9668","999999","AD9984"],FF9900:["FF9900","C8B317","DFAA00","FF949C","E3A60B","EFA100","FF964E","888888","9F8B6C"],FF66FF:["FF66FF","98B2FF","85A7F5","F28791","CB8CFF","C286FA","F876C8","CCCCCC","D6B7D6"],FF66CC:["FF66CC","82A0F6","A09FC3","F87981","C083E1","CF82C7","FB6FA6","BBBBBB","C8AABE"],FF6699:["FF6699","999DB9","B19992","FD6E74","CC81A9","D87F95","FE6A86","AAAAAA","BB9CA6"],FF6666:["FF6666","A59B7C","BB955E","FF666C","D28071","DD7D62","FF6669","999999","AD8E8E"],FF6633:["FF6633","AA9A42","BF9322","FF656A","D4803A","DF7C2A","FF654E","888888","9F8177"],FF6600:["FF6600","AC9A1E","C09300","FF6569","D5800F","DF7C00","FF6534","777777","92735F"],FF33FF:["FF33FF","96B1FF","679BF2","F07178","CA72FF","B367F8","F752BB","BBBBBB","C89FC8"],FF33CC:["FF33CC","779DFF","8A92C1","F75E63","BB68E5","C462C6","FB4897","AAAAAA","BB92B0"],FF3399:["FF3399","7A8ECE","9D8B8F","FB4C4F","BC60B3","CE5F94","FD3F74","999999","AD8499"],FF3366:["FF3366","8F8C8B","A7875C","FE3D3E","C75F78","D35D61","FE3852","888888","9F7781"],FF3333:["FF3333","988B4A","AD841C","FF3332","CB5F3E","D65B27","FF3332","777777","926969"],FF3300:["FF3300","9A8B23","AE8600","FF3331","CC5F11","D65C00","FF3318","666666","845B51"],FF00FF:["FF00FF","96B1FF","5E98F1","F06A71","CA58FF","AE4CF8","F735B8","AAAAAA","BB88BB"],FF00CC:["FF00CC","7BA0FF","838FC0","F6555A","BD50E5","C147C6","FA2A93","999999","AD7AA3"],FF0099:["FF0099","6E89D7","97888E","FA4042","B644B8","CB4493","FC206D","888888","9F6C8B"],FF0066:["FF0066","888892","A2835B","FD2B28","C3447C","D04160","FE1547","777777","925F73"],FF0033:["FF0033","93874E","A8801A","FE1A00","C94340","D34026","FE0D19","666666","84515B"],FF0000:["FF0000","968726","A98200","FE1C00","CA4313","D44100","FE0E00","555555","774444"],CCFFFF:["CCFFFF","F8F4F8","FFEAFD","CBEFFF","E2F9FB","E5F4FE","CBF7FF","EEEEEE","E7F1F1"],CCFFCC:["CCFFCC","FFF1C5","FFDECC","D3EFFF","E5F8C8","E5EECC","CFF7E5","DDDDDD","D9E3D9"],CCFF99:["CCFF99","FFEB97","FFD8AB","D9EEFF","E5F598","E5EBA2","D2F6CC","CCCCCC","CCD6C1"],CCFF66:["CCFF66","FFE873","FFD497","DDEEFF","E5F36C","E5E97E","D4F6B2","BBBBBB","BEC8AA"],CCFF33:["CCFF33","FFE75C","FFD38C","E0EEFF","E5F347","E5E95F","D6F699","AAAAAA","B0BB92"],CCFF00:["CCFF00","FFE655","FFD389","E0EEFF","E5F22A","E5E944","D6F67F","999999","A3AD7A"],CCCCFF:["CCCCFF","C4CEFF","CBCCFF","C6D1E1","C8CDFF","CBCCFF","C9CEF0","DDDDDD","D9D9E3"],CCCCCC:["CCCCCC","CFCBCB","DEC6CD","CECAD9","CDCBCB","D5C9CC","CDCBD2","CCCCCC","CCCCCC"],CCCC99:["CCCC99","D7C997","EAC19B","D3C4D3","D1CA98","DBC69A","CFC8B6","BBBBBB","BEBEB4"],CCCC66:["CCCC66","DBC764","F1BE6A","D7C1CF","D3C965","DEC568","D1C69A","AAAAAA","B0B09C"],CCCC33:["CCCC33","DDC631","F5BC3B","D8BFCD","D4C932","E0C437","D2C580","999999","A3A384"],CCCC00:["CCCC00","DDC600","F6C600","D9BECC","D4C900","E1C900","D2C566","888888","95956C"],CC99FF:["CC99FF","98B1FF","8FAEFB","BFA9B6","B2A5FF","ADA3FD","C5A1DA","CCCCCC","CCC1D6"],CC99CC:["CC99CC","9EA8D7","AAA7C9","C79FAB","B5A0D1","BBA0CA","C99CBB","BBBBBB","BEB4BE"],CC9999:["CC9999","AAA5A0","BAA198","CD98A2","BB9F9C","C39D98","CC989D","AAAAAA","B0A6A6"],CC9966:["CC9966","B1A46A","C49D65","D0929D","BE9E68","C89B65","CE9581","999999","A3998E"],CC9933:["CC9933","B5A336","C99B32","D2909A","C09E34","CA9A32","CF9466","888888","958B77"],CC9900:["CC9900","B5A20E","CA9A00","D38F99","C09D07","CB9900","CF944C","777777","887D5F"],CC66FF:["CC66FF","87A7FF","4C97F6","BB8791","A986FF","8C7EFA","C376C8","BBBBBB","BEAAC8"],CC66CC:["CC66CC","648CEB","7B8DC5","C37982","9879DB","A379C8","C76FA7","AAAAAA","B09CB0"],CC6699:["CC6699","7F88AF","918694","C96E75","A577A4","AE7696","CA6A87","999999","A38E99"],CC6666:["CC6666","8C8675","9E8161","CC656C","AC766D","B57363","CC6569","888888","958181"],CC6633:["CC6633","92853C","A47E2B","CE6067","AF7537","B8722F","CD634D","777777","887369"],CC6600:["CC6600","948415","A67F00","CF5F65","B0750A","B97200","CD6232","666666","7A6651"],CC33FF:["CC33FF","8AAAFF","008DEF","B87178","AB6EFF","6660F7","C252BB","AAAAAA","B092BB"],CC33CC:["CC33CC","4387FF","577EC2","C15E64","875DE5","9158C7","C64898","999999","A384A3"],CC3399:["CC3399","5275C8","767591","C64C50","8F54B0","A15495","C93F74","888888","95778B"],CC3366:["CC3366","707387","856F5F","CA3D3F","9E5376","A85162","CB3852","777777","886973"],CC3333:["CC3333","7B7146","8C6C27","CC3334","A3523C","AC4F2D","CC3333","666666","7A5B5B"],CC3300:["CC3300","7E711B","8F6D00","CC3030","A5520D","AD5000","CC3118","555555","6C4E44"],CC00FF:["CC00FF","8CABFF","008CEC","B76A71","AC55FF","6646F5","C135B8","999999","A37AAD"],CC00CC:["CC00CC","5D91FF","4B7AC0","C0555A","9448E5","8B3DC6","C62A93","888888","956C95"],CC0099:["CC0099","356FD5","6E7190","C64043","8037B7","9D3894","C9206E","777777","885F7D"],CC0066:["CC0066","646D90","7E6A5E","CA2B2B","98367B","A53562","CB1548","666666","7A5166"],CC0033:["CC0033","746C4C","856726","CB170B","A0363F","A8332C","CB0B1F","555555","6C444E"],CC0000:["CC0000","786C1E","886900","CC1600","A2360F","AA3400","CC0B00","444444","5F3636"],"99FFFF":["99FFFF","EFECF4","F4E4FF","A6EFFF","C4F5F9","C6F1FF","9FF7FF","DDDDDD","CFE3E3"],"99FFCC":["99FFCC","F7E9C1","FFDDD0","ACEFFF","C8F4C6","CCEECE","A2F7E5","CCCCCC","C1D6CC"],"99FF99":["99FF99","FBE790","FFD6A9","B0EEFF","CAF394","CCEAA1","A4F6CC","BBBBBB","B4C8B4"],"99FF66":["99FF66","FEE65E","FFD291","B4EEFF","CBF262","CCE87B","A6F6B2","AAAAAA","A6BB9C"],"99FF33":["99FF33","FFE532","FFD184","B5EDFF","CCF232","CCE85B","A7F699","999999","99AD84"],"99FF00":["99FF00","FFE41C","FFD080","B6EDFF","CCF10E","CCE740","A7F67F","888888","8B9F6C"],"99CCFF":["99CCFF","B9C5FA","B9C4FF","91D1E1","A9C8FC","A9C8FF","95CEF0","CCCCCC","C1CCD6"],"99CCCC":["99CCCC","C4C1C6","CEBDCF","9CCAD9","AEC6C9","B3C4CD","9ACBD2","BBBBBB","B4BEBE"],"99CC99":["99CC99","CBBF93","DBB89D","A3C4D3","B2C596","BAC29B","9EC8B6","AAAAAA","A6B0A6"],"99CC66":["99CC66","CFBD61","E4B56C","A8C1CF","B4C463","BEC069","A0C69A","999999","99A38E"],"99CC33":["99CC33","D1BC2F","E8B33F","AABFCD","B5C431","C0BF39","A1C580","888888","8B9577"],"99CC00":["99CC00","D2BC00","E9B22A","ABBECD","B5C400","C1BF15","A2C566","777777","7D885F"],"9999FF":["9999FF","83A4FF","6FA4FD","86A9B6","8E9EFF","849EFE","8FA1DA","BBBBBB","B4B4C8"],"9999CC":["9999CC","8F9CCE","929BCC","929FAB","949ACD","959ACC","959CBB","AAAAAA","A6A6B0"],"999999":["999999","9B9899","A6949A","9A97A3","9A9899","9F9699","99989E","999999","999999"],"999966":["999966","A29665","B29068","9F929D","9D9765","A59467","9C9581","888888","8B8B81"],"999933":["999933","A59532","B78E37","A2909A","9F9732","A89335","9D9466","777777","7D7D69"],"999900":["999900","A69500","A69500","A28F99","9F9700","9F9700","9D944C","666666","707051"],"9966FF":["9966FF","709BFF","0090F3","7E8791","8480FF","4C7BF9","8B76C8","AAAAAA","A69CBB"],"9966CC":["9966CC","497BDF","507FC7","8C7982","7170D5","7472C9","926FA7","999999","998EA3"],"996699":["996699","6A77A5","737696","946D75","816E9F","866E97","966987","888888","8B818B"],"996666":["996666","78746D","847064","9A656C","886D69","8E6B65","996569","777777","7D7373"],"996633":["996633","7E7237","8C6D31","9C6067","8B6C35","926932","9A634D","666666","70665B"],"996600":["996600","7F720D","8E6C00","9D5F66","8C6C06","936900","9B6233","555555","625844"],"9933FF":["9933FF","7DA2FF","008DE8","7A7078","8B6AFF","4C60F3","8951BB","999999","9984AD"],"9933CC":["9933CC","007AF6","0073C2","885D64","4C56E1","4C53C7","904898","888888","8B7795"],"993399":["993399","005EBF","496192","914C51","4C48AC","714A95","953F75","777777","7D697D"],"993366":["993366","505B80","625961","963D40","744773","7D4663","973853","666666","705B66"],"993333":["993333","5F5941","6C552D","993335","7C463A","824430","993334","555555","624E4E"],"993300":["993300","635913","705600","9A3032","7E4609","844400","993119","444444","554036"],"9900FF":["9900FF","83A6FF","008CE5","796A71","8E53FF","4C46F2","8935B8","888888","8B6C9F"],"9900CC":["9900CC","2782FF","0073C0","87555B","6041E5","4C39C6","902A93","777777","7D5F88"],"990099":["990099","0067D0","385B90","904044","4C33B4","682D94","94206E","666666","705170"],"990066":["990066","39538F","57535F","962B2C","69297A","782962","971549","555555","624458"],"990033":["990033","55514A","634E2C","981612","77283E","7E272F","980B22","444444","553640"],"990000":["990000","5A5117","674F00","991100","79280B","802700","990800","333333","472828"],"66FFFF":["66FFFF","EAE7F0","EBDFFF","88EFFF","A8F3F7","A8EFFF","77F7FF","CCCCCC","B7D6D6"],"66FFCC":["66FFCC","F1E4BF","FFDDD3","8BEFFF","ABF1C5","B2EECF","78F7E5","BBBBBB","AAC8BE"],"66FF99":["66FF99","F6E28D","FFD5A7","8EEEFF","AEF093","B2EAA0","7AF6CC","AAAAAA","9CBBA6"],"66FF66":["66FF66","F8E15D","FFD08B","90EEFF","AFF061","B2E778","7BF6B2","999999","8EAD8E"],"66FF33":["66FF33","FAE02A","FFCF7C","92EDFF","B0EF2E","B2E757","7CF699","888888","819F77"],"66FF00":["66FF00","FAE000","FFCE79","92EDFF","B0EF00","B2E63C","7CF67F","777777","73925F"],"66CCFF":["66CCFF","B2BEF5","ADBEFF","57D1E1","8CC5FA","89C5FF","5ECEF0","BBBBBB","AABEC8"],"66CCCC":["66CCCC","BDBBC1","C3B7D1","6BCAD9","91C3C6","94C1CE","68CBD2","AAAAAA","9CB0B0"],"66CC99":["66CC99","C4B88F","D2B29F","77C4D3","95C294","9CBF9C","6EC8B6","999999","8EA399"],"66CC66":["66CC66","C8B65E","DAAE6E","7EC1CF","97C162","A0BD6A","72C69A","888888","819581"],"66CC33":["66CC33","CAB52D","DFAC42","81BFCD","98C030","A2BC3A","73C580","777777","738869"],"66CC00":["66CC00","CAB500","E0AC2E","82BECD","98C000","A3BC17","74C566","666666","667A51"],"6699FF":["6699FF","6E98FE","519CFE","3EA9B6","6A98FE","5B9AFE","52A1DA","AAAAAA","9CA6BB"],"6699CC":["6699CC","8593C7","8093CD","5A9FAB","7596C9","7396CC","609CBB","999999","8E99A3"],"669999":["669999","918F93","978C9C","6997A3","7B9496","7E929A","67989E","888888","818B8B"],"669966":["669966","988C61","A4876A","71929D","7F9263","859068","6B9581","777777","737D73"],"669933":["669933","9B8B2F","AA853B","74909A","809231","888F37","6D9466","666666","66705B"],"669900":["669900","9B8B00","AC8421","758F9A","809200","898E10","6D944D","555555","586244"],"6666FF":["6666FF","518DFF","0090EE","228791","5B79FF","337BF6","4476C8","999999","8E8EAD"],"6666CC":["6666CC","326ED5","0076C9","4D7982","4C6AD0","336ECA","596FA7","888888","818195"],"666699":["666699","59699C","586A98","5E6D75","5F679A","5F6898","626987","777777","73737D"],"666666":["666666","686666","6F6367","67656C","676666","6A6466","666569","666666","666666"],"666633":["666633","6D6432","795F35","6B6067","696532","6F6234","68634D","555555","58584E"],"666600":["666600","6F6300","7B5E11","6C5F66","6A6400","706208","696233","444444","4A4A36"],"6633FF":["6633FF","6E9AFF","008CE4","007179","6A66FF","335FF1","3352BC","888888","81779F"],"6633CC":["6633CC","0074EA","0076C2","445D64","3353DB","3354C7","554898","777777","736988"],"663399":["663399","0059B4","005995","584C51","3346A6","334697","5F3F75","666666","665B70"],"663366":["663366","324676","3D4763","623D41","4C3C6E","513D64","643853","555555","584E58"],"663333":["663333","46433A","4F4031","663336","563B36","5A3932","663334","444444","4A4040"],"663300":["663300","4A420B","534000","673033","583A05","5C3900","663119","333333","3D3328"],"6600FF":["6600FF","7AA1FF","008BE1","006B73","7050FF","3345F0","3335B9","777777","735F92"],"6600CC":["6600CC","007CF8","0076BF","42545B","333EE2","333BC5","542A93","666666","66517A"],"660099":["660099","0065CA","005A94","563F44","3332B1","332D96","5E1F6E","555555","584462"],"660066":["660066","00478E","253D60","602B2D","33237A","451E63","631549","444444","4A364A"],"660033":["660033","323748","3F352F","651615","4C1B3D","521A31","650B24","333333","3D2833"],"660000":["660000","3C360F","453500","660B00","511B07","551A00","660500","222222","2F1B1B"],"33FFFF":["33FFFF","E7E5EF","E7DDFF","74EFFF","8DF2F7","8DEEFF","53F7FF","BBBBBB","9FC8C8"],"33FFCC":["33FFCC","EEE2BD","FCDBD4","76EFFF","90F0C4","97EDD0","54F7E5","AAAAAA","92BBB0"],"33FF99":["33FF99","F3DF8C","FFD4A6","78EEFF","93EF92","99E99F","55F6CC","999999","84AD99"],"33FF66":["33FF66","F5DE5C","FFCF88","79EEFF","94EE61","99E777","56F6B2","888888","779F81"],"33FF33":["33FF33","F7DD29","FFCD78","7AEDFF","95EE2E","99E655","56F699","777777","699269"],"33FF00":["33FF00","F7DD00","FFCD74","7AEDFF","95EE00","99E63A","56F67F","666666","5B8451"],"33CCFF":["33CCFF","AEBBF2","A7BBFF","00D1E0","70C3F8","6DC3FF","19CEEF","AAAAAA","92B0BB"],"33CCCC":["33CCCC","B9B7BF","BDB4D1","3ECAD9","76C1C5","78C0CE","38CBD2","999999","84A3A3"],"33CC99":["33CC99","C0B48E","CCAEA0","54C4D3","79C093","7FBD9C","43C8B6","888888","77958B"],"33CC66":["33CC66","C4B25D","D6AB6F","5EC1CF","7BBF61","84BB6A","48C69A","777777","698873"],"33CC33":["33CC33","C6B22C","DAA943","63BFCD","7CBF2F","86BA3B","4BC580","666666","5B7A5B"],"33CC00":["33CC00","C6B100","DBA830","64BFD7","7CBE00","87BA18","4BC56B","555555","4E6C44"],"3399FF":["3399FF","6993FA","3999FF","00ABB7","4E96FC","3699FF","19A2DB","999999","8499AD"],"3399CC":["3399CC","7F8EC3","758FCE","00A0AC","5993C7","5494CD","199CBC","888888","778B95"],"339999":["339999","8C8A90","8F879D","3997A3","5F9194","61909B","36989E","777777","697D7D"],"339966":["339966","92875E","9D826B","49929D","629062","688D68","3E9581","666666","5B7066"],"339933":["339933","95862E","A4803C","4F909A","648F30","6B8C37","419466","555555","4E624E"],"339900":["339900","958600","A58600","518F9A","648F00","6C8F00","42944D","444444","405536"],"3366FF":["3366FF","2581FF","0090EC","009099","2C73FF","197BF5","197BCC","888888","77819F"],"3366CC":["3366CC","2067CD","0078C9","007F87","2966CC","196FCA","1972A9","777777","697388"],"336699":["336699","506195","43639A","146D76","416397","3B6499","236987","666666","5B6670"],"336666":["336666","5E5D61","615B68","35656D","486163","4A6067","346569","555555","4E5858"],"336633":["336633","645B2F","6D5737","3F6068","4B6031","505E35","39634D","444444","404A40"],"336600":["336600","655B00","705617","415F66","4C6000","515E0B","3A6233","333333","333D28"],"3333FF":["3333FF","6094FF","008CE2","008187","4963FF","195FF0","195AC3","777777","696992"],"3333CC":["3333CC","0070E1","0078C2","006A70","1951D6","1955C7","194E9E","666666","5B5B7A"],"333399":["333399","0054AA","005D99","005056","1943A1","194899","194177","555555","4E4E62"],"333366":["333366","19376A","003B65","263C41","263568","193765","2C3753","444444","40404A"],"333333":["333333","343333","373133","333236","333333","353233","333234","333333","333333"],"333300":["333300","373200","3D2F09","363033","353200","383104","343119","222222","25251B"],"3300FF":["3300FF","739DFF","008BDF","007C82","534EFF","1945EF","193EC0","666666","5B5184"],"3300CC":["3300CC","0079F2","0076BF","006469","193CDF","193BC5","19329A","555555","4E446C"],"330099":["330099","0062C4","005D96","00474B","1931AE","192E97","192372","444444","403655"],"330066":["330066","00468B","003F67","212A2D","192378","191F66","2A1549","333333","33283D"],"330033":["330033","002448","131E30","301517","19123D","230F31","310A25","222222","251B25"],"330000":["330000","1E1B08","221A00","330600","280D04","2A0D00","330300","111111","170D0D"],"00FFFF":["00FFFF","E6E4EE","E6DCFF","6EEFFF","73F1F6","73EDFF","37F7FF","AAAAAA","88BBBB"],"00FFCC":["00FFCC","EDE1BD","FBDAD4","70EFFF","76F0C4","7DECD0","38F7E5","999999","7AADA3"],"00FF99":["00FF99","F2DF8C","FFD3A6","72EEFF","79EF92","7FE99F","39F6CC","888888","6C9F8B"],"00FF66":["00FF66","F5DD5C","FFCF87","73EEFF","7AEE61","7FE776","39F6B2","777777","5F9273"],"00FF33":["00FF33","F6DD29","FFCD77","73EDFF","7BEE2E","7FE655","39F699","666666","51845B"],"00FF00":["00FF00","F6DC00","FFCD72","73EDFF","7BED00","7FE639","39F67F","555555","447744"],"00CCFF":["00CCFF","ADBAF2","A5BBFF","00D0DF","56C3F8","52C3FF","00CEEF","999999","7AA3AD"],"00CCCC":["00CCCC","B8B6BF","BBB3D1","29CAD9","5CC1C5","5DBFCE","14CBD2","888888","6C9595"],"00CC99":["00CC99","BFB38D","CBAEA0","47C4D3","5FBF93","65BD9C","23C8B6","777777","5F887D"],"00CC66":["00CC66","C3B25D","D4AA6F","54C1CF","61BF61","6ABB6A","2AC69A","666666","517A66"],"00CC33":["00CC33","C5B12B","D9A844","59BFCD","62BE2F","6CBA3B","2CC580","555555","446C4E"],"00CC00":["00CC00","C5B000","DAA831","5ABFCD","62BE00","6DBA18","2DC566","444444","365F36"],"0099FF":["0099FF","6792F8","3398FF","00ACB7","3395FB","1998FF","00A2DB","888888","6C8B9F"],"0099CC":["0099CC","7E8DC2","728ECF","00A1AC","3F93C7","3993CD","009DBC","777777","5F7D88"],"009999":["009999","8A898F","8D869D","1F97A3","459194","468F9B","0F989E","666666","517070"],"009966":["009966","90865E","9B816C","39929D","488F62","4D8D69","1C9581","555555","446258"],"009933":["009933","93852D","A27E3D","42909A","498F30","518B38","219466","444444","365540"],"009900":["009900","948500","A37E25","448F9A","4A8F00","518B12","22944D","333333","284728"],"0066FF":["0066FF","007EFE","0090EC","00929A","0072FE","007BF5","007CCC","777777","5F7392"],"0066CC":["0066CC","1A66CC","0078C9","00828A","0D66CC","006FCA","0074AB","666666","51667A"],"006699":["006699","4E5F93","3D629A","00727A","276296","1E6499","006C89","555555","445862"],"006666":["006666","5C5B5F","5E5A69","15656D","2E6062","2F6067","0A6569","444444","364A4A"],"006633":["006633","61592E","6A5538","2A6068","305F30","355D35","15634D","333333","283D33"],"006600":["006600","635800","6D5418","2D5F66","315F00","365D0C","166233","222222","1B2F1B"],"0033FF":["0033FF","5B91FF","008CE2","008389","2D62FF","005FF0","005BC4","666666","515B84"],"0033CC":["0033CC","006FDE","0078C2","006F74","0051D5","0055C7","0051A0","555555","444E6C"],"003399":["003399","0053A6","005E9A","00595E","00439F","004899","00467B","444444","364055"],"003366":["003366","0D3366","003E68","004347","063366","003867","003B56","333333","28333D"],"003333":["003333","2E2E30","2F2D34","0A3236","173031","173033","053234","222222","1B2525"],"003300":["003300","312C00","362A0C","173033","182F00","1B2E06","0B3119","111111","0D170D"],"0000FF":["0000FF","719CFF","008BDF","007F85","384EFF","0045EF","003FC2","555555","444477"],"0000CC":["0000CC","0078F0","0076BE","006A6E","003CDE","003BC5","00359D","444444","36365F"],"000099":["000099","0060C1","005E97","005155","0030AD","002F98","002877","333333","282847"],"000066":["000066","004487","004168","003739","002276","002067","001B4F","222222","1B1B2F"],"000033":["000033","002346","002135","001C1D","00113C","001034","000E28","111111","0D0D17"],"000000":["000000","000000","000000","000000","000000","000000","000000","000000","000000"]}};;

// ***************************
// js.compressed/jquery/datatables/js/jquery.dataTables.min.js
// ***************************
/*
 * File:        jquery.dataTables.min.js
 * Version:     1.9.1
 * Author:      Allan Jardine (www.sprymedia.co.uk)
 * Info:        www.datatables.net
 * 
 * Copyright 2008-2012 Allan Jardine, all rights reserved.
 *
 * This source file is free software, under either the GPL v2 license or a
 * BSD style license, available at:
 *   http://datatables.net/license_gpl2
 *   http://datatables.net/license_bsd
 * 
 * This source file is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 */
(function(h,V,l,m){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mDataProp:c.mDataProp?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===m||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else{c=a.aoPreSearchCols[d];
if(c.bRegex===m)c.bRegex=!0;if(c.bSmart===m)c.bSmart=!0;if(c.bCaseInsensitive===m)c.bCaseInsensitive=!0}s(a,d,null)}function s(a,b,c){b=a.aoColumns[b];if(c!==m&&null!==c){if(c.sType!==m)b.sType=c.sType,b._bAutoType=!1;h.extend(b,c);p(b,c,"sWidth","sWidthOrig");if(c.iDataSort!==m)b.aDataSort=[c.iDataSort];p(b,c,"aDataSort")}b.fnGetData=W(b.mDataProp);b.fnSetData=ta(b.mDataProp);if(!a.oFeatures.bSort)b.bSortable=!1;if(!b.bSortable||-1==h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting))b.sSortingClass=
a.oClasses.sSortableNone,b.sSortingClassJUI="";else if(b.bSortable||-1==h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting))b.sSortingClass=a.oClasses.sSortable,b.sSortingClassJUI=a.oClasses.sSortJUI;else if(-1!=h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting))b.sSortingClass=a.oClasses.sSortableAsc,b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed;else if(-1==h.inArray("asc",b.asSorting)&&-1!=h.inArray("desc",b.asSorting))b.sSortingClass=a.oClasses.sSortableDesc,b.sSortingClassJUI=
a.oClasses.sSortJUIDescAllowed}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;ba(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function x(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,c==b)return d;return null}function r(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,d==b)return!0===a.aoColumns[d].bVisible?c:null;return null}function v(a){for(var b=0,c=0;c<a.aoColumns.length;c++)!0===
a.aoColumns[c].bVisible&&b++;return b}function A(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(null!==f)return f}return"string"}function E(a,b){for(var c=b.split(","),d=[],f=0,g=a.aoColumns.length;f<g;f++)for(var i=0;i<g;i++)if(a.aoColumns[f].sName==c[i]){d.push(i);break}return d}function y(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function J(a,b,c,d){var f,g,i,e,u;if(b)for(f=b.length-1;0<=f;f--){var n=b[f].aTargets;
h.isArray(n)||F(a,1,"aTargets must be an array of targets, not a "+typeof n);for(g=0,i=n.length;g<i;g++)if("number"===typeof n[g]&&0<=n[g]){for(;a.aoColumns.length<=n[g];)o(a);d(n[g],b[f])}else if("number"===typeof n[g]&&0>n[g])d(a.aoColumns.length+n[g],b[f]);else if("string"===typeof n[g])for(e=0,u=a.aoColumns.length;e<u;e++)("_all"==n[g]||h(a.aoColumns[e].nTh).hasClass(n[g]))&&d(e,b[f])}if(c)for(f=0,a=c.length;f<a;f++)d(f,c[f])}function H(a,b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=
a.aoData.length,f=h.extend(!0,{},j.models.oRow);f._aData=c;a.aoData.push(f);for(var g,f=0,i=a.aoColumns.length;f<i;f++)if(c=a.aoColumns[f],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mDataProp?I(a,d,f,R(a,d,f)):I(a,d,f,w(a,d,f)),c._bAutoType&&"string"!=c.sType&&(g=w(a,d,f,"type"),null!==g&&""!==g))if(g=A(g),null===c.sType)c.sType=g;else if(c.sType!=g&&"html"!=c.sType)c.sType="string";a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ca(a,d);return d}function ua(a){var b,c,d,f,g,i,e,
u,n;if(a.bDeferLoading||null===a.sAjaxSource){e=a.nTBody.childNodes;for(b=0,c=e.length;b<c;b++)if("TR"==e[b].nodeName.toUpperCase()){u=a.aoData.length;e[b]._DT_RowIndex=u;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:e[b]}));a.aiDisplayMaster.push(u);i=e[b].childNodes;g=0;for(d=0,f=i.length;d<f;d++)if(n=i[d].nodeName.toUpperCase(),"TD"==n||"TH"==n)I(a,u,g,h.trim(i[d].innerHTML)),g++}}e=S(a);i=[];for(b=0,c=e.length;b<c;b++)for(d=0,f=e[b].childNodes.length;d<f;d++)g=e[b].childNodes[d],n=g.nodeName.toUpperCase(),
("TD"==n||"TH"==n)&&i.push(g);for(f=0,e=a.aoColumns.length;f<e;f++){n=a.aoColumns[f];if(null===n.sTitle)n.sTitle=n.nTh.innerHTML;g=n._bAutoType;u="function"===typeof n.fnRender;var o=null!==n.sClass,k=n.bVisible,m,s;if(g||u||o||!k)for(b=0,c=a.aoData.length;b<c;b++){d=a.aoData[b];m=i[b*e+f];if(g&&"string"!=n.sType&&(s=w(a,b,f,"type"),""!==s))if(s=A(s),null===n.sType)n.sType=s;else if(n.sType!=s&&"html"!=n.sType)n.sType="string";if("function"===typeof n.mDataProp)m.innerHTML=w(a,b,f,"display");if(u)s=
R(a,b,f),m.innerHTML=s,n.bUseRendered&&I(a,b,f,s);o&&(m.className+=" "+n.sClass);k?d._anHidden[f]=null:(d._anHidden[f]=m,m.parentNode.removeChild(m));n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,m,w(a,b,f,"display"),d._aData,b,f)}}if(0!==a.aoRowCreatedCallback.length)for(b=0,c=a.aoData.length;b<c;b++)d=a.aoData[b],D(a,"aoRowCreatedCallback",null,[d.nTr,d._aData,b])}function K(a,b){return b._DT_RowIndex!==m?b._DT_RowIndex:null}function da(a,b,c){for(var b=L(a,b),d=0,a=a.aoColumns.length;d<a;d++)if(b[d]===
c)return d;return-1}function X(a,b,c){for(var d=[],f=0,g=a.aoColumns.length;f<g;f++)d.push(w(a,b,f,c));return d}function w(a,b,c,d){var f=a.aoColumns[c];if((c=f.fnGetData(a.aoData[b]._aData,d))===m){if(a.iDrawError!=a.iDraw&&null===f.sDefaultContent)F(a,0,"Requested unknown parameter "+("function"==typeof f.mDataProp?"{mDataprop function}":"'"+f.mDataProp+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw;return f.sDefaultContent}if(null===c&&null!==f.sDefaultContent)c=f.sDefaultContent;
else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function I(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function W(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d){return a(b,d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a){for(var d=0,f=b.length;d<f;d++)if(a=a[b[d]],a===m)return m;return a}}return function(b){return b[a]}}function ta(a){if(null===a)return function(){};if("function"===
typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a,d){for(var f=0,g=b.length-1;f<g;f++)if(a=a[b[f]],a===m)return;a[b[b.length-1]]=d}}return function(b,d){b[a]=d}}function Y(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ea(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);B(a)}function fa(a,b){for(var c=
-1,d=0,f=a.length;d<f;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function R(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mDataProp},w(a,b,c,"display"))}function ca(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;if(c._aData.DT_RowId)c.nTr.id=c._aData.DT_RowId;c._aData.DT_RowClass&&h(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,g=a.aoColumns.length;f<g;f++){var i=a.aoColumns[f];
d=l.createElement(i.sCellType);d.innerHTML="function"===typeof i.fnRender&&(!i.bUseRendered||null===i.mDataProp)?R(a,b,f):w(a,b,f,"display");if(null!==i.sClass)d.className=i.sClass;i.bVisible?(c.nTr.appendChild(d),c._anHidden[f]=null):c._anHidden[f]=d;i.fnCreatedCell&&i.fnCreatedCell.call(a.oInstance,d,w(a,b,f,"display"),c._aData,b,f)}D(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,c,d;if(0!==a.nTHead.getElementsByTagName("th").length)for(b=0,d=a.aoColumns.length;b<d;b++){if(c=
a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var f=l.createElement("tr");for(b=0,d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),
f.appendChild(c);h(a.nTHead).html("")[0].appendChild(f);T(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI)for(b=0,d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=l.createElement("div");f.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(f);var g=l.createElement("span");g.className=a.oClasses.sSortIcon;f.appendChild(g);c.appendChild(f)}if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ga(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);
""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=O(a,null,a.aoFooter);for(b=0,d=a.aoColumns.length;b<d;b++)if(c[b])a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass)}}function U(a,b,c){var d,f,g,i=[],e=[],h=a.aoColumns.length,n;c===m&&(c=!1);for(d=0,f=b.length;d<f;d++){i[d]=b[d].slice();i[d].nTr=b[d].nTr;for(g=h-1;0<=g;g--)!a.aoColumns[g].bVisible&&!c&&i[d].splice(g,1);e.push([])}for(d=0,f=
i.length;d<f;d++){if(a=i[d].nTr)for(;g=a.firstChild;)a.removeChild(g);for(g=0,b=i[d].length;g<b;g++)if(n=h=1,e[d][g]===m){a.appendChild(i[d][g].cell);for(e[d][g]=1;i[d+h]!==m&&i[d][g].cell==i[d+h][g].cell;)e[d+h][g]=1,h++;for(;i[d][g+n]!==m&&i[d][g].cell==i[d][g+n].cell;){for(c=0;c<h;c++)e[d+c][g+n]=1;n++}i[d][g].cell.rowSpan=h;i[d][g].cell.colSpan=n}}}function z(a){var b,c,d=[],f=0,g=a.asStripeClasses.length;b=a.aoOpenRows.length;c=D(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,c))G(a,
!1);else{a.bDrawing=!0;if(a.iInitDisplayStart!==m&&-1!=a.iInitDisplayStart)a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,B(a);if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var i=a._iDisplayStart;c=a._iDisplayEnd;if(a.oFeatures.bServerSide)i=0,c=a.aoData.length;for(;i<c;i++){var e=a.aoData[a.aiDisplay[i]];
null===e.nTr&&ca(a,a.aiDisplay[i]);var j=e.nTr;if(0!==g){var n=a.asStripeClasses[f%g];if(e._sRowStripe!=n)h(j).removeClass(e._sRowStripe).addClass(n),e._sRowStripe=n}D(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[i]]._aData,f,i]);d.push(j);f++;if(0!==b)for(e=0;e<b;e++)if(j==a.aoOpenRows[e].nParent){d.push(a.aoOpenRows[e].nTr);break}}}else{d[0]=l.createElement("tr");if(a.asStripeClasses[0])d[0].className=a.asStripeClasses[0];b=a.oLanguage;g=b.sZeroRecords;if(1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide)g=
b.sLoadingRecords;else if(b.sEmptyTable&&0===a.fnRecordsTotal())g=b.sEmptyTable;b=l.createElement("td");b.setAttribute("valign","top");b.colSpan=v(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=ha(a,g);d[f].appendChild(b)}D(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Y(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);D(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Y(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);f=l.createDocumentFragment();b=l.createDocumentFragment();
if(a.nTBody){g=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;b=a.nTBody.firstChild;)a.nTBody.removeChild(b);for(b=0,c=d.length;b<c;b++)f.appendChild(d[b]);a.nTBody.appendChild(f);null!==g&&g.appendChild(a.nTBody)}D(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(G(a,!1),a._bInitComplete||Z(a))}}function $(a){a.oFeatures.bSort?P(a,a.oPreviousSearch):a.oFeatures.bFilter?M(a,a.oPreviousSearch):
(B(a),z(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,g,i,e,u,n,o,k=0;k<d.length;k++){g=0;i=d[k];if("<"==i){e=h("<div></div>")[0];u=d[k+1];if("'"==u||'"'==u){n="";for(o=2;d[k+o]!=u;)n+=d[k+o],o++;"H"==n?n="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix":
"F"==n&&(n="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");-1!=n.indexOf(".")?(u=n.split("."),e.id=u[0].substr(1,u[0].length-1),e.className=u[1]):"#"==n.charAt(0)?e.id=n.substr(1,n.length-1):e.className=n;k+=o}c.appendChild(e);c=e}else if(">"==i)c=c.parentNode;else if("l"==i&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)f=ya(a),g=1;else if("f"==i&&a.oFeatures.bFilter)f=za(a),g=1;else if("r"==i&&a.oFeatures.bProcessing)f=Aa(a),g=1;else if("t"==i)f=Ba(a),g=
1;else if("i"==i&&a.oFeatures.bInfo)f=Ca(a),g=1;else if("p"==i&&a.oFeatures.bPaginate)f=Da(a),g=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;o=0;for(u=e.length;o<u;o++)if(i==e[o].cFeature){(f=e[o].fnInit(a))&&(g=1);break}}1==g&&null!==f&&("object"!==typeof a.aanFeatures[i]&&(a.aanFeatures[i]=[]),a.aanFeatures[i].push(f),c.appendChild(f))}b.parentNode.replaceChild(a.nTableWrapper,b)}function T(a,b){var c=h(b).children("tr"),d,f,g,i,e,j,n,o;a.splice(0,a.length);for(f=0,j=c.length;f<j;f++)a.push([]);
for(f=0,j=c.length;f<j;f++)for(g=0,n=c[f].childNodes.length;g<n;g++)if(d=c[f].childNodes[g],"TD"==d.nodeName.toUpperCase()||"TH"==d.nodeName.toUpperCase()){var k=1*d.getAttribute("colspan"),m=1*d.getAttribute("rowspan"),k=!k||0===k||1===k?1:k,m=!m||0===m||1===m?1:m;for(i=0;a[f][i];)i++;o=i;for(e=0;e<k;e++)for(i=0;i<m;i++)a[f+i][o+e]={cell:d,unique:1==k?!0:!1},a[f+i].nTr=c[f]}}function O(a,b,c){var d=[];if(!c)c=a.aoHeader,b&&(c=[],T(c,b));for(var b=0,f=c.length;b<f;b++)for(var g=0,i=c[b].length;g<
i;g++)if(c[b][g].unique&&(!d[g]||!a.bSortCellsTop))d[g]=c[b][g].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;G(a,!0);var b=Ea(a);ia(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,f,g,i;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:y(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:!1!==a.oFeatures.bPaginate?
a._iDisplayLength:-1});for(g=0;g<b;g++)d=a.aoColumns[g].mDataProp,c.push({name:"mDataProp_"+g,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(g=0;g<b;g++)c.push({name:"sSearch_"+g,value:a.aoPreSearchCols[g].sSearch}),c.push({name:"bRegex_"+g,value:a.aoPreSearchCols[g].bRegex}),c.push({name:"bSearchable_"+g,value:a.aoColumns[g].bSearchable})}if(!1!==a.oFeatures.bSort){var e=
0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(g=0;g<d.length;g++){f=a.aoColumns[d[g][0]].aDataSort;for(i=0;i<f.length;i++)c.push({name:"iSortCol_"+e,value:f[i]}),c.push({name:"sSortDir_"+e,value:d[g][1]}),e++}c.push({name:"iSortingCols",value:e});for(g=0;g<b;g++)c.push({name:"bSortable_"+g,value:a.aoColumns[g].bSortable})}return c}function ia(a,b){D(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==m){if(1*b.sEcho<a.iDraw)return;a.iDraw=
1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ea(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=y(a),c=b.sColumns!==m&&""!==c&&b.sColumns!=c,d;c&&(d=E(a,b.sColumns));for(var f=W(a.sAjaxDataProp)(b),g=0,i=f.length;g<i;g++)if(c){for(var e=[],h=0,n=a.aoColumns.length;h<n;h++)e.push(f[g][d[h]]);H(a,e)}else H(a,f[g]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;z(a);a.bAjaxDataGet=!0;G(a,!1)}function za(a){var b=
a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";if(!a.aanFeatures.f)d.id=a.sTableId+"_filter";c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=""===this.value?"":this.value,i=0,e=c.length;i<e;i++)c[i]!=
h(this).parents("div.dataTables_filter")[0]&&h(c[i]._DT_Input).val(d);d!=b.sSearch&&M(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(13==a.keyCode)return!1});return d}function M(a,b,c){var d=a.oPreviousSearch,f=a.aoPreSearchCols,g=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)g(b);else{Ga(a,b.sSearch,c,b.bRegex,
b.bSmart,b.bCaseInsensitive);g(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,f[b].sSearch,b,f[b].bRegex,f[b].bSmart,f[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;B(a);z(a);ja(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=0,d=b.length;c<d;c++)for(var f=0,g=0,i=a.aiDisplay.length;g<i;g++){var e=a.aiDisplay[g-f];b[c](a,X(a,e,"filter"),e)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c,d,f,g){if(""!==b)for(var i=0,b=ka(b,d,f,g),d=a.aiDisplay.length-
1;0<=d;d--)f=la(w(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(f)||(a.aiDisplay.splice(d,1),i++)}function Ga(a,b,c,d,f,g){d=ka(b,d,f,g);f=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||f.sSearch.length>b.length||1==c||0!==b.indexOf(f.sSearch)){a.aiDisplay.splice(0,a.aiDisplay.length);ja(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&
a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function ja(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch.splice(0,a.asDataSearch.length);for(var c=b&&1===b?a.aiDisplayMaster:a.aiDisplay,d=0,f=c.length;d<f;d++)a.asDataSearch[d]=ma(a,X(a,c[d],"filter"))}}function ma(a,b){var c="";if(a.__nTmpFilter===m)a.__nTmpFilter=l.createElement("div");for(var d=a.__nTmpFilter,f=0,g=a.aoColumns.length;f<g;f++)a.aoColumns[f].bSearchable&&
(c+=la(b[f],a.aoColumns[f].sType)+"  ");if(-1!==c.indexOf("&"))d.innerHTML=c,c=d.textContent?d.textContent:d.innerText,c=c.replace(/\n/g," ").replace(/\r/g,"");return c}function ka(a,b,c,d){if(c)return a=b?a.split(" "):na(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:na(a);return RegExp(a,d?"i":"")}function la(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?
a.replace(/[\r\n]/g," "):a}function na(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","g"),"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;if(!a.aanFeatures.i)a.aoDrawCallback.push({fn:Ja,sName:"information"}),b.id=a.sTableId+"_info";a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ja(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),
f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),i;i=0===g&&g==f?b.sInfoEmpty:0===g?b.sInfoEmpty+" "+b.sInfoFiltered:g==f?b.sInfo:b.sInfo+" "+b.sInfoFiltered;i+=b.sInfoPostFix;i=ha(a,i);null!==b.fnInfoCallback&&(i=b.fnInfoCallback.call(a.oInstance,a,c,d,f,g,i));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(i)}}function ha(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),f=a.fnRecordsDisplay(),f=a.fnFormatNumber(f),g=a.fnRecordsTotal(),g=a.fnFormatNumber(g);
a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace("_START_",c).replace("_END_",d).replace("_TOTAL_",f).replace("_MAX_",g)}function aa(a){var b,c,d=a.iInitDisplayStart;if(!1===a.bInitialised)setTimeout(function(){aa(a)},200);else{xa(a);va(a);U(a,a.aoHeader);a.nTFoot&&U(a,a.aoFooter);G(a,!0);a.oFeatures.bAutoWidth&&ba(a);for(b=0,c=a.aoColumns.length;b<c;b++)if(null!==a.aoColumns[b].sWidth)a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth);a.oFeatures.bSort?P(a):a.oFeatures.bFilter?
M(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),B(a),z(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ia(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(c){var g=""!==a.sAjaxDataProp?W(a.sAjaxDataProp)(c):c;for(b=0;b<g.length;b++)H(a,g[b]);a.iInitDisplayStart=d;a.oFeatures.bSort?P(a):(a.aiDisplay=a.aiDisplayMaster.slice(),B(a),z(a));G(a,!1);Z(a,c)},a)):a.oFeatures.bServerSide||(G(a,!1),Z(a))}}function Z(a,b){a._bInitComplete=!0;D(a,"aoInitComplete","init",[a,
b])}function oa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&a.sZeroRecords&&"No data available in table"===b.sEmptyTable&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&a.sZeroRecords&&"Loading..."===b.sLoadingRecords&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,f=a.aLengthMenu;if(2==f.length&&"object"===typeof f[0]&&"object"===typeof f[1])for(c=0,d=f[0].length;c<d;c++)b+='<option value="'+
f[0][c]+'">'+f[1][c]+"</option>";else for(c=0,d=f.length;c<d;c++)b+='<option value="'+f[c]+'">'+f[c]+"</option>";b+="</select>";f=l.createElement("div");if(!a.aanFeatures.l)f.id=a.sTableId+"_length";f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",!0);h("select",f).bind("change.DT",function(){var b=h(this).val(),f=a.aanFeatures.l;for(c=0,d=f.length;c<d;c++)f[c]!=this.parentNode&&
h("select",f[c]).val(b);a._iDisplayLength=parseInt(b,10);B(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()&&(a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength,0>a._iDisplayStart))a._iDisplayStart=0;if(-1==a._iDisplayLength)a._iDisplayStart=0;z(a)});h("select",f).attr("aria-controls",a.sTableId);return f}function B(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}
function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a,b,function(a){B(a);z(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){B(a);z(a)})},sName:"pagination"});return b}function pa(a,b){var c=a._iDisplayStart;if("number"===typeof b){if(a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay())a._iDisplayStart=
0}else if("first"==b)a._iDisplayStart=0;else if("previous"==b){if(a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart)a._iDisplayStart=0}else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=
0;else F(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");if(!a.aanFeatures.r)b.id=a.sTableId+"_processing";b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function G(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,f=c.length;d<f;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===
a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),f=l.createElement("div"),g=l.createElement("div"),i=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),n=a.nTable.getElementsByTagName("thead")[0],o=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],k=a.oClasses;c.appendChild(d);g.appendChild(i);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(e);
e.appendChild(n);null!==o&&(b.appendChild(g),i.appendChild(j),j.appendChild(o));b.className=k.sScrollWrapper;c.className=k.sScrollHead;d.className=k.sScrollHeadInner;f.className=k.sScrollBody;g.className=k.sScrollFoot;i.className=k.sScrollFootInner;if(a.oScroll.bAutoCss)c.style.overflow="hidden",c.style.position="relative",g.style.overflow="hidden",f.style.overflow="auto";c.style.border="0";c.style.width="100%";g.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");
e.style.marginLeft="0";a.nTable.style.marginLeft="0";if(null!==o)j.removeAttribute("id"),j.style.marginLeft="0";d=h(a.nTable).children("caption");0<d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&o&&j.appendChild(d));if(""!==a.oScroll.sX){c.style.width=q(a.oScroll.sX);f.style.width=q(a.oScroll.sX);if(null!==o)g.style.width=q(a.oScroll.sX);h(f).scroll(function(){c.scrollLeft=this.scrollLeft;if(null!==o)g.scrollLeft=this.scrollLeft})}if(""!==a.oScroll.sY)f.style.height=
q(a.oScroll.sY);a.aoDrawCallback.push({fn:Ka,sName:"scrolling"});a.oScroll.bInfinite&&h(f).scroll(function(){!a.bDrawing&&0!==h(this).scrollTop()&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()&&(pa(a,"next"),B(a),z(a))});a.nScrollHead=c;a.nScrollFoot=g;return b}function Ka(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,f,g,i,e,j,n,o,k,m=[],s=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:
null,p=null!==a.nTFoot?s.getElementsByTagName("table")[0]:null,l=h.browser.msie&&7>=h.browser.version;h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]));if(""===a.oScroll.sX)d.style.width="100%",b.parentNode.style.width="100%";var r=O(a,i);for(f=0,g=r.length;f<g;f++)o=x(a,f),r[f].style.width=a.aoColumns[o].sWidth;null!==a.nTFoot&&N(function(a){a.style.width=
""},j.getElementsByTagName("tr"));if(a.oScroll.bCollapse&&""!==a.oScroll.sY)d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px";f=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",l&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(""!==a.oScroll.sXInner)a.nTable.style.width=q(a.oScroll.sXInner);else if(f==h(d).width()&&h(d).height()<h(a.nTable).height()){if(a.nTable.style.width=
q(f-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>f-a.oScroll.iBarWidth)a.nTable.style.width=q(f)}else a.nTable.style.width=q(f);f=h(a.nTable).outerWidth();g=a.nTHead.getElementsByTagName("tr");i=i.getElementsByTagName("tr");N(function(a,b){n=a.style;n.paddingTop="0";n.paddingBottom="0";n.borderTopWidth="0";n.borderBottomWidth="0";n.height=0;k=h(a).width();b.style.width=q(k);m.push(k)},i,g);h(i).height(0);null!==a.nTFoot&&(e=j.getElementsByTagName("tr"),j=a.nTFoot.getElementsByTagName("tr"),N(function(a,
b){n=a.style;n.paddingTop="0";n.paddingBottom="0";n.borderTopWidth="0";n.borderBottomWidth="0";n.height=0;k=h(a).width();b.style.width=q(k);m.push(k)},e,j),h(e).height(0));N(function(a){a.innerHTML="";a.style.width=q(m.shift())},i);null!==a.nTFoot&&N(function(a){a.innerHTML="";a.style.width=q(m.shift())},e);if(h(a.nTable).outerWidth()<f){e=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?f+a.oScroll.iBarWidth:f;if(l&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=
q(e-a.oScroll.iBarWidth);d.style.width=q(e);b.parentNode.style.width=q(e);if(null!==a.nTFoot)s.parentNode.style.width=q(e);""===a.oScroll.sX?F(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):""!==a.oScroll.sXInner&&F(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else if(d.style.width=
q("100%"),b.parentNode.style.width=q("100%"),null!==a.nTFoot)s.parentNode.style.width=q("100%");if(""===a.oScroll.sY&&l)d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),l=""!==a.oScroll.sX&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight))d.style.height=q(a.nTable.offsetHeight+l);l=h(a.nTable).outerWidth();c.style.width=q(l);b.style.width=q(l);c=h(a.nTable).height()>
d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";if(null!==a.nTFoot)p.style.width=q(l),s.style.width=q(l),s.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function N(a,b,c){for(var d=0,f=b.length;d<f;d++)for(var g=0,i=b[d].childNodes.length;g<i;g++)1==b[d].childNodes[g].nodeType&&(c?a(b[d].childNodes[g],c[d].childNodes[g]):a(b[d].childNodes[g]))}function La(a,b){if(!a||null===a||""===a)return 0;
b||(b=l.getElementsByTagName("body")[0]);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function ba(a){var b=0,c,d=0,f=a.aoColumns.length,g,i=h("th",a.nTHead),e=a.nTable.getAttribute("width");for(g=0;g<f;g++)if(a.aoColumns[g].bVisible&&(d++,null!==a.aoColumns[g].sWidth)){c=La(a.aoColumns[g].sWidthOrig,a.nTable.parentNode);if(null!==c)a.aoColumns[g].sWidth=q(c);b++}if(f==i.length&&0===b&&d==f&&""===a.oScroll.sX&&""===a.oScroll.sY)for(g=
0;g<a.aoColumns.length;g++){if(c=h(i[g]).width(),null!==c)a.aoColumns[g].sWidth=q(c)}else{b=a.nTable.cloneNode(!1);g=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(g);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),N(function(a){a.style.width=""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));i=O(a,g);for(g=d=0;g<f;g++){var j=a.aoColumns[g];j.bVisible&&
null!==j.sWidthOrig&&""!==j.sWidthOrig?i[g-d].style.width=q(j.sWidthOrig):j.bVisible?i[g-d].style.width="":d++}for(g=0;g<f;g++)a.aoColumns[g].bVisible&&(d=Ma(a,g),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[g].sContentPadding&&(d.innerHTML+=a.aoColumns[g].sContentPadding),c.appendChild(d)));f=a.nTable.parentNode;f.appendChild(b);if(""!==a.oScroll.sX&&""!==a.oScroll.sXInner)b.style.width=q(a.oScroll.sXInner);else if(""!==a.oScroll.sX){if(b.style.width="",h(b).width()<f.offsetWidth)b.style.width=
q(f.offsetWidth)}else if(""!==a.oScroll.sY)b.style.width=q(f.offsetWidth);else if(e)b.style.width=q(e);b.style.visibility="hidden";Na(a,b);f=h("tbody tr:eq(0)",b).children();0===f.length&&(f=O(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(g=d=c=0;g<a.aoColumns.length;g++)a.aoColumns[g].bVisible&&(c=null===a.aoColumns[g].sWidthOrig?c+h(f[d]).outerWidth():c+(parseInt(a.aoColumns[g].sWidth.replace("px",""),10)+(h(f[d]).outerWidth()-h(f[d]).width())),d++);b.style.width=q(c);a.nTable.style.width=q(c)}for(g=
d=0;g<a.aoColumns.length;g++)if(a.aoColumns[g].bVisible){c=h(f[d]).width();if(null!==c&&0<c)a.aoColumns[g].sWidth=q(c);d++}f=h(b).css("width");a.nTable.style.width=-1!==f.indexOf("%")?f:q(h(b).outerWidth());b.parentNode.removeChild(b)}if(e)a.nTable.style.width=q(e)}function Na(a,b){if(""===a.oScroll.sX&&""!==a.oScroll.sY)h(b).width(),b.style.width=q(h(b).outerWidth()-a.oScroll.iBarWidth);else if(""!==a.oScroll.sX)b.style.width=q(h(b).outerWidth())}function Ma(a,b){var c=Oa(a,b);if(0>c)return null;
if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=w(a,c,b,"");return d}return L(a,c)[b]}function Oa(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var g=w(a,f,b,"display")+"",g=g.replace(/<.*?>/g,"");if(g.length>c)c=g.length,d=f}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);return 48>b||57<b?a:a+"px"}function Pa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=
l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;if(b==a)a=c.clientWidth;l.body.removeChild(c);return b-a}function P(a,b){var c,d,f,g,i,e,o=[],n=[],k=j.ext.oSort,s=a.aoData,l=a.aoColumns,p=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=
null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],f=r(a,d),g=a.aoColumns[d].sSortDataType,j.ext.afnSortData[g])if(i=j.ext.afnSortData[g].call(a.oInstance,a,d,f),i.length===s.length)for(f=0,g=s.length;f<g;f++)I(a,f,d,i[f]);else F(a,0,"Returned data sort array (col "+d+") is the wrong length");for(c=0,d=a.aiDisplayMaster.length;c<d;c++)n[a.aiDisplayMaster[c]]=c;var q=o.length,x;for(c=0,d=s.length;c<d;c++)for(f=0;f<q;f++){x=l[o[f][0]].aDataSort;
for(i=0,e=x.length;i<e;i++)g=l[x[i]].sType,g=k[(g?g:"string")+"-pre"],s[c]._aSortData[x[i]]=g?g(w(a,c,x[i],"sort")):w(a,c,x[i],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,f,g,i;for(c=0;c<q;c++){i=l[o[c][0]].aDataSort;for(d=0,f=i.length;d<f;d++)if(g=l[i[d]].sType,g=k[(g?g:"string")+"-"+o[c][1]](s[a]._aSortData[i[d]],s[b]._aSortData[i[d]]),0!==g)return g}return k["numeric-asc"](n[a],n[b])})}(b===m||b)&&!a.oFeatures.bDeferRender&&Q(a);for(c=0,d=a.aoColumns.length;c<d;c++)g=l[c].sTitle.replace(/<.*?>/g,
""),f=l[c].nTh,f.removeAttribute("aria-sort"),f.removeAttribute("aria-label"),l[c].bSortable?0<o.length&&o[0][0]==c?(f.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),f.setAttribute("aria-label",g+("asc"==(l[c].asSorting[o[0][2]+1]?l[c].asSorting[o[0][2]+1]:l[c].asSorting[0])?p.sSortAscending:p.sSortDescending))):f.setAttribute("aria-label",g+("asc"==l[c].asSorting[0]?p.sSortAscending:p.sSortDescending)):f.setAttribute("aria-label",g);a.bSorted=!0;h(a.oInstance).trigger("sort",a);
a.oFeatures.bFilter?M(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,B(a),z(a))}function ga(a,b,c,d){Qa(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var g=function(){var d,g;if(b.shiftKey){for(var e=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){e=!0;d=a.aaSorting[h][0];g=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[g]?(a.aaSorting[h][1]=a.aoColumns[d].asSorting[g],a.aaSorting[h][2]=g):a.aaSorting.splice(h,1);break}!1===e&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],
0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],g=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[g]||(g=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[g],a.aaSorting[0][2]=g):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));P(a)};a.oFeatures.bProcessing?(G(a,!0),setTimeout(function(){g();a.oFeatures.bServerSide||G(a,!1)},0)):g();"function"==typeof d&&d(a)}})}function Q(a){var b,c,d,f,g,e=a.aoColumns.length,j=a.oClasses;for(b=0;b<
e;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);f=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){g=a.aoColumns[b].sSortingClass;d=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){g="asc"==f[c][1]?j.sSortAsc:j.sSortDesc;d=c;break}h(a.aoColumns[b].nTh).addClass(g);a.bJUI&&(c=h("span."+j.sSortIcon,a.aoColumns[b].nTh),c.removeClass(j.sSortJUIAsc+
" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),c.addClass(-1==d?a.aoColumns[b].sSortingClassJUI:"asc"==f[d][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);g=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=L(a);if(a.oFeatures.bDeferRender)h(d).removeClass(g+"1 "+g+"2 "+g+"3");else if(d.length>=e)for(b=0;b<e;b++)if(-1!=d[b].className.indexOf(g+"1"))for(c=0,a=d.length/e;c<a;c++)d[e*c+b].className=
h.trim(d[e*c+b].className.replace(g+"1",""));else if(-1!=d[b].className.indexOf(g+"2"))for(c=0,a=d.length/e;c<a;c++)d[e*c+b].className=h.trim(d[e*c+b].className.replace(g+"2",""));else if(-1!=d[b].className.indexOf(g+"3"))for(c=0,a=d.length/e;c<a;c++)d[e*c+b].className=h.trim(d[e*c+b].className.replace(" "+g+"3",""));var j=1,o;for(b=0;b<f.length;b++){o=parseInt(f[b][0],10);for(c=0,a=d.length/e;c<a;c++)d[e*c+o].className+=" "+g+j;3>j&&j++}}}function qa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,
c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};for(b=0,c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);D(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Ra(a,b){if(a.oFeatures.bStateSave){var c=
a.fnStateLoad.call(a.oInstance,a);if(c){var d=D(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=
c.abVisCols[d];D(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function Sa(a){for(var b=V.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null}function t(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function S(a){for(var b=
[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function L(a,b){var c=[],d,f,g,e,h,j;f=0;var o=a.aoData.length;b!==m&&(f=b,o=b+1);for(g=f;g<o;g++)if(j=a.aoData[g],null!==j.nTr){f=[];for(e=0,h=j.nTr.childNodes.length;e<h;e++)d=j.nTr.childNodes[e].nodeName.toLowerCase(),("td"==d||"th"==d)&&f.push(j.nTr.childNodes[e]);d=0;for(e=0,h=a.aoColumns.length;e<h;e++)a.aoColumns[e].bVisible?c.push(f[e-d]):(c.push(j._anHidden[e]),d++)}return c}function F(a,b,c){a=null===a?"DataTables warning: "+
c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else V.console&&console.log&&console.log(a)}function p(a,b,c,d){d===m&&(d=c);b[c]!==m&&(a[d]=b[c])}function Ta(a,b){for(var c in b)b.hasOwnProperty(c)&&("object"===typeof e[c]&&!1===h.isArray(b[c])?h.extend(!0,a[c],b[c]):a[c]=b[c]);return a}function Qa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",
function(){return!1})}function C(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function D(a,b,c,d){for(var b=a[b],f=[],g=b.length-1;0<=g;g--)f.push(b[g].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return f}function Ua(a){return function(){var b=[t(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var Va=V.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,f=[],g=
h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Va(d)),f.push((g?"":'"'+c+'":')+d);return(g?"[":"{")+f+(g?"]":"}")};this.$=function(a,b){var c,d,f=[],g=t(this[j.ext.iApiIndex]);b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page)for(c=g._iDisplayStart,d=g.fnDisplayEnd();c<d;c++)f.push(g.aoData[g.aiDisplay[c]].nTr);else if("current"==b.order&&"none"==b.filter)for(c=0,d=g.aiDisplayMaster.length;c<d;c++)f.push(g.aoData[g.aiDisplayMaster[c]].nTr);
else if("current"==b.order&&"applied"==b.filter)for(c=0,d=g.aiDisplay.length;c<d;c++)f.push(g.aoData[g.aiDisplay[c]].nTr);else if("original"==b.order&&"none"==b.filter)for(c=0,d=g.aoData.length;c<d;c++)f.push(g.aoData[c].nTr);else if("original"==b.order&&"applied"==b.filter)for(c=0,d=g.aoData.length;c<d;c++)-1!==h.inArray(c,g.aiDisplay)&&f.push(g.aoData[c].nTr);else F(g,1,"Unknown selection options");d=h(f);c=d.filter(a);d=d.find(a);return h([].concat(h.makeArray(c),h.makeArray(d)))};this._=function(a,
b){var c=[],d,f,g=this.$(a,b);for(d=0,f=g.length;d<f;d++)c.push(this.fnGetData(g[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],d,f=t(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var g=0;g<a.length;g++){d=H(f,a[g]);if(-1==d)return c;c.push(d)}else{d=H(f,a);if(-1==d)return c;c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();(b===m||b)&&$(f);return c};this.fnAdjustColumnSizing=function(a){var b=t(this[j.ext.iApiIndex]);k(b);a===m||a?this.fnDraw(!1):
(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=t(this[j.ext.iApiIndex]);ea(b);(a===m||a)&&z(b)};this.fnClose=function(a){for(var b=t(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=t(this[j.ext.iApiIndex]),f,g,a="object"===typeof a?K(d,a):a,e=d.aoData.splice(a,
1);for(f=0,g=d.aoData.length;f<g;f++)if(null!==d.aoData[f].nTr)d.aoData[f].nTr._DT_RowIndex=f;f=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(f,1);fa(d.aiDisplayMaster,a);fa(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,e);if(d._iDisplayStart>=d.aiDisplay.length&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart))d._iDisplayStart=0;if(c===m||c)B(d),z(d);return e};this.fnDestroy=function(a){var b=t(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,f,g,a=a===m?!1:!0;b.bDestroying=
!0;D(b,"aoDestroyCallback","destroy",[b]);for(f=0,g=b.aoColumns.length;f<g;f++)!1===b.aoColumns[f].bVisible&&this.fnSetColumnVis(f,!0);h(b.nTableWrapper).find("*").andSelf().unbind(".DT");h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);
h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];Q(b);h(S(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?
c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);for(f=0,g=b.aoData.length;f<g;f++)null!==b.aoData[f].nTr&&d.appendChild(b.aoData[f].nTr);if(!0===b.oFeatures.bAutoWidth)b.nTable.style.width=q(b.sDestroyWidth);h(d).children("tr:even").addClass(b.asDestroyStripes[0]);h(d).children("tr:odd").addClass(b.asDestroyStripes[1]);for(f=0,g=j.settings.length;f<g;f++)j.settings[f]==b&&j.settings.splice(f,1);b=null};this.fnDraw=function(a){var b=t(this[j.ext.iApiIndex]);!1===a?(B(b),
z(b)):$(b)};this.fnFilter=function(a,b,c,d,f,g){var e=t(this[j.ext.iApiIndex]);if(e.oFeatures.bFilter){if(c===m||null===c)c=!1;if(d===m||null===d)d=!0;if(f===m||null===f)f=!0;if(g===m||null===g)g=!0;if(b===m||null===b){if(M(e,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:g},1),f&&e.aanFeatures.f){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++)h(b[c]._DT_Input).val(a)}}else h.extend(e.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:g}),M(e,e.oPreviousSearch,1)}};this.fnGetData=
function(a,b){var c=t(this[j.ext.iApiIndex]);if(a!==m){var d=a;if("object"===typeof a){var f=a.nodeName.toLowerCase();"tr"===f?d=K(c,a):"td"===f&&(d=K(c,a.parentNode),b=da(c,d,a))}return b!==m?w(c,d,b,""):c.aoData[d]!==m?c.aoData[d]._aData:null}return Y(c)};this.fnGetNodes=function(a){var b=t(this[j.ext.iApiIndex]);return a!==m?b.aoData[a]!==m?b.aoData[a].nTr:null:S(b)};this.fnGetPosition=function(a){var b=t(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();if("TR"==c)return K(b,a);return"TD"==c||
"TH"==c?(c=K(b,a.parentNode),a=da(b,c,a),[c,r(b,a),a]):null};this.fnIsOpen=function(a){for(var b=t(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=t(this[j.ext.iApiIndex]),f=S(d);if(-1!==h.inArray(a,f)){this.fnClose(a);var f=l.createElement("tr"),g=l.createElement("td");f.appendChild(g);g.className=c;g.colSpan=v(d);"string"===typeof b?g.innerHTML=b:h(g).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(f).insertAfter(a);
d.aoOpenRows.push({nTr:f,nParent:a});return f}};this.fnPageChange=function(a,b){var c=t(this[j.ext.iApiIndex]);pa(c,a);B(c);(b===m||b)&&z(c)};this.fnSetColumnVis=function(a,b,c){var d=t(this[j.ext.iApiIndex]),f,g,e=d.aoColumns,h=d.aoData,o,n;if(e[a].bVisible!=b){if(b){for(f=g=0;f<a;f++)e[f].bVisible&&g++;n=g>=v(d);if(!n)for(f=a;f<e.length;f++)if(e[f].bVisible){o=f;break}for(f=0,g=h.length;f<g;f++)null!==h[f].nTr&&(n?h[f].nTr.appendChild(h[f]._anHidden[a]):h[f].nTr.insertBefore(h[f]._anHidden[a],L(d,
f)[o]))}else for(f=0,g=h.length;f<g;f++)null!==h[f].nTr&&(o=L(d,f)[a],h[f]._anHidden[a]=o,o.parentNode.removeChild(o));e[a].bVisible=b;U(d,d.aoHeader);d.nTFoot&&U(d,d.aoFooter);for(f=0,g=d.aoOpenRows.length;f<g;f++)d.aoOpenRows[f].nTr.colSpan=v(d);if(c===m||c)k(d),z(d);qa(d)}};this.fnSettings=function(){return t(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=t(this[j.ext.iApiIndex]);b.aaSorting=a;P(b)};this.fnSortListener=function(a,b,c){ga(t(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,
b,c,d,f){var e=t(this[j.ext.iApiIndex]),b="object"===typeof b?K(e,b):b;if(e.__fnUpdateDeep===m&&h.isArray(a)&&"object"===typeof a){e.aoData[b]._aData=a.slice();e.__fnUpdateDeep=!0;for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(w(e,b,c),b,c,!1,!1);e.__fnUpdateDeep=m}else if(e.__fnUpdateDeep===m&&null!==a&&"object"===typeof a){e.aoData[b]._aData=h.extend(!0,{},a);e.__fnUpdateDeep=!0;for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(w(e,b,c),b,c,!1,!1);e.__fnUpdateDeep=m}else{I(e,b,c,a);var a=w(e,b,c,"display"),
i=e.aoColumns[c];null!==i.fnRender&&(a=R(e,b,c),i.bUseRendered&&I(e,b,c,a));if(null!==e.aoData[b].nTr)L(e,b)[c].innerHTML=a}c=h.inArray(b,e.aiDisplay);e.asDataSearch[c]=ma(e,X(e,b,"filter"));(f===m||f)&&k(e);(d===m||d)&&$(e);return 0};this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Ua,_fnInitialise:aa,_fnInitComplete:Z,_fnLanguageCompat:oa,_fnAddColumn:o,_fnColumnOptions:s,_fnAddData:H,_fnCreateTr:ca,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:U,_fnDraw:z,_fnReDraw:$,_fnAjaxUpdate:wa,
_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ia,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:Ka,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:M,_fnFilterCustom:Ia,_fnFilterColumn:Ha,_fnFilter:Ga,_fnBuildSearchArray:ja,_fnBuildSearchRow:ma,_fnFilterCreateSearch:ka,_fnDataToSearch:la,_fnSort:P,_fnSortAttachListener:ga,_fnSortingClasses:Q,_fnFeatureHtmlPaginate:Da,_fnPageChange:pa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ja,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,
_fnProcessingDisplay:G,_fnVisibleToColumnIndex:x,_fnColumnIndexToVisible:r,_fnNodeToDataIndex:K,_fnVisbleColumns:v,_fnCalculateEnd:B,_fnConvertToWidth:La,_fnCalculateColumnWidths:ba,_fnScrollingWidthAdjust:Na,_fnGetWidestNode:Ma,_fnGetMaxLenString:Oa,_fnStringToCss:q,_fnDetectType:A,_fnSettingsFromNode:t,_fnGetDataMaster:Y,_fnGetTrNodes:S,_fnGetTdNodes:L,_fnEscapeRegex:na,_fnDeleteIndex:fa,_fnReOrderIndex:E,_fnColumnOrdering:y,_fnLog:F,_fnClearTable:ea,_fnSaveState:qa,_fnLoadState:Ra,_fnCreateCookie:function(a,
b,c,d,e){var g=new Date;g.setTime(g.getTime()+1E3*c);var c=V.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),i;null!==e?(i="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"),b=e(a,i,g.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+g.toGMTString()+"; path="+c.join("/")+"/";e="";g=9999999999999;if(4096<(null!==Sa(a)?l.cookie.length:b.length+l.cookie.length)+10){for(var a=l.cookie.split(";"),j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=
a[j].split("=");try{i=eval("("+decodeURIComponent(k[1])+")")}catch(m){continue}if(i.iCreate&&i.iCreate<g)e=k[0],g=i.iCreate}if(""!==e)l.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}l.cookie=b},_fnReadCookie:Sa,_fnDetectHeader:T,_fnGetUniqueThs:O,_fnScrollBarWidth:Pa,_fnApplyToChildren:N,_fnMap:p,_fnGetRowData:X,_fnGetCellData:w,_fnSetCellData:I,_fnGetObjectDataFn:W,_fnSetObjectDataFn:ta,_fnApplyColumnDefs:J,_fnBindAction:Qa,_fnExtend:Ta,_fnCallbackReg:C,_fnCallbackFire:D,
_fnJsonString:Va,_fnRender:R,_fnNodeToColumnIndex:da,_fnInfoMacros:ha};h.extend(j.ext.oApi,this.oApi);for(var ra in j.ext.oApi)ra&&(this[ra]=Ua(ra));var sa=this;return this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var f=!1,g=!1;if("table"!=this.nodeName.toLowerCase())F(null,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{for(a=0,b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===m||e.bRetrieve)return j.settings[a].oInstance;
if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{F(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;var i=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:sa.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,
sTableId:c});j.settings.push(i);i.oInstance=1===sa.length?sa:h(this).dataTable();e||(e={});e.oLanguage&&oa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(i.oFeatures,e,"bPaginate");p(i.oFeatures,e,"bLengthChange");p(i.oFeatures,e,"bFilter");p(i.oFeatures,e,"bSort");p(i.oFeatures,e,"bInfo");p(i.oFeatures,e,"bProcessing");p(i.oFeatures,e,"bAutoWidth");p(i.oFeatures,e,"bSortClasses");p(i.oFeatures,e,"bServerSide");p(i.oFeatures,e,"bDeferRender");p(i.oScroll,e,"sScrollX","sX");p(i.oScroll,e,"sScrollXInner",
"sXInner");p(i.oScroll,e,"sScrollY","sY");p(i.oScroll,e,"bScrollCollapse","bCollapse");p(i.oScroll,e,"bScrollInfinite","bInfinite");p(i.oScroll,e,"iScrollLoadGap","iLoadGap");p(i.oScroll,e,"bScrollAutoCss","bAutoCss");p(i,e,"asStripeClasses");p(i,e,"asStripClasses","asStripeClasses");p(i,e,"fnServerData");p(i,e,"fnFormatNumber");p(i,e,"sServerMethod");p(i,e,"aaSorting");p(i,e,"aaSortingFixed");p(i,e,"aLengthMenu");p(i,e,"sPaginationType");p(i,e,"sAjaxSource");p(i,e,"sAjaxDataProp");p(i,e,"iCookieDuration");
p(i,e,"sCookiePrefix");p(i,e,"sDom");p(i,e,"bSortCellsTop");p(i,e,"iTabIndex");p(i,e,"oSearch","oPreviousSearch");p(i,e,"aoSearchCols","aoPreSearchCols");p(i,e,"iDisplayLength","_iDisplayLength");p(i,e,"bJQueryUI","bJUI");p(i,e,"fnCookieCallback");p(i,e,"fnStateLoad");p(i,e,"fnStateSave");p(i.oLanguage,e,"fnInfoCallback");C(i,"aoDrawCallback",e.fnDrawCallback,"user");C(i,"aoServerParams",e.fnServerParams,"user");C(i,"aoStateSaveParams",e.fnStateSaveParams,"user");C(i,"aoStateLoadParams",e.fnStateLoadParams,
"user");C(i,"aoStateLoaded",e.fnStateLoaded,"user");C(i,"aoRowCallback",e.fnRowCallback,"user");C(i,"aoRowCreatedCallback",e.fnCreatedRow,"user");C(i,"aoHeaderCallback",e.fnHeaderCallback,"user");C(i,"aoFooterCallback",e.fnFooterCallback,"user");C(i,"aoInitComplete",e.fnInitComplete,"user");C(i,"aoPreDrawCallback",e.fnPreDrawCallback,"user");i.oFeatures.bServerSide&&i.oFeatures.bSort&&i.oFeatures.bSortClasses?C(i,"aoDrawCallback",Q,"server_side_sort_classes"):i.oFeatures.bDeferRender&&C(i,"aoDrawCallback",
Q,"defer_sort_classes");if(e.bJQueryUI){if(h.extend(i.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom)i.sDom='<"H"lfr>t<"F"ip>'}else h.extend(i.oClasses,j.ext.oStdClasses);h(this).addClass(i.oClasses.sTable);if(""!==i.oScroll.sX||""!==i.oScroll.sY)i.oScroll.iBarWidth=Pa();if(i.iInitDisplayStart===m)i.iInitDisplayStart=e.iDisplayStart,i._iDisplayStart=e.iDisplayStart;if(e.bStateSave)i.oFeatures.bStateSave=!0,Ra(i,e),C(i,"aoDrawCallback",qa,"state_save");if(null!==e.iDeferLoading)i.bDeferLoading=
!0,a=h.isArray(e.iDeferLoading),i._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,i._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading;null!==e.aaData&&(g=!0);""!==e.oLanguage.sUrl?(i.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(i.oLanguage.sUrl,null,function(a){oa(a);h.extend(!0,i.oLanguage,e.oLanguage,a);aa(i)}),f=!0):h.extend(!0,i.oLanguage,e.oLanguage);if(null===e.asStripeClasses)i.asStripeClasses=[i.oClasses.sStripeOdd,i.oClasses.sStripeEven];c=!1;d=h(this).children("tbody").children("tr");
for(a=0,b=i.asStripeClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(i.asStripeClasses[a])){c=!0;break}if(c)i.asDestroyStripes=["",""],h(d[0]).hasClass(i.oClasses.sStripeOdd)&&(i.asDestroyStripes[0]+=i.oClasses.sStripeOdd+" "),h(d[0]).hasClass(i.oClasses.sStripeEven)&&(i.asDestroyStripes[0]+=i.oClasses.sStripeEven),h(d[1]).hasClass(i.oClasses.sStripeOdd)&&(i.asDestroyStripes[1]+=i.oClasses.sStripeOdd+" "),h(d[1]).hasClass(i.oClasses.sStripeEven)&&(i.asDestroyStripes[1]+=i.oClasses.sStripeEven),
d.removeClass(i.asStripeClasses.join(" "));c=[];a=this.getElementsByTagName("thead");0!==a.length&&(T(i.aoHeader,a[0]),c=O(i));if(null===e.aoColumns){d=[];for(a=0,b=c.length;a<b;a++)d.push(null)}else d=e.aoColumns;for(a=0,b=d.length;a<b;a++){if(e.saved_aoColumns!==m&&e.saved_aoColumns.length==b)null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible;o(i,c?c[a]:null)}J(i,e.aoColumnDefs,d,function(a,b){s(i,a,b)});for(a=0,b=i.aaSorting.length;a<b;a++){i.aaSorting[a][0]>=i.aoColumns.length&&
(i.aaSorting[a][0]=0);var k=i.aoColumns[i.aaSorting[a][0]];i.aaSorting[a][2]===m&&(i.aaSorting[a][2]=0);e.aaSorting===m&&i.saved_aaSorting===m&&(i.aaSorting[a][1]=k.asSorting[0]);for(c=0,d=k.asSorting.length;c<d;c++)if(i.aaSorting[a][1]==k.asSorting[c]){i.aaSorting[a][2]=c;break}}Q(i);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));i.nTHead=b[0];b=h(this).children("tbody");
0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));i.nTBody=b[0];i.nTBody.setAttribute("role","alert");i.nTBody.setAttribute("aria-live","polite");i.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==i.oScroll.sX||""!==i.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);if(0<b.length)i.nTFoot=b[0],T(i.aoFooter,i.nTFoot);if(g)for(a=0;a<e.aaData.length;a++)H(i,e.aaData[a]);else ua(i);i.aiDisplay=i.aiDisplayMaster.slice();
i.bInitialised=!0;!1===f&&aa(i)}})};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."),e=e.split("."),k="",l="",r=0,v=e.length;r<v;r++)k+=h(m[r],3),l+=h(e[r],3);return parseInt(k,10)>=parseInt(l,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&
o.push(k.nTable)});return o};j.version="1.9.1";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,
asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,fnRender:null,fnSetData:null,mDataProp:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],
asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+
j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){h(k.oInstance).trigger("xhr",k);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=
this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j="function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",
sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},
oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData",sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mDataProp:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,
sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],
aaSorting:null,aaSortingFixed:null,asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,
aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,
10):this.aiDisplayMaster.length},fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);
h.extend(j.ext.oStdClasses,{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",
sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",
sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",
sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",
sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":
'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var r=h("a",j),k=r[0],r=r[1];e.oApi._fnBindAction(k,{action:"previous"},l);e.oApi._fnBindAction(r,{action:"next"},l);if(!e.aanFeatures.p)j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",r.id=e.sTableId+
"_next",k.setAttribute("aria-controls",e.sTableId),r.setAttribute("aria-controls",e.sTableId)},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k=0,m=j.length;k<m;k++)if(0!==j[k].childNodes.length)j[k].childNodes[0].className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,j[k].childNodes[1].className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,
l=e.oClasses,r=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var v=h("a",j),k=v[0],l=v[1],A=v[2],v=v[3];
e.oApi._fnBindAction(k,{action:"first"},r);e.oApi._fnBindAction(l,{action:"previous"},r);e.oApi._fnBindAction(A,{action:"next"},r);e.oApi._fnBindAction(v,{action:"last"},r);if(!e.aanFeatures.p)j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",A.id=e.sTableId+"_next",v.id=e.sTableId+"_last"},fnUpdate:function(e,m){if(e.aanFeatures.p){var l=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(l/2),x=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),r=Math.ceil(e._iDisplayStart/
e._iDisplayLength)+1,v="",A,E=e.oClasses,y,J=e.aanFeatures.p,H=function(h){e.oApi._fnBindAction(this,{page:h+A-1},function(h){e.oApi._fnPageChange(e,h.data.page);m(e);h.preventDefault()})};-1===e._iDisplayLength?r=k=A=1:x<l?(A=1,k=x):r<=k?(A=1,k=l):r>=x-k?(A=x-l+1,k=x):(A=r-Math.ceil(l/2)+1,k=A+l-1);for(l=A;l<=k;l++)v+=r!==l?'<a tabindex="'+e.iTabIndex+'" class="'+E.sPageButton+'">'+e.fnFormatNumber(l)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+E.sPageButtonActive+'">'+e.fnFormatNumber(l)+"</a>";
for(l=0,k=J.length;l<k;l++)0!==J[l].childNodes.length&&(h("span:eq(0)",J[l]).html(v).children("a").each(H),y=J[l].getElementsByTagName("a"),y=[y[0],y[1],y[y.length-2],y[y.length-1]],h(y).removeClass(E.sPageButton+" "+E.sPageButtonActive+" "+E.sPageButtonStaticDisabled),h([y[0],y[1]]).addClass(1==r?E.sPageButtonStaticDisabled:E.sPageButton),h([y[2],y[3]]).addClass(0===x||r===x||-1===e._iDisplayLength?E.sPageButtonStaticDisabled:E.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=
typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,
h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null;for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==
h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext})(jQuery,window,document,void 0);
;

