(function(){var b=Flavors.Global.namespace("Flavors.Layout.Widescreen"),f=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(){f("init()");e=$("#mask_content");d=$(e).find(".panel-box");i();$("#widescreen_tabs li a").live("click",function(a){a.preventDefault();a=$(this).data("ordinal");a=j(a);b.switchToService(a)});$("#profile").css("display",
"block");$.each(d,function(a){a>0&&$(this).css({display:"none"})});Flavors.Page.Fonts.updateHeader({align:"center",max_width:740});$.browser.msie&&$.browser.version=="7.0"&&$("#widescreen_container").css("margin-top","40px")};b.removeService=function(a){$("#service_"+a+", #navigation_"+a).fadeOut(250,function(){$(this).remove()})};b.replaceService=function(a){f("replaceService()");$("#service_"+a.id).html(a.html);Flavors.TemplateGroup.registerPanel(a.anchor);b.switchToService(a.anchor)};b.switchToService=
function(a){f("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"})});e.css("height",d.eq(g).height()+100);navigator.platform=="iPad"||navigator.platform=="iPhone"||navigator.platform=="iPod"?widescreenScroll.scrollTo(0,0,"0ms"):e.parents().scrollTo(0,
{duration:0});e.animate({marginLeft:-(g*k)},{duration:500,queue:false});setTimeout(function(){e.css("height",d.eq(g).height()+100)},3E3);f("serviceAnchor="+a);if(a)a=="_"?$.address.value("_"):$.address.value(a.replace("-","/"));if(navigator.platform=="iPad"||navigator.platform=="iPhone"||navigator.platform=="iPod"){if(widescreenScroll instanceof iScroll){sHeight=d.eq(g).height()+100;e.css("height",sHeight+"px");widescreenScroll.refresh()}}else window.setTimeout(function(){e.animate({height:d.eq(g).height()+
100},{duration:400,queue:false})},1E3)};b.closeAllServices=function(){f("closeAllServices()")};b.reorderServices=function(a){f("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=$(e).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){f("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){f("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){f("new order item......");$("#mask_content").append(c[h])});d=$(e).find(".panel-box")},e=null,d=null,k=880,j=function(a){return a===0?"_":$(d[a]).find(".service").attr("id")}})();

