(function(){var c=getTemplateMode()!="mixed"?Flavors.Global.namespace("Flavors.TemplateGroup"):Flavors.Global.namespace("Flavors.TemplateGroupDefault"),f=Flavors.Logger.getLogger(c.__name__);c.init=function(){l();m()};var l=function(){for(var a in accounts)c.registerPanel(a)};c.registerPanel=function(a){f("register() serviceAnchor="+a);c.services[a]={initialized:false};c.services[a]=new Flavors.Panel(a)};var m=function(){$.address.strict(false);$.address.externalChange(function(a){f("$.address.externalChange()");
if(a.value=="contact")$("#userpage-layout-about-contact-link").trigger("click");else if(a.value!="/"){a=a.value.replace("/","-");f("serviceAnchor="+a);if(a.length>0)window.layout_name=="widescreen"?Flavors.Layout.switchToService(a,false):Flavors.Layout.switchToService(a);else if(window.layout_name=="split"||window.layout_name=="widescreen"||service_onload=="True"){var d=function(){$.browser.mozilla&&parseFloat($.browser.version)<2.1&&setTimeout(function(){var e=$("link[type=image/vnd.microsoft.icon]").remove().attr("href");
$('<link rel="icon" type="image/vnd.microsoft.icon" href="'+e+'" />').appendTo("head");f("Creating new link image/vnd.microsoft.icon, => "+e)},100)};window.layout_name=="accordion"?setTimeout(function(){$(".userpage-layout-navigation-title-link:first").click();d()},100):setTimeout(function(){$("#userpage-layout-navigation a:visible:first").click();d()},100)}}})},n=function(a){s=/grid-(\d+)/.exec($(a).find(".item:first").attr("class"));return{thumbRowCount:3,thumbsPerRow:s!=undefined&&s.length==2?
parseInt(s[1]):5}};c.preparePanel=function(a){f("preparePanel() serviceAnchor="+a);if(a in c.services){a=c.services[a];if(a.initialized)return a;var d=a.element,e=n(d),j=e.thumbRowCount*e.thumbsPerRow,i=$(d);if(i.is(".gallery")){var o="photos";if(i.closest(".compound-group").length>0)o=$(d).find(".subsection").attr("class").replace("subsection ","")}i.find(".service").each(function(){$(this).clusters(".compound").each(function(){$(this).parent().parent().hasClass("tumblr")&&$(this).find("script").remove();
$(this).wrapAll("<div class='compound-group' />")})}).end().find(".compound-group").each(function(){var b=[];$(this).find(".section").each(function(h){if(h==0)b=[];b.push({title:$(this).find(".panel-header h2").text(),token:$(this).find(".subsection").attr("class").replace("subsection ","")})});var g="<select class='compound-switcher'>";$.each(b,function(h,k){g+="<option value='"+k.token+"'"+(h==0?"selected":"")+">"+k.title+"</option>"});g+="</select>";$(this).prepend(g)}).find("select.compound-switcher").change(function(b){b.preventDefault();
b=$(this).val();f("navToSectionVal: "+b);var g=$(this).closest(".panel-global").find(".compound .subsection."+b).parent();b=$(this).closest(".compound-group").find(".section:visible");$(b).fadeOut(function(){$(g).fadeIn(function(){var h=$(g).closest(".panel-global").outerHeight();$("#mask_content").animate({height:h+50})})})});$(d).css({visibility:"hidden",display:"block"}).find(".panel-map-embed").each(function(){$(this).googleMap($(this).attr("rel"))}).end().find(".panel-custom-map-embed").each(function(){$(this).googleMapCustom()}).end().find("DIV.load-all-deferred").each(function(){$(this).deferredImageLoad({loadNow:1,
loadAll:true})}).end().find(".panel-custom-plain-body").each(function(){$(this).is(":visible")&&$(this).deferredImageLoad({loadNow:1,loadAll:true})}).end().find(".panel-custom-bio-photo, .panel-custom-bio-body, .panel-status-thumb").each(function(){$(this).is(":visible")&&$(this).parent().deferredImageLoad({loadNow:1,loadAll:true})}).end().find("DIV.scrollable-photo-gallery").each(function(){$(this).scrollableGallery(".scrollable-thumbs",e);$(this).photoViewer(".player-large");$(this).deferredImageLoad({batchSize:j,
loadNow:2})}).end().find("DIV.scrollable-video-gallery").each(function(){$(this).scrollableGallery(".scrollable-thumbs",e);$(this).deferredImageLoad({batchSize:j,loadNow:2})}).end().find("DIV.section.feed, DIV.section.blog").each(function(){$(this).deferredImageLoad({loadNow:1,loadAll:true});$(this).embedResize("default")}).end().find("DIV.section.audio, DIV.section.music-player").each(function(){$(this).find("DIV.progress-meter").remove();$(this).find("DIV.playback-status").remove();$(this).musicPlayer(".track")}).end().find("DIV.section.dynamic-music-player").each(function(){$(this).find("DIV.progress-meter").remove();
$(this).find("DIV.playback-status").remove();$(this).dynamicMusicPlayer(".track")}).end().find("DIV.section.foursquare").each(function(){$(this).find(".gallery-grid").deferredImageLoad({loadNow:1,loadAll:true})}).end().find("DIV.section.youtube, DIV.section.vimeo, DIV.section.facebook2, DIV.section.facebookpage").each(function(){if($(this).is(".youtube"))$(this).find(".scrollable-video-gallery").videoViewer(".player-large",{embedUrl:"http://www.youtube.com/v/{{{ID}}}?enablejsapi=1&amp;autoplay=0&amp;rel=0"});
else if($(this).is(".vimeo"))$(this).find(".scrollable-video-gallery").videoViewer(".player-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"});else if($(this).is(".facebook2")||$(this).is(".facebookpage"))$(this).find(".scrollable-video-gallery").videoViewer(".player-large",{embedUrl:"http://www.facebook.com/v/{{{ID}}}"});$(this).find(".thumbnails ul a").hover(function(){$(this).find(".title").show()},
function(){$(this).find(".title").hide()})}).end().find(".compound-group").each(function(){$(this).find(".section").each(function(b){b>0&&$(this).hide()})}).end().css({display:"none",visibility:"visible"});window.layout_name=="widescreen"&&$(d).css("display","block");if($(d).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(b){b&&b.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(b){b.preventDefault();$("#formspring-message").html("");$("#formspring-message").hide(0,function(){$("#formspring-form textarea").val("");$("#formspring-form").show()})})}a.initialized=true;return a}};c.services={}})();

