(function(){var c=Flavors.Global.namespace("Flavors.Layout.Squared"),e=Flavors.Logger.getLogger(c.__name__);Flavors.Layout=c;c.selectors={service_link:"#not_implemented",description:"#profile_description",service_name:"#services .container .panel-box[data-account-id='{{{service_id}}}'] .header h2"};c.init=function(){$("div.panel-box-medium");var a="left";if($("body").hasClass("left"))a="left";else if($("body").hasClass("center"))a="center";else if($("body").hasClass("right"))a="right";Flavors.Page.Fonts.updateHeader({align:a,
max_width:960})};c.removeService=function(a){var b=$("#services .container div[data-account-id="+a+"]");e("removing service!");$(b).fadeOut(300,function(){$(b).remove()})};c.replaceService=function(a){e("replaceService()");$("#service_"+a.anchor).html(a.html);if($("#service_"+a.anchor).hasClass("panel-box-medium")){Flavors.TemplateGroupMedium.registerPanel(a.anchor);Flavors.TemplateGroupMedium.preparePanel(a.anchor)}};var h=function(a,b){var g={};$("#services .container .panel-box").each(function(){g[parseInt($(this).attr("data-account-id"))]=
this;$(this).remove()});$.each(a,function(d,f){e("reordering grid items");d=$(g[f]);if(b.data[f]){d.html(b.data[f].html);$("body").append(b.data[f].javascript)}$("#services .container").append(d);Flavors.TemplateGroupMedium.registerPanel(d.attr("id").replace("service_",""));Flavors.TemplateGroupMedium.preparePanel(d.attr("id").replace("service_",""))})};c.reorderServices=function(a,b){e("reorderServices()");$("#services .container").css("height",$("#services .container").outerHeight(true));h(a,b);
$("#services .container").css("height","auto")};c.addService=function(a){$("#services .container .panel-box");var b=$.DIV({"class":a.token+" service panel-box panel-box-medium",id:"service_"+a.anchor});$(b).attr("data-account-id",a.id);$(b).html(a.html).appendTo($("#services .container:first"));Flavors.TemplateGroupMedium.registerPanel(a.anchor);Flavors.TemplateGroupMedium.preparePanel(a.anchor)}})();

