(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(c){g("$.address.externalChange()");if(c.value=="contact")$("#contact_link").trigger("click");else if(c.value!="/"){c=c.value.replace("/","-");g("serviceAnchor="+c);if(c.length>0)Flavors.Layout.switchToService(c);
else if(window.layout_name=="split"||service_onload=="True")window.layout_name=="accordion"?setTimeout(function(){$(".block_header a:first").trigger("click")},100):setTimeout(function(){$("#profile_navigation a:first").trigger("click")},100)}})};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,c){g("prepareSection() ... serviceAnchor="+c);s=/gallery-grid-(\d+)/.exec($(a).find(".gallery-grid").attr("class"));
var b={thumbRowCount:3,thumbsPerRow:s!=undefined&&s.length==2?parseInt(s[1]):5};if($(a).is(".gallery")){c="photos";if($(a).closest(".compound-group").length>0)c=$(a).find(".subsection").attr("class").replace("subsection ","");g("panelSection="+c);var d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").each(function(){$(this).scrollableGrid(".thumbnails",b);$(this).photoViewer(".images-large");$(this).deferredImageLoad({batchSize:d,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")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",b).deferredImageLoad({batchSize:d,loadNow:2})}if($(a).is(".vimeo")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",b).deferredImageLoad({batchSize:d,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")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",b).deferredImageLoad({batchSize:d,loadNow:2})}if($(a).is(".goodreads")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",
b).deferredImageLoad({batchSize:d,loadNow:2})}$(a).is(".foursquare")&&$(a).find(".gallery-grid").deferredImageLoad({loadNow:1,loadAll:true});if($(a).is(".netflix")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",b).deferredImageLoad({batchSize:d,loadNow:2})}if($(a).is(".youtube")){d=b.thumbRowCount*b.thumbsPerRow;$(a).find(".gallery").scrollableGrid(".thumbnails",b).deferredImageLoad({batchSize:d,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()})}if($(a).is(".formspring")){$("#formspring-submit").css({"text-decoration":"none"}).hover(function(){$(this).css("background-color",primary_font_color_holder)},function(){$(this).css("background-color",link_font_color_holder)});$("#formspring-form").ajaxForm({url:get_formspring_url(),dataType:"json",success:function(f){f&&f.success?$("#formspring-message").html('Your question has been sent. <a id="formspring-close" href="#">Ask another.</a>'):
$("#formspring-message").html('An error occured sending your question. <a id="formspring-close" href="#">Try again.</a>')},beforeSubmit:function(){if($.trim($("#formspring-form textarea").val())==""){$("#formspring-message").html("Please enter a question.");$("#formspring-message").show();return false}$("#formspring-form").fadeOut(100,function(){$("#formspring-message").html("Sending your question to Formspring...");$("#formspring-message").show()})}});$("#formspring-close").live("click",function(f){f.preventDefault();
$("#formspring-message").html("");$("#formspring-message").hide(0,function(){$("#formspring-form textarea").val("");$("#formspring-form").show()})})}};e.preparePanel=function(a){g("preparePanel() serviceAnchor="+a);if(a in e.services){var c=e.services[a];if(c.initialized)return c;$(c.element).find(".google-map").each(function(){$(this).googleMap($(this).attr("rel"))}).end();$(c.element).find(".service").each(function(){$(this).clusters(".compound").each(function(){$(this).wrapAll("<div class='compound-group' />")})}).end().find(".compound-group").each(function(){var b=
[];$(this).find(".section").each(function(f){if(f==0)b=[];b.push({title:$(this).find(".header h2").text(),token:$(this).find(".subsection").attr("class").replace("subsection ","")})});var d="<select class='compound-switcher'>";$.each(b,function(f,h){d+="<option value='"+h.token+"'"+(f==0?"selected":"")+">"+h.title+"</option>"});d+="</select>";$(this).prepend(d)}).find("select.compound-switcher").change(function(){var b=$(this).val();g("navToSectionVal: "+b);var d=$(this).closest(".panel-box").find(".compound .subsection."+
b).parent();b=$(this).closest(".compound-group").find(".section:visible");$(b).fadeOut(function(){$(d).fadeIn(function(){var f=$(d).closest(".panel-box").outerHeight();$("#mask_content").animate({height:f+50})})})});$(c.element).css({visibility:"hidden",display:"block"}).find(".section").each(function(){g("preparing section! ... ");e.prepareSection(this,c.serviceAnchor)}).end().find(".compound-group").each(function(){$(this).find(".section").each(function(b){b>0&&$(this).hide()})}).end().css({display:"none",
visibility:"visible"});c.initialized=true;return c}}})();

