(function(){var c=Flavors.Global.namespace("Flavors.Layout.Simple"),d=Flavors.Logger.getLogger(c.__name__),g=false;Flavors.Layout=c;c.selectors={service_link:"#profile_navigation",description:"#profile_description",service_name:".navigation_service_{{{service_id}}} a"};c.init=function(){$("#profile_navigation a").live("click",function(a){d("nav click handler");a.preventDefault();if(!g){$(this).closest("li").each(function(){var b=this.id.replace("navigation_service_","");if(b){d("serviceAnchor="+b);
(b=Flavors.TemplateGroup.preparePanel(b))&&i(b)}});c.setNavState($(this))}});e=$(window).height();$(window).resize(function(){e=$(window).height();h()});h();setTimeout(h,1E3);$(window).scroll(function(){if($("#profile").height()>e){var a=50;if($(window).scrollTop()+e>$("#profile").height()+100)a=$(window).scrollTop()+e-$("#profile").height()-50;$("#profile").css({top:a+"px"})}});Flavors.Page.Fonts.updateHeader({align:"left",max_width:450})};c.setNavState=function(a){try{$("#profile_navigation a").each(function(){$(this).removeClass("color_4").addClass("color_5")});
a.removeClass("color_5").addClass("color_4")}catch(b){}};c.removeService=function(a){$("#service_"+a+", .navigation_service_"+a).fadeOut(250,function(){$(this).remove()})};c.switchToService=function(a){d("switchToService() serviceAnchor="+a);if(a=="_")c.closeAllServices();else{var b=Flavors.TemplateGroup.preparePanel(a);b&&i(b)}c.setNavState($("#navigation_service_"+a+" a"))};c.replaceService=function(a){d("replaceService()");$("#service_"+a.id).html(a.html);Flavors.TemplateGroup.registerPanel(a.anchor);
c.switchToService(a.anchor)};var k=function(a){var b={};$("#profile_navigation li").each(function(){b[parseInt($(this).attr("class").replace("navigation_service_","").replace("navigation_service ",""))]=this;$(this).remove()});$.each(a,function(l,j){d("new order item......");$("#profile_navigation").append(b[j])})};c.reorderServices=function(a){d("reorderServices()");k(a)};c.addService=function(a){$("#profile_navigation").append($.LI({"class":"navigation_service navigation_service_"+a.id,id:"navigation_service_"+
a.anchor},$.A({"class":"color_5",href:"#"},a.title)));var b=$.DIV({"class":"panel-box",id:"service_"+a.id});$(b).html(a.html).appendTo($("#services"));Flavors.TemplateGroup.registerPanel(a.anchor);c.switchToService(a.anchor)};c.closeAllServices=function(a){a&&a.preventDefault();if(f){$(f.element).fadeOut();f=null}$.address.value("_");$("#profile_navigation a").each(function(){$(this).removeClass("color_4").addClass("color_5")})};var f=null,i=function(a){g=true;d("transitionToPanel() panel.serviceAnchor="+
a.serviceAnchor);var b=function(){$(a.element).fadeIn(500);$.address.value(a.serviceAnchor.replace("-","/"));$(".google-map").each(function(){$(this).googleMap($(this).attr("rel"))});g=false};if(f){$(f.element).fadeOut(500);setTimeout(b,500)}else b();f=a},e=$(window).height(),h=function(){$("#profile").height()+100>e?$("#profile").css({position:"absolute"}):$("#profile").css({position:"fixed"})}})();

