(function(){var c=Flavors.Global.namespace("Flavors.Layout.Squared"),d=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(){$.address.strict(false);$.address.externalChange(function(b){d("$.address.externalChange()");b.value=="contact"&&$("#contact_link").trigger("click")});$("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+"]");d("removing service!");$(b).fadeOut(300,function(){$(b).remove()})};c.replaceService=function(a){d("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(e,f){d("reordering grid items");e=$(g[f]);if(b.data[f]){e.html(b.data[f].html);$("body").append(b.data[f].javascript)}$("#services .container").append(e);Flavors.TemplateGroupMedium.registerPanel(e.attr("id").replace("service_",""));Flavors.TemplateGroupMedium.preparePanel(e.attr("id").replace("service_",
""))})};c.reorderServices=function(a,b){d("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)}})();

