window.name="_topfans";var tf={config:{user:{}},stop_event:function(a){a.preventDefault();a.stopPropagation()},anchor:function(b){location.hash=b},get_action:function(d){var b=$(d.target).attr("class");var g=(b.indexOf(" ")==-1)?[b]:b.split(" ");var f=g.length;var c=false;for(var a=0;a<f;a++){if(g[a].indexOf("action__")>-1&&g[a].indexOf("fixitaction__")==-1){c=g[a].split("__")[1];break}}return c},prompt:function(e){var c="";switch(e.type){case"error":case"notice":c="_"+e.type;break}var f=e.header||e.type||"";var d=e.content||"Oops! no content";var b=e.where||"bottom";tf.close_prompt();var a='<div id="prompt" class="prompt'+c+'" style="display:none;"><h2>'+d+'</h2><div></div><span class="button_cancel"><span class="offset_text">[x]</span></span></div>';if(b=="top"){e.parent.prepend(a)}if(b=="bottom"){e.parent.append(a)}e.parent.children("#prompt").fadeIn("fast");tf.prompt_handler.init(e);return},close_prompt:function(){tf.prompt_handler.reset();$("#prompt").fadeOut("fast",function(){$(this).remove()})},prompt_handler:{timer:false,wait:7000,reset:function(){$("#prompt").unbind()},init:function(a){clearTimeout(tf.prompt_handler.timer);if(a.type!=="error"){tf.prompt_handler.timer=setTimeout(tf.close_prompt,tf.prompt_handler.wait);$("#prompt").bind("mouseover",function(){clearTimeout(tf.prompt_handler.timer)});$("#prompt").bind("mouseout",function(){tf.prompt_handler.timer=setTimeout(tf.close_prompt,tf.prompt_handler.wait)})}setTimeout(function(){$("#prompt").bind("click",tf.close_prompt)},500)}},prompt_reg_or_login:function(b){tf.stop_event(b);var a=$(b.target);var c={};c.where="bottom";c.parent=a.parent();if(a.parents("div#star_feed").length){c.where="top";c.parent=a.parents("li.post")}c.header="Action Required";c.content='You need to <a href="#top" class="action__show_reg">Sign up</a> or <a href="#top" class="action__show_login">Log In</a> to do that :)';tf.prompt(c);return},set_loading:function(a){a.each(function(){$(this).html('<div class="loading">Loading...<div>')})},clear_loading:function(a){a.each(function(){$(this).children("div.loading").remove()})},auto_clear_strings:{},make_auto_clearing:function(b){if(!$(b)){return}var c=$("#"+b);var a=$(c).attr("value");tf.auto_clear_strings[b]=a;$(c).focus(function(){if($(this).attr("value")==tf.auto_clear_strings[$(this).attr("id")]){$(this).attr("value","")}});$(c).blur(function(){if($(this).attr("value")===""){$(this).attr("value",tf.auto_clear_strings[$(this).attr("id")])}});c=a=null},cookie:{set:function(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"},get:function(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null},remove:function(a){createCookie(a,"",-1)}},ajax:{options:{star_test:{ajax:true,params:{},url:"/posts.js",action:"POST",wait:2000},post:{ajax:true,params:{},url:"/posts.js?preview=true",action:"POST",wait:2000,onsuccess:function(a){if(!a.message||!a.message.error){$("#title_input").val(a.title);$("#body_input").val(a.body);$("#url_input").val(a.url);if(a.media){$("#embed_here").html(a.media);$("#embed_here").show()}if(a.image_urls){$("#thumb_preview").html('<img src="'+a.image_urls[0]+'" width="80px" />');$("#post_image_url").val(a.image_urls[0]);$("#total_thumbs").html(a.image_urls.length);tf.post_preview.thumbnails=a.image_urls;tf.post_preview.total=a.image_urls.length;if(a.image_urls.length>1){$("#thumb_swap").show()}}$("#preview_container").slideDown("slow");$("#post_form").slideUp("slow")}else{$("#post_form form p.val_error").html(a.message.error);$("#post_body").css("border-color","red")}},onerror:function(a){if(!a.message){$("#post_form form p.val_error").html("There was an unexpected error...");$("#post_body").css("border-color","red")}else{$("#post_form form p.val_error").html(a.message.error);$("#post_body").css("border-color","red")}}},vote:{ajax:true,params:{},url:"/votes.js",action:"POST",wait:2000},reply:{ajax:true,params:{},url:"/posts.js",action:"POST",wait:2000},flag:{ajax:true,params:{},url:"/flags.js",action:"POST",wait:2000},update_fb_user:{ajax:true,params:{},url:"/users/",action:"POST",wait:2000},facebook_post_to_feed:{ajax:true,params:{},url:"/facebook/fan",action:"POST",wait:2000}},better:function(a){if(a.ajax===true){tf.ajax.better_ajax(a)}else{tf.ajax.better_load(a)}},better_ajax:function(a){$.ajax({data:(!a.params)?"":a.params,dataType:(!a.data_type)?"json":a.data_type,error:function(b,c){if(!a.attempt){a.attempt=0}if(!a.maxtries){a.maxtries=3}if(a.attempt==a.maxtries){if(typeof a.onerror=="function"){a.onerror(a)}return}else{a.attempt++;setTimeout(function(){tf.ajax.better_ajax(a)},(a.wait*a.attempt));return}},success:function(b,c){if(typeof a.onsuccess=="function"){a.onsuccess(b)}},type:a.action,url:a.url})},better_load:function(a){$(a.element).load(a.url,function(c,d,b){if(d=="error"){if(a.attempt==a.maxtries){if(typeof a.onerror=="function"){a.onerror(a)}return}else{a.attempt++;setTimeout(function(){tf.ajax.better_load(a)},(a.wait*a.attempt));return}}else{if(typeof a.onsuccess=="function"){a.onsuccess()}}})}},val:{options:{register:{bind:"blur",element:"#registration_form",error_placement:function(a){$("#register p.val_error").empty().html(a)},rules:{"user[email]":{email:{is:true,message:"Please enter a valid email address."},required:{is:true,message:"To find & follow your favorite stars..."}},"user[login]":{required:{is:true,message:"Please enter a valid user name."}},"user[password]":{min_length:{is:6,message:"Please enter a password of 6 or more characters."},required:{is:true,message:"Password is a required field."}}}},login:{bind:"blur",element:"#login_form",error_placement:function(a){$("#login p.val_error").empty().html(a)},rules:{email:{email:{is:true,message:"Please enter a valid email address."},required:{is:true,message:"Not so fast! We need your email address!"}},password:{min_length:{is:4,message:"Please enter your full password (6 or more characters)."},required:{is:true,message:"Password is a required field."}}}},star_post:{bind:"blur",default_message:"Not so fast! Your post is required to be at least 40 chars.",element:"#star_post_form",error_placement:function(a){},rules:{"post[body]":{min_length:{is:1},required:{is:true}}},submit_handler:function(a){var b=$("form#star_post_form").serialize();tf.ajax.options.post.params=b;tf.ajax.better(tf.ajax.options.post);$("#post_form form p.val_error").html("Parsing your post, please wait...")}},hijack_post:{bind:"blur",default_message:"Not so fast! Your post is required to be at least 40 chars.",element:"#hijack_post_form",error_placement:function(a){},rules:{"post[body]":{min_length:{is:1},required:{is:true}}},submit_handler:function(a){$("#post_form form p.val_error").html("Sorry, you must be logged in to do that...")}}},validate:function(a){var b;if(typeof a=="string"){b=tf.val.options[a]}else{if(typeof a=="object"){b=a}else{return}}if(!b.element){return}if(!b.bind){b.bind="blur"}if(!b.error_placement){b.error_placement=function(c){alert(c)}}b.fouls={};b.fouls.length=0;$.each(b.rules,function(e,d){var c=$(b.element+" [name="+e+"]").attr("id");$(b.element+" #"+c).bind(b.bind,function(){tf.val.validation(b,e,d,c)})});$(b.element).bind("submit",function(c){if(b.fouls){b.fouls.length=0}else{b.fouls={};b.fouls.length=0}$.each(b.rules,function(g,f){var e=$(b.element+" [name="+g+"]").attr("id");tf.val.validation(b,g,f,e)});if(b.fouls.length>0){tf.stop_event(c);return}else{var d=typeof b.submit_handler;if(d=="function"){tf.stop_event(c);b.submit_handler(b.element)}}})},validation:function(e,d,b,j){var i=$(e.element+" #"+j).val();if(b.required&&b.required.is===true){if(i.length===0){tf.val.notifier(e,d,b,b.required.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls[j]=true;e.fouls.length++;return}}if(b.min_length){if(i.length<b.min_length.is){tf.val.notifier(e,d,b,b.min_length.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.max_length){if(i.length>b.max_length.is){tf.val.notifier(e,d,b,b.max_length.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.email&&b.email.is===true){var c=/[a-z0-9._%+-]+@(?:[a-z0-9-]+\.)+[a-z]{2,6}/i;var k=c.test(i);if(k===false){tf.val.notifier(e,d,b,b.email.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.url&&b.url.is===true){var g=/^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i;var h=g.test(i);if(h===false){tf.val.notifier(e,d,b,b.url.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.credit_card&&b.credit_card.is===true){var f=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$./;var a=f.test(i);if(a===false){tf.val.notifier(e,d,b,b.url.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.same_as){if(i==$(b.same_as.element).val()){tf.val.notifier(e,d,b,b.same_as.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}}if(b.remote){$.post(b.remote.is,{id:i},function(l){if(l=="false"){tf.val.notifier(e,d,b,b.remote.message,e.default_message);$(e.element+" #"+j).addClass("error");e.fouls.length++;return}})}$(e.element+" #"+j).removeClass("error");e.error_placement("")},notifier:function(d,e,b,a,c){var f;if(a){f=(a)}else{if(c){f=c}else{f=tf.val.default_errors[e](e,b)}}d.error_placement(f)},default_errors:{required:function(b,a){return b+" is required."},email:function(b,a){return b+" doesn&rsquo;t appear to be a valid email address."},same_as:function(b,a){return b+" is not the same as "+$(a.same_as.element).attr("name")},min_length:function(b,a){return b+" has less than "+a.min_length.is+" chars."},max_length:function(b,a){return b+" has more than "+a.max_length.is+" chars."},remote:function(b,a){return b+" returns false."},credit_card:function(b,a){return b+" doesn&rsquo;t appear to be a valid credit card number."},url:function(b,a){return b+" doesn&rsquo;t appear to be a valid URL."}}},modals:{test:{width:700,partial:"common/modal_test",button:"close_this_modal"},connect:{width:600,partial:"/common/connect_account",button:"close_this_modal",load_handler:function(){$("#sample_text").empty().html($("#hidden_sample_text").val());setTimeout(FB.XFBML.Host.parseDomTree,500)}},thanks_for_registering:{width:700,partial:"/common/thanks_for_registering",button:"close_this_modal"}},close_modal:function(){$("#active_modal").fadeOut("fast").remove();$("#modal_bg").fadeOut("fast");$(window).unbind("resize")},open_modal:function(a){$("#clone_modal").clone().attr({id:"active_modal"}).css({width:a.width,left:(($(document).width()-a.width)/2),top:$(window).scrollTop()+50}).appendTo("#clones");$("#active_modal").load(a.partial);$("#modal_bg").css({height:$(document).height(),width:$(document).width()}).fadeIn("fast",function(){$("#active_modal").fadeIn("fast")});if(a.load_handler){a.load_handler()}$(window).bind("resize",function(){$("#active_modal").css({left:(($(document).width()-a.width)/2),top:$(window).scrollTop()+50});$("#modal_bg").css({height:$(document).height(),width:$(document).width()})});setTimeout("$('#"+a.button+"').bind('click', function(){$(this).unbind('click');tf.close_modal();});",500)},facebook_connect:{prompt_permissions:function(){var a="offline_access";FB.Facebook.apiClient.users_hasAppPermission(a,function(b){var c=($("#fb_string_key").length>0)?tf.facebook_connect.publish_to_feed:tf.facebook_connect.publish_post_to_feed;if(b==0){FB.Connect.showPermissionDialog(a,c)}else{c.call()}})},publish_to_feed:function(){var b=FB.Connect.get_loggedInUser();var c=FB.Facebook.get_sessionState();var d=c.result.session_key;var a={fb_session_key:d,facebook_id:b,page_id:tf.config.PAGE_ID,string_key:$("#fb_string_key").val()};$.post("/facebook/fan",a,function(e){tf.close_modal();$("#share_third").fadeOut("slow")})},publish_post_to_feed:function(){var b=FB.Connect.get_loggedInUser();var c=FB.Facebook.get_sessionState();var d=c.result.session_key;var a={fb_session_key:d,facebook_id:b,post_id:$("#fb_post_id").val()};$.post("/facebook/post",a,function(e){tf.close_modal();$("#share_twothirds").fadeOut("slow")})}},tracker_map:{TRACK_SEARCH:["/search","/search"],TRACK_FLAG:["/error/flag","/auth/flag"],TRACK_FLAG_SUBMIT:[null,"/auth/flag/submit"],TRACK_FOLLOW:["/error/follow","/auth/follow"],TRACK_UNFOLLOW:[null,"/auth/unfollow"],TRACK_BADGE_HANDRAISE:[null,"/auth/badge/handraise"],TRACK_LOGIN:["/login","/login"],TRACK_POST:["/error/post","/auth/post"],TRACK_POST_SUBMIT:[null,"/auth/post/submit"],TRACK_REGISTER:["/register","/register"],TRACK_REPLY:["/error/reply","/auth/reply"],TRACK_REPLY_SUBMIT:[null,"/auth/reply/submit"],TRACK_TAB_NEWEST:["/tab/newest","/tab/newest"],TRACK_TAB_DIRECT:["/tab/direct","/tab/direct"],TRACK_VOTE:["/error/vote","/auth/vote"],ERROR:"ERROR"},ga:{initialized:false,GA_ACCT:false,GA_PAGE:false,track_page_view:function(g,d){if(!tf.ga){return}var b="";var e=tf.tracker_map.ERROR;var c="Search for any star...";var a=((typeof d!=="undefined")&&(d!==c))?d:"";if(tf.tracker_map[g]){var f=tf.config.logged_in;e=tf.tracker_map[g][f]}if(e!==""||a!==""){if(e=="ERROR"){e=""}b=e+a;tf.ga.trackIt(b)}},track_event:function(b,a){tf.ga.track_page_view(b,a)},trackIt:function(a){if(tf.ga.pageTracker==false){setTimeout(function(){tf.ga.trackIt(a)},2000);return}tf.ga.pageTracker._trackPageview(a)},init:function(){if(!tf.ga.initialized){setTimeout(tf.ga.init,1000)}tf.ga.pageTracker=_gat._getTracker(tf.ga.GA_ACCT);tf.ga.pageTracker._initData();tf.ga.trackIt(tf.ga.GA_PAGE)}},home_switch_category:function(b){tf.stop_event(b);$("div.category_nav ul li a").removeClass("on");$(b.currentTarget).addClass("on").blur();var a=$(b.currentTarget).attr("href").split("#")[1];$("div.category_list").hide();$("div#"+a).show();tf.cookie.set("home_current_category",a,1)},home_init:function(){$("div.category_nav ul li a").bind("click",tf.home_switch_category);var a=tf.cookie.get("home_current_category");if(a){$("div.category_nav ul li a[href=#"+a+"]").click()}setTimeout(function(){$("#collector").slideDown("slow")},1000)},delay_update:{queue:{},go:function(c){var b=$("#"+c.mod);var a=this;if(this.queue[c.mod]){clearTimeout(this.queue[c.mod])}this.queue[c.mod]=setTimeout(function(){tf.ajax.better_load({element:b,url:c.url,attempt:0,maxtries:5,wait:2000,onsuccess:function(){delete a.queue[c.mod]}})},c.wait)}},votes:{handle_submit:function(f){$(f.target).children("div").children("p").children("input.btn_vote").addClass("btn_vote_loading").removeClass("btn_vote");tf.prompt({parent:$(f.target).parents("li"),where:"top",type:"notice",header:"yay",content:"one vote cast!"});var a=$(f.target).children("div.vote_total").children("p.feed_votes_total");var d=$(f.target).children("div.vote_total").children("p.feed_votes_noun");var c=parseInt(a.html())+1;var b=c==1?"vote":"votes";$(a).html(c);$(d).html(b);tf.ajax.options.vote.params=$(f.target).serialize();tf.ajax.options.vote.onsuccess=function(g){var e=$(f.target).parents("li.post");$("#star_feed .btn_vote_loading").parents("div.feed_votes_area").attr("class","feed_votes_area_voted");$("#star_feed .btn_vote_loading").parents("div.vote_control").empty();tf.update_header(e,g.post_id);tf.update_topfans()};tf.ajax.better(tf.ajax.options.vote)},init:function(){$(".vote_up").unbind("submit");$(".hijack_vote").unbind("submit");$(".hijack_vote").bind("submit",function(a){tf.stop_event(a);tf.ga.track_event("TRACK_VOTE");tf.prompt_reg_or_login(a)});$(".vote_up").bind("submit",function(a){tf.stop_event(a);tf.ga.track_event("TRACK_VOTE");tf.votes.handle_submit(a)})}},update_topfans:function(){tf.delay_update.go({mod:"top_fans_section",url:"/pages/"+tf.config.PAGE_SLUG+"/fans",wait:2000});return},update_share:function(b,a){var c=$(b).children("div.feed_options").children("div.share_box");var d=$(b).children("div.feed_post_area").children("h2");tf.ajax.better_load({element:$(c),url:"/pages/"+tf.config.PAGE_SLUG+"/share?post_id="+a,attempt:0,maxtries:5,wait:2000});return},update_header:function(b,a){var d=$(b).children("div.feed_post_area").children("h2");if(d.children("a")){var c=$(d).text();d.empty().append('<a target="_blank" href="/posts/'+a+'">'+c+"</a>")}return},replies:{current_item:false,current_response:false,handle_submit:function(a){tf.replies.current_response=$(a.target).children("ul").children("li").children("textarea").val();tf.replies.current_item=$(a.target);tf.ajax.options.reply.params=$(a.target).serialize();tf.ajax.options.reply.onsuccess=tf.replies.handle_response;tf.ajax.options.reply.onerror=tf.replies.handle_error;tf.ajax.better(tf.ajax.options.reply)},handle_response:function(a){if(a.error){tf.replies.handle_error(a)}else{tf.replies.handle_success(a)}},handle_success:function(d){tf.prompt({type:"notice",content:d.notice,parent:tf.replies.current_item});var c=$(tf.replies.current_item).parents("li.post");var a=c.children("div.post_children");var b=d.context.split("__")[1].split("_")[0];tf.set_loading($(a));tf.ajax.better_load({element:$(a),url:"/pages/"+tf.config.PAGE_SLUG+"/replies?post_id="+b,attempt:0,maxtries:5,wait:2000});tf.update_topfans();tf.update_share(c,b);tf.update_header(c,b);$(tf.replies.current_item).parents("div.reply_container").slideUp("fast")},handle_error:function(a){tf.prompt({type:"error",content:a.error,parent:tf.replies.current_item})},init:function(){$(".reply_form").bind("submit",function(a){tf.stop_event(a);tf.ga.track_event("TRACK_REPLY_SUBMIT");tf.replies.handle_submit(a)})}},flags:{current_item:false,handle_submit:function(a){tf.flags.current_item=$(a.target);tf.ajax.options.flag.params=$(a.target).serialize();tf.ajax.options.flag.onsuccess=tf.flags.handle_success;tf.ajax.better(tf.ajax.options.flag)},handle_success:function(a){tf.prompt({type:"notice",content:a.message.notice,parent:tf.flags.current_item.parents("li.post"),where:"top"});setTimeout(function(){tf.flags.current_item.parents("li.post").fadeOut("fast",function(){$(this).remove()});tf.update_topfans()},2000)},init:function(){$(".flag_form").bind("submit",function(a){tf.stop_event(a);tf.ga.track_event("TRACK_FLAG_SUBMIT");tf.flags.handle_submit(a)})}},posts:{init:function(){$("#btn_post_prompt").click(function(a){tf.stop_event(a);tf.ga.track_event("TRACK_POST");$("#post_form").slideDown("slow",function(){$("#post_teaser").slideUp("slow")})});$("#post_form .close_star_post").click(function(a){tf.stop_event(a);$("#post_form").slideUp("slow",function(){$("#post_teaser").slideDown("slow")})});$("#preview_container .close_star_post").click(function(a){tf.stop_event(a);$("#preview_container").slideUp("slow",function(){$("#post_teaser").slideDown("slow")})});$(".next_thumb").click(function(){if(tf.post_preview.current==tf.post_preview.total){tf.post_preview.current=1}else{tf.post_preview.current++}$("span#current_thumbs").empty().html(tf.post_preview.current);$("#post_image_url").val(tf.post_preview.thumbnails[tf.post_preview.current-1]);$("#thumb_preview").empty().html('<img src="'+tf.post_preview.thumbnails[tf.post_preview.current-1]+'" width="80px" height="80px" />')});$(".previous_thumb").click(function(){if(tf.post_preview.current==1){tf.post_preview.current=tf.post_preview.total}else{tf.post_preview.current--}$("span#current_thumbs").empty().html(tf.post_preview.current);$("#post_image_url").val(tf.post_preview.thumbnails[tf.post_preview.current-1]);$("#thumb_preview").empty().html('<img src="'+tf.post_preview.thumbnails[tf.post_preview.current-1]+'" width="80px" height="80px" />')})}},become_a_fan:{init:function(){$("#save_this_form").bind("submit",function(b){var a;if($(this).attr("action")=="/fan_pages"){a="TRACK_FOLLOW"}else{a="TRACK_UNFOLLOW"}tf.ga.track_event(a);if(!tf.config.logged_in){tf.stop_event(b);tf.prompt_reg_or_login(b)}})}},star_feed_actions:{show_or_hide_form:function(d,b){if(!tf.config.logged_in){tf.prompt_reg_or_login(d);return}var c=$(d.target).parents("li.post");var a=$(c).children("div."+b+"_container");$("#star_feed li.post").each(function(){if($(this)!==c){$(this).removeClass("hilite")}});$("#star_feed div.reply_container, #star_feed div.flag_container").each(function(){if(!$(this).parents(c)||$(this).attr("class").indexOf(b)==-1){$(this).hide()}});$(c).toggleClass("hilite");$(a).slideToggle("fast",function(){var e=($(c).children("div.flag_container").css("display")=="block")?true:false;var f=($(c).children("div.reply_container").css("display")=="block")?true:false;if(!e&&!f){$(c).removeClass("hilite")}})},init:function(b){var a=tf.get_action(b);if(a){switch(a){case"reply":tf.stop_event(b);track="TRACK_REPLY";tf.ga.track_event(track);tf.star_feed_actions.show_or_hide_form(b,a);break}}}},post_preview:{current:1,total:1,thumbnails:{}},stars_init:function(){tf.flags.init();tf.votes.init();tf.replies.init();tf.posts.init();tf.become_a_fan.init();$("#star_feed").bind("click",function(a){tf.star_feed_actions.init(a)});$(".connect_account").click(function(a){tf.stop_event(a);tf.open_modal(tf.modals.connect)});$(".tweet_follow").click(function(){$.post("/tweet/follow",function(a){if(a=="It worked!"){$("#share_third").fadeOut("slow")}})});$(".tweet_first").click(function(){$.post("/tweet/first_fan",function(a){if(a=="It worked!"){$("#share_third").fadeOut("slow")}})});$(".tweet_top").click(function(){$.post("/tweet/top_fan",function(a){if(a=="It worked!"){$("#share_third").fadeOut("slow")}})});$(".tweet_post").click(function(){$.post("/tweet/post",{post_id:$("#hidden_post_id").val()},function(a){if(a=="It worked!"){$("#share_twothirds").fadeOut("slow")}})})},search_results_init:function(){$(".star_create_form input").each(function(){$(this).addClass("offleft")});$(".star_create_form a, .star_create_form label").one("click",function(a){$(this).parents("form").removeClass("star_create_form");tf.stop_event(a);$(this).parents("form").submit()})},users_init:function(){$("#users_points_table form").bind("submit",function(a){tf.ga.track_event("TRACK_UNFOLLOW")})},cab:{}};(function(){autoComplete();var c,b,g=["/images/layout/grey_spinny.gif"],a=g.length;for(c=0;c<a;c++){b=new Image();b.src=g[c];b=null}tf.make_auto_clearing("header_searchterm");$("form#header_search").bind("submit",function(i){var h=$("#header_searchterm").attr("value");tf.ga.track_event("TRACK_SEARCH","/"+h);h=null});tf.val.validate(tf.val.options.register);tf.val.validate("login");tf.val.validate("hijack_post");tf.val.validate("star_post");var d=$("body").attr("id")+"_init";try{tf[d]()}catch(f){}$("#select_all").click(function(){$(".select_me").each(function(){$(this).attr("checked","checked")})});$("#select_none").click(function(){$(".select_me").each(function(){$(this).removeAttr("checked")})});$("body").bind("click",function(i){var h=tf.get_action(i);if(h){switch(h){case"new_badges_inquiry":tf.stop_event(i);tf.ga.track_event("TRACK_BADGE_HANDRAISE");tf.prompt({parent:$("#badges_notify_box"),header:"Thanks",content:"Thanks, we'll notify you when new badges are available for the stars you follow."});break;case"show_reg":tf.stop_event(i);tf.ga.track_event("TRACK_REGISTER");tf.anchor("top");(function(){$("#login").slideUp("fast");$("#forgot_password").slideUp("fast");$("#register").slideToggle("fast");$("#user_login").focus()})();break;case"show_login":tf.stop_event(i);tf.ga.track_event("TRACK_LOGIN");tf.anchor("top");(function(){$("#register").slideUp("fast");$("#forgot_password").slideUp("fast");$("#login").slideToggle("fast");$("#email").focus()})();break;case"show_password":tf.stop_event(i);tf.anchor("top");(function(){$("#register").slideUp("fast");$("#login").slideUp("fast");$("#forgot_password").slideToggle("fast");$("#forgot_password_email").focus()})();break;case"prompt_reg_or_login":tf.stop_event(i);tf.prompt_reg_or_login(i);break;case"prompt_close":tf.stop_event(i);$("#prompt").fadeOut("fast",function(){tf.prompt_close()});break;case"feedback":tf.stop_event(i);(function(){$("#feedback_form").slideToggle("fast",function(){tf.anchor("feedback")})});break}}})})();$(window).bind("unload",function(){for(var a in $.cache){if(a!=1&&$.cache[a].handle){$.event.remove($.cache[a].handle.elem)}}});