(function(){var b=Flavors.Global.namespace("Flavors.Layout.Columns.Mixed"),d=Flavors.Logger.getLogger(b.__name__),g=false;Flavors.Layout=b;b.preInit=function(){d("preInit")};b.init=function(){d("init");Flavors.Layout.Shared.init();b.loadAllPanels();b.fixMixedLayout();$(".layout-content-mask").each(function(){$(this).bind("globalRelayout",function(){b.reinitializeScrollpanes(this)})});d("Initialized")};b.reinitializeScrollpanes=function(a){a=$(a).data("jsp");a!==undefined&&a.reinitialise()};b.fixMixedLayout=
function(){d("fixMixedLayout");$("#layout-content-accounts, .layout-content-account:first").removeClass("grid-size-312");$(".layout-content-account:first").addClass("grid-size-960");$(".layout-content-account").not(":first").removeClass("grid-size-960").addClass("grid-size-312");$(".layout-content-panels:visible").isotope("reLayout",function(){$(".layout-content-panels:visible").parents(".layout-content-mask").each(function(){Flavors.Global.fireRelayout($(this))})})};b.initScrollPanes=function(a){try{a.parents(".layout-content-mask").data("jsp").destroy()}catch(c){}a.parent(".layout-content-mask").each(function(){if(!$(this).hasClass("jspScrollable")){$(this).jScrollPane();
$(this).bind("jsp-initialised",function(){$(this).find(".jspDrag").addClass("about_text_bg")})}})};b.loadAllPanels=function(){d("loadAllPanels");$(".layout-content-panels").wrap('<div class="layout-content-mask" />');$(window).bind("onShowPanel",function(c,e,f){$("#layout-content-loader").prependTo(e);e.find(".layout-content-mask").hide();c=f?e.find(".layout-content-subaccount-"+f):e.find(".layout-content-panels:first");c.parents(".layout-content-mask").show();b.initScrollPanes(c);c.scrollTo(0,0)});
$("#layout-content-accounts").hide();for(var a in accounts)b.loadPanel(a);$("#layout-content-accounts").show()};b.loadPanel=function(a){d("loadPanel() serviceAnchor="+a);if(a=Flavors.Layout.Shared.preparePanel(a)){$(a.element).show();g=true;$(".content-map-embed").each(function(){$(this).googleMap($(this).attr("rel"))});$(".content-custom-map-embed").each(function(){$(this).googleMapCustom()});var c=$(a.element).find(".layout-content-panels:first").show();c=$(a.element).find(".layout-content-nav-dropdown-menu-item:first");
c.length>0?c.trigger("click"):$(window).trigger("service-nav-load-complete");g=false;c=$(a.element).find(".layout-content-panels:first").show();c.parents(".layout-content-mask").show();b.initScrollPanes(c);$(window).trigger("service-nav-open")}};b.aboutChangePosition=function(){d("aboutChangePosition")};b.narrowScreen=function(){d("narrowScreen")};b.addService=function(a){d("addService");Flavors.Page.setUserpageImageColors("about_background");var c=$.LI({"class":"layout-content-account-type-"+a.token+
" layout-content-account content_background layout-content-account-id-"+a.id,id:"layout-content-account-anchor-"+a.anchor});$(c).attr("data-account-id",a.id);$(c).html(a.html).appendTo($("#layout-content-accounts"));Flavors.Layout.Shared.registerPanel(a.anchor);$(c).find(".layout-content-panels").wrap('<div class="layout-content-mask" />');b.loadPanel(a.anchor);Flavors.Page.initExternalLinksNewWindow();window.accounts[a.anchor]={serviceId:String(a.id),type:"type"in a?a.type:a.token}};b.removeService=
function(a){d("removeService");$servicePanel=$(".layout-content-account-id-"+a);$servicePanel.remove();Flavors.Layout.aboutChangePosition();b.fixMixedLayout()};b.replaceService=function(a){d("replaceService");$("#layout-content-account-anchor-"+a.anchor).html(a.html);$("#layout-content-account-anchor-"+a.anchor).find(".layout-content-panels").wrap('<div class="layout-content-mask" />');Flavors.Page.initExternalLinksNewWindow();Flavors.Layout.Shared.registerPanel(a.anchor);b.loadPanel(a.anchor)};b.reorderServices=
function(a){d("reorderServices");var c={};$("#layout-content-accounts .layout-content-account").each(function(){c[parseInt($(this).attr("data-account-id"))]=this});$("#layout-content-accounts").append('<div id="startReorder" />');$.each(a,function(e,f){d("reordering grid items");e=$(c[f]);$("#layout-content-accounts").append(e);$("#startReorder").remove();b.fixMixedLayout()})};b.addLink=function(a){d("addLink");Flavors.Layout.Shared.addLink(a)};b.reorderLinks=function(a,c){d("reorderLinks");Flavors.Layout.Shared.reorderLinks(a,
c)}})();Flavors.Layout.preInit();

