(function(){var h=Flavors.Global.namespace("Flavors.Layout.Widescreen");var d=Flavors.Logger.getLogger(h.__name__);Flavors.Layout=h;h.selectors={description:"#profile_description",service_link:"#profile_navigation",service_name:"#profile_navigation #navigation_{{{service_id}}} a"};h.init=function(){d("init()");g=$("#mask_content");f=$(g).find(".panel-box");c();$("#widescreen_tabs li a").live("click",function(m){m.preventDefault();var k=$(this).data("ordinal");var l=e(k);h.switchToService(l)});$("#profile").css("display","block");$.each(f,function(k){if(k>0){$(this).css({display:"none"})}});Flavors.Page.Fonts.updateHeader({align:"center",max_width:740})};h.removeService=function(k){$("#service_"+k+", #navigation_"+k).fadeOut(250,function(){$(this).remove()})};h.replaceService=function(k){d("replaceService()");$("#service_"+k.id).html(k.html);Flavors.TemplateGroup.registerPanel(k.anchor);h.switchToService(k.anchor)};h.switchToService=function(l){d("switchToService() serviceAnchor="+l);var k=null;if(l){k=Flavors.TemplateGroup.preparePanel(l)}if(!k){k={element:$("#profile")}}$(".panel-box.active").removeClass("active");$(k.element).addClass("active");var m=0;if(l!="_"){$.each(f,function(n){if($(this).find("#"+l).length>0){m=n}$(this).css({display:"block"})})}g.animate({marginLeft:-(m*a),height:f.eq(m).height()+100},{duration:400,queue:false});d("serviceAnchor="+l);if(l){if(l=="_"){$.address.value("_")}else{$.address.value(l.replace("-","/"))}}window.setTimeout(function(){g.animate({height:f.eq(m).height()+100},{duration:400,queue:false})},1000)};h.closeAllServices=function(k){d("closeAllServices()")};h.reorderServices=function(k){d("reorderServices()");$("#mask_content").animate({opacity:0},"slow",function(){i(k);b(k);if($(".panel-box.active").length>0){h.switchToService($(".panel-box.active").find(".service").attr("id"))}});window.setTimeout(function(){$("#mask_content").animate({opacity:1},"slow")},750)};h.addService=function(k){$("#widescreen_tabs").fadeIn();var l=$("#profile_navigation").append($.LI({id:"navigation_"+k.id},$.A({"class":"color_5",href:"#"},k.title)));c();var m=$.DIV({"class":"panel-box background_2",id:("service_"+k.id)});$(m).html(k.html).appendTo($("#mask_content"));f=$(g).find(".panel-box");Flavors.TemplateGroup.registerPanel(k.anchor);h.switchToService(k.anchor)};var c=function(){$("#widescreen_tabs li a").each(function(k){d("loopCount: "+k);$(this).data("ordinal",k)})};var i=function(k){var l={};$("#profile_navigation li").each(function(){if(!$(this).is("#navigation_home")){l[parseInt($(this).attr("id").replace("navigation_",""))]=this;$(this).remove()}});$.each(k,function(m,n){d("new order item......");$("#profile_navigation").append(l[n])});c()};var b=function(k){var l={};$("#mask_content .panel-box").each(function(){if(!$(this).is("#profile")){l[parseInt($(this).attr("id").replace("service_",""))]=this;$(this).remove()}});$.each(k,function(m,n){d("new order item......");$("#mask_content").append(l[n])});f=$(g).find(".panel-box")};var j=null;var g=null;var f=null;var a=800;var e=function(k){if(k===0){return"_"}else{return $(f[k]).find(".service").attr("id")}}})();
