(function(){var c=getTemplateMode()!="mixed"?Flavors.Global.namespace("Flavors.TemplateGroup"):Flavors.Global.namespace("Flavors.TemplateGroupMedium"),f=Flavors.Logger.getLogger(c.__name__);c.init=function(){g()};var g=function(){for(var a in accounts)if($("#userpage-layout-service-"+a).hasClass("panel-square")){c.registerPanel(a);c.preparePanel(a)}};c.registerPanel=function(a){f("medium register() serviceAnchor="+a);c.services[a]={initialized:false};c.services[a]=new Flavors.Panel(a)};c.preparePanel=
function(a){f("preparePanel() serviceAnchor="+a);if(a in c.services){var d=c.services[a];if(d.initialized)return d;var e=d.element;$(e).sectionSwitcher();$(e).find("DIV.section.audio, DIV.section.music-player").each(function(){$(this).is(":visible")&&$(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.panel-audio-set").each(function(){$(this).is(":visible")&&$(this).slidePanel()}).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").each(function(){$(this).is(":visible")&&$(this).parent().deferredImageLoad({loadNow:1,loadAll:true})}).end().find("DIV.section.gallery").each(function(){var b=$(this).find(".items .item:first .img-pending").length;
if(b==0)b=$(this).find(".items .item:first img").length;f("minPageSize for service "+a+": "+b);if($(this).is(":visible")){$(this).deferredImageLoad({batchSize:b,loadNow:3});$(this).slidePanel()}else $(this).deferredImageLoad({batchSize:b})}).end().find("DIV.section.status, DIV.section.links").each(function(){$(this).is(":visible")&&$(this).slidePanel()}).end().find("DIV.section.video").each(function(){$(this).is(":visible")&&$(this).clickToEmbed()}).end().find("DIV.section.blog").each(function(){if($(this).is(":visible")){$(this).slidePanel();
$(this).deferredImageLoad({batchSize:3,loadNow:1});var b=$(this).find(".items .item:first object").length;$(this).deferredEmbedLoad({batchSize:1,loadNow:b,embedSize:"medium"})}else{$(this).deferredImageLoad({batchSize:3});$(this).deferredEmbedLoad({batchSize:1,embedSize:"medium"})}$(this).embedResize("medium")}).end().find(".panel-map-embed").each(function(){$(this).googleMap($(this).attr("rel"))}).end().find(".panel-custom-map-embed").each(function(){$(this).googleMapCustom()}).end();$(e).find("DIV.section:first").find("DIV.mask:first").createScrollPane();
if($(e).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()})})}d.initialized=true;return d}};c.services={}})();

