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

