(function(){var e=getTemplateMode()!="mixed"?Flavors.Global.namespace("Flavors.TemplateGroup"):Flavors.Global.namespace("Flavors.TemplateGroupDefault"),g=Flavors.Logger.getLogger(e.__name__);e.init=function(){for(var a in accounts)e.registerPanel(a);$.address.strict(false);$.address.externalChange(function(b){g("$.address.externalChange()");if(b.value!="/"){b=b.value.replace("/","-");g("serviceAnchor="+b);b.length>0&&Flavors.Layout.switchToService(b)}})};e.services={};e.registerPanel=function(a){g("register() serviceAnchor="+
a);e.services[a]={initialized:false};e.services[a]=new Flavors.Panel(a)};e.prepareSection=function(a,b){g("prepareSection() ... serviceAnchor="+b);b={thumbsPerRow:5,thumbRowCount:3};"photoGallery"in Flavors.LayoutSettings[window.layout_name]&&$.extend(b,Flavors.LayoutSettings[window.layout_name].photoGallery);var d={thumbsPerRow:5,thumbRowCount:3};"chunkyGallery"in Flavors.LayoutSettings[window.layout_name]&&$.extend(d,Flavors.LayoutSettings[window.layout_name].chunkyGallery);if($(a).is(".gallery")){var f=
"photos";if($(a).closest(".compound-group").length>0)f=$(a).find(".subsection").attr("class").replace("subsection ","");g("panelSection="+f);var c=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").each(function(){$(this).scrollableGrid(".thumbnails",{rowHeight:93});$(this).photoViewer(".images-large");$(this).deferredImageLoad({batchSize:c,loadNow:2})})}$(a).is(".etsy")&&$(a).deferredImageLoad({loadNow:1,loadAll:true});if($(a).is(".feed")){$(a).deferredImageLoad({loadNow:1,loadAll:true});$(a).embedResize("default")}if($(a).is(".lastfm")){c=
d.thumbRowCount*d.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",{rowHeight:140}).deferredImageLoad({batchSize:c,loadNow:2})}if($(a).is(".vimeo")){c=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",{rowHeight:93}).deferredImageLoad({batchSize:c,loadNow:2});$(a).find(".gallery").videoViewer(".clips-large",{embedUrl:"http://vimeo.com/moogaloop.swf?clip_id={{{ID}}}&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1"})}if($(a).is(".tumblr-posts")){$(a).deferredImageLoad({loadNow:1,
loadAll:true});$(a).embedResize("default")}$(a).is(".tumblr-music")&&$(a).find(".playlist").musicPlayer(".track");if($(a).is(".soundcloud .tracks")||$(a).is(".soundcloud .sets")||$(a).is(".soundcloud .favorites"))$(a).musicPlayer(".track");if($(a).is(".soundcloud")){c=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",{rowHeight:140}).deferredImageLoad({batchSize:c,loadNow:2})}if($(a).is(".goodreads")){c=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",
{rowHeight:132}).deferredImageLoad({batchSize:c,loadNow:2})}$(a).is(".foursquare")&&$(a).find(".gallery-grid").deferredImageLoad({loadNow:1,loadAll:true});if($(a).is(".netflix")){c=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",{rowHeight:132}).deferredImageLoad({batchSize:c,loadNow:2});$(a).find(".thumbnails ul li a").hover(function(){$(this).find(".review").show()},function(){$(this).find(".review").hide()})}if($(a).is(".youtube")){c=b.thumbRowCount*b.thumbsPerRow;
$(a).find(".gallery").scrollableGrid(".thumbnails",{rowHeight:91}).deferredImageLoad({batchSize:c,loadNow:2});$(a).find(".gallery").videoViewer(".clips-large",{embedUrl:"{{{ID}}}"});$(a).find(".thumbnails ul a").hover(function(){$(this).find(".title").show()},function(){$(this).find(".title").hide()})}};e.preparePanel=function(a){g("preparePanel() serviceAnchor="+a);if(a in e.services){var b=e.services[a];if(b.initialized)return b;$(b.element).find(".google-map").each(function(){$(this).googleMap($(this).attr("rel"))}).end();
$(b.element).find(".service").each(function(){$(this).clusters(".compound").each(function(){$(this).wrapAll("<div class='compound-group' />")})}).end().find(".compound-group").each(function(){var d=[];$(this).find(".section").each(function(c){if(c==0)d=[];d.push({title:$(this).find(".header h2").text(),token:$(this).find(".subsection").attr("class").replace("subsection ","")})});var f="<select class='compound-switcher'>";$.each(d,function(c,h){f+="<option value='"+h.token+"'"+(c==0?"selected":"")+
">"+h.title+"</option>"});f+="</select>";$(this).prepend(f)}).find("select.compound-switcher").change(function(){var d=$(this).val();g("navToSectionVal: "+d);var f=$(this).closest(".panel-box").find(".compound .subsection."+d).parent();d=$(this).closest(".compound-group").find(".section:visible");$(d).fadeOut(function(){$(f).fadeIn(function(){var c=$(f).closest(".panel-box").outerHeight();$("#mask_content").animate({height:c+50})})})});$(b.element).css({visibility:"hidden",display:"block"}).find(".section").each(function(){g("preparing section! ... ");
e.prepareSection(this,b.serviceAnchor)}).end().find(".compound-group").each(function(){$(this).find(".section").each(function(d){d>0&&$(this).hide()})}).end().css({display:"none",visibility:"visible"});b.initialized=true;return b}}})();

