if(!Array.forEach){Array.prototype.forEach=function(D,E){var C=E||window;for(var B=0,A=this.length;B<A;++B){D.call(C,this[B],B,this)}};Array.prototype.map=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){A.push(E.call(D,this[C],C,this))}return A};Array.prototype.filter=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){if(!E.call(D,this[C],C,this)){continue}A.push(this[C])}return A};Array.prototype.every=function(D,E){var C=E||window;for(var B=0,A=this.length;B<A;++B){if(!D.call(C,this[B],B,this)){return false}}return true};Array.prototype.indexOf=function(B,C){var C=C||0;for(var A=0;A<this.length;++A){if(this[A]===B){return A}}return -1}}Array.prototype.contains=function(A){if(Array.contains){return this.contains(A)}return this.indexOf(A)>-1};Array.prototype.insert=function(A){if(!this.contains(A)){this.push(A)}};if(!Array.remove){Array.remove=function(D,C,B){var A=D.slice((B||C)+1||D.length);D.length=C<0?D.length+C:C;return D.push.apply(D,A)}}Function.prototype.method=function(A,B){this.prototype[A]=B;return this};Function.prototype.augmentProto=function(A){for(key in A){this.prototype[key]=A[key]}return this};Function.prototype.pBind=function(B){var A=this;return function(){return A.apply(B,arguments)}};Function.prototype.widget=function(){this.prototype.bind=function(B,A){this.$root.bind(B,A);return this};this.prototype.trigger=function(A,B){this.$root.trigger(A,B)};this.prototype.find=function(A){return this.$root.find(A)};return this};String.prototype.toCamel=function(){return this.replace(/[-_\s]\D/gi,function(A){return A.charAt(A.length-1).toUpperCase()})};String.prototype.escapeHTML=function(){return this.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")};String.prototype.unescapeHTML=function(){return this.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')};window.twttr=window.twttr||{};twttr.augmentObject=function(B,C){for(var A in C){B[A]=C[A]}return B};twttr.augmentObject(twttr,{namespaceOf:function(A){return twttr.is.object(A)?A:window},merge:function(){var D=arguments;var E=D[0];var H=arguments[arguments.length-1];var C=false;if(twttr.is.nil(E)||!twttr.is.def(E)){if(D.length<2){return{}}[].shift.call(D);return this.merge.apply(this,D)}if(twttr.is.bool(H)){C=H;[].pop.call(D)}for(var G=1,B=D.length;G<B;G++){var A=D[G];for(var F in A){if(C&&A[F]&&typeof A[F]==="object"){if(!E[F]){E[F]=(A[F] instanceof Array)?[]:{}}else{if(typeof E[F]!=="object"){E[F]=A[F]}}this.merge(E[F],A[F],true)}else{E[F]=A[F]}}}return E},extend:function(B,C){var A=function(){};A.prototype=C.prototype;B.prototype=new A();B.prototype.constructor=B;B.uber=C.prototype;if(C.prototype.constructor==Object.prototype.constructor){C.prototype.constructor=C}},klass:function(A,B){return twttr.magic(A,B)},augmentAndExtend:function(B,C,D){var A=twttr.namespaceOf(B);A[C]=function(){A[C].uber.constructor.apply(this,arguments)};twttr.extend(A[C],D);return A[C]},auxo:function(C,D,B){var A=twttr.is.object(B)?B:twttr;return twttr.augmentAndExtend(A,C,D)},augmentString:function(C,A){var B=window;C.split(".").forEach(function(F,E,D){B=B[F]=B[F]||(twttr.is.def(D[E+1])?{}:A)});return B},magic:function(B,A){if(twttr.is.string(B)){return twttr.augmentString(B,A)}else{return twttr.augmentObject(B,A)}},inspect:function(B){console.clear();var C=$(B);var H=C.data("events");var A=0;var G=0;var E=[];var D=[];for(key in H){E.push(key);A++;D.push("\n*******************\n");D.push("Events for "+key+"\n\n");for(fn in H[key]){var F=H[key][fn];G++;D.push(F.toString()+"\n")}}console.log("************* Summary *************");console.log("for target",C);console.log(A+" types of events",E);console.log(G,"Total Event Listeners");console.log("Event listeners assigned to target");console.log(D.join(" "))},is:{bool:function(A){return typeof A==="boolean"},nil:function(A){return A===null},def:function(A){return !(typeof A==="undefined")},number:function(A){return typeof A==="number"&&isFinite(A)},fn:function(A){return typeof A==="function"},array:function(A){return A?this.number(A.length)&&this.fn(A.splice):false},string:function(A){return typeof A==="string"},blank:function(A){return A===""},falsy:function(A){return A===false||A===null||A===undefined},object:function(A){return(A&&(typeof A==="object"||this.fn(A)))||false}},widget:function(A){A.prototype.bind=function(C,B){this.$element.bind(C,B)}}});if(!window.console){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}function setupTranslationCallback(){if(!twttr.i18n_missing_interval){twttr.i18n_missing_interval=window.setInterval(function(){if(twttr.i18n_missing&&twttr.i18n_missing.length>0){$.ajax({type:"POST",data:$.param({authenticity_token:twttr.form_authenticity_token,location:window.location.href,"strings[]":twttr.i18n_missing}),url:"/translate/untranslated_javascript"});twttr.i18n_missing=new Array()}},10000)}}function recordUntranslatedString(A){if(!twttr.i18n_missing){twttr.i18n_missing=new Array()}if(!twttr.i18n_missing_reported){twttr.i18n_missing_reported={}}if(!twttr.i18n_missing_reported[A]){twttr.i18n_missing.push(encodeURIComponent(A));twttr.i18n_missing_reported[A]=true}}function _(C,A){if(twttr.i18n){var B=twttr.i18n[C];if(B){C=B}else{recordUntranslatedString(C)}}return replaceParams(C,A)}function replaceParams(B,A){if(A){for(var C in A){B=B.replace(new RegExp("\\%\\{"+C+"\\}","gi"),A[C])}}return B}var h=function(){var A=$("<div/>");return function(B){return B?A.text(B).html().replace(/\"/gi,"&quot;"):B}}();function unh(A){return A?A.replace(/&(amp;)+/g,"&").replace(/&[a-z]+;/gi,function(B){if(unh.HTML_ESCAPE_TOKENS[B]){return unh.HTML_ESCAPE_TOKENS[B]}return B}):A}window.unh.HTML_ESCAPE_TOKENS={"&lt;":"<","&gt;":">","&quot;":'"'};function addSlashes(A){return A.replace(/\'/g,"\\'").replace(/\"/g,'\\"')}var reverseString=function(A){return A?A.split("").reverse().join(""):A};var numberWithDelimiter=function(B,A){A=A?A:",";return B.toString().replace(/(.)(?=(.{3})+$)/g,"$1"+A)};var timeAgo=function(C){if(!C){return false}var H=new Date();var G=new Date(C);if(document.all){G=Date.parse(C.replace(/( \+)/," UTC$1"))}var D=H-G;var B=1000,F=B*60,A=F*60;if(isNaN(D)||D<0){return false}var E=-1;$.each([5,10,20],function(){if(D<this*B){E=this;return false}});if(E!=-1){return _("less than %{time} seconds ago",{time:E})}if(D<B*40){return _("half a minute ago")}if(D<F){return _("less than a minute ago")}if(D<B*90){return _("1 minute ago")}if(D<F*45){return _("%{time} minutes ago",{time:Math.round(D/F)})}if(D<F*90){return _("about 1 hour ago")}if(D<A*24){return _("about %{time} hours ago",{time:Math.round(D/A)})}return false};var updateTimeAgo=function(){$(".timestamp").each(function(){var B=$(this);var A=timeAgo(B.meta().time);if(A&&B.find("*").length==0){B.html(A)}});$(".timestamp-title").each(function(){var B=$(this);var A=timeAgo(B.meta().time);if(A){B.attr("title",A)}})};var DEBUG=false;$.extend({log:function(A){if(window.console){console.log(A)}},debug:function(A){if(DEBUG){console.log(A)}},inspect:function(B){var A="{\n";for(var C in B){A+="\t"+C+": "+B[C]+"\n"}A+="}";console.log(A);return A},getStackTrace:function(){var I=[];var C=false;try{D.dont.exist+=0}catch(F){if(F.stack){var J=F.stack.split("\n");for(var D=0,E=J.length;D<E;D++){I.push(J[D])}I.shift();C=true}else{if(window.opera&&F.message){var J=F.message.split("\n");for(var D=0,E=J.length;D<E;D++){if(J[D].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var H=J[D];if(J[D+1]){H+=" at "+J[D+1];D++}I.push(H)}}I.shift();C=true}}}if(!C){var B=arguments.callee.caller;while(B){var G=B.toString();var A=G.substring(G.indexOf("function")+8,G.indexOf(""))||"anonymous";I.push(A);B=B.caller}}return I}});(function(){if(document.all){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var A=new Number(RegExp.$1);if(A>=8){$.browser.msie8=true}else{if(A>=7){$.browser.msie7=true}else{$.browser.msie6=true}}}}})();var _tmp={};twttr.augmentObject(twttr,{templates:{},timeouts:{},wait:function(){var A={};twttr.clearWait=function(B){if(twttr.is.def(A[B])){clearTimeout(B);delete A[B]}};return function(E,C){var B="TIMER_"+(new Date()).getTime();var D=setTimeout(function(){if(!twttr.is.def(A[B])){return }E()},C);A[B]=D;return B}}(),processJson:function(json){if(typeof (json)=="object"){var evals=[];$.each(json,function(selector,content){var c=selector.charAt(0);if(c=="$"){evals.push(content)}else{if(c=="!"){var notification=window[selector.substring(1)+"Notification"];if(notification){(new notification()).setMessage(content).show()}}else{var $contentPadded=$("<div></div>").html(content);var $content=$(selector,$contentPadded);if($content.length==1){$(selector).replaceWith($content)}else{$(selector).html(content)}$(selector).show()}}});$.each(evals,function(index,js){if(js){eval(js)}})}},googleAnalytics:function(A){if(window.pageTracker){window.pageTracker._trackEvent("Ajax","refresh",A,null)}},trackPageView:function(C,B,D){if(window.pageTracker){var A;window.pageTracker._setSampleRate(5);if(C){A=C.toString();if(B){A="/search/tweets/"+encodeURIComponent(h(page.query))}if(D){A=A+D}window.pageTracker._trackPageview(A)}else{window.pageTracker._trackPageview()}}},fadeAndReplace:function(A,B){$(A).fadeOut("medium",function(){$(A).html(B)});$(A).fadeIn("medium")},error:function(A){alert(A?A:_("Whoops! Something went wrong. Please refresh the page and try again!"))},loading:function(){$("#loader").fadeIn(200)},loaded:function(){$("#loader").fadeOut(200)},updateLocation:function(A,E){if(!E){E=document}if(A){var D=A.replace(/^https?:\/\/.+?\//,"").replace(/#/gi,"%23").replace(/\s/gi,"+");var C=D.replace(/[^\w\d_-].*$/,"");var B=(C.length>0)?$(E).find("#"+C):[];if(B.length>0){B.get(0).id=C+"_tmp_for_update_location"}E.location.hash=D;if(B.length>0){B.get(0).id=C}}},NON_CHAR_KEY_CODES:[8,9,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46,91,92,93],isNonCharKeyCode:function(A){return $.inArray(A.keyCode,twttr.NON_CHAR_KEY_CODES)!=-1||((A.ctrlKey||A.metaKey)&&$.inArray(A.keyCode,[67,88])!=-1)}});$.extend($.expr[":"],{onthepage:"($(elem).is(':visible') && $(elem).parents(':hidden').length == 0)"});jQuery.fn.move=function(A){var B=$(this).html();$(this).remove();$(A).html(B)};jQuery.fn.meta=function(){var B={type:"attr",name:"data"};var C=$(this);if(C.length==1){return C.metadata(B)}else{var A=[];C.each(function(){A.push($(this).metadata(B))});return A}};jQuery.fn.visible=function(A){$(this).each(function(){$(this).css("visibility",A?"visible":"hidden")})};jQuery.fn.isLoading=function(){$(this).addClass("loading")};$.fn.isLoaded=function(){$(this).removeClass("loading")};$.fn.replace_text=function(C,B){var A=$(this).html();if(A){$(this).html(A.replace(C,B))}};var pluralize=function(C,B,A){return C==1?B:A};var setDocumentTitle=function(A){document.title=unh(A)||""};var addCountToDocumentTitle=function(A){document.title=(A?"("+numberWithDelimiter(A)+") ":"")+document.title.replace(/\([^)]*[0-9]\)\s+/gi,"")};var getSessionUserScreenName=function(){var A;if(page.user_screenname){A=page.user_screenname}else{if($('meta[name="session-user-screen_name"]:first').get(0)){A=$('meta[name="session-user-screen_name"]:first').get(0).content}else{A=$('meta[name="session-user-screen_name"]').get(0).content}}return A};var sessionUserIsPageUser=function(){try{return $('meta[name="session-user-screen_name"]:first').get(0).content==$('meta[name="page-user-screen_name"]:first').get(0).content}catch(A){return false}};$.fn.focusEnd=function(){return this.each(function(){var A=this;if(A.style.display!="none"){if($.browser.msie){A.focus();var B=A.createTextRange();B.collapse(false);B.select()}else{A.setSelectionRange(A.value.length,A.value.length);A.focus()}}})};$.fn.focusFirstTextField=function(){return this.find("input[type=text]:visible:enabled:first").focus().length>0},$.fn.focusFirstTextArea=function(){return this.find("textarea:visible:enabled:first").focus().length>0};$.fn.focusFirstTexttarget=function(){return this.focusFirstTextField()||this.focusFirstTextArea()};$.fn.maxLength=function(A){return this.each(function(){$(this).keydown(function(B){return this.value.length<=A||twttr.isNonCharKeyCode(B)})})};$.fn.replaceClass=function(B,A){return this.each(function(){var C=$(this);if(C.hasClass(B)){C.removeClass(B).addClass(A)}else{if(C.hasClass(A)){C.removeClass(A).addClass(B)}}})};$.fn.isSelectAll=function(A){return this.each(function(){var B=$(this);if(typeof (A)=="string"){var D=$(A).find("input[type=checkbox]")}else{var D=A}function C(){var E=true;D.each(function(){if(!this.checked){E=false;return false}});B.get(0).checked=E}B.click(function(){var E=B.get(0).checked;D.each(function(){this.checked=E});$(this).trigger("select-all-changed",E)});D.click(function(){C();$(this).trigger("checkbox-changed",this.checked)})})};function bodytarget(){return $("body")}twttr.klass("twttr.Observer",function(){this.fns=[]}).method("listen",function(A){this.fns.push(A)}).method("unlisten",function(A){this.fns=this.fns.filter(function(B){if(B!==A){return B}})}).method("trigger",function(C,B){var A=B||window;this.fns.forEach(function(D){D.call(A,C)})});twttr.klass("twttr.User",function(A){this.screen_name=A}).method("update",function(B,A){twttr.tweeters[this.screen_name][B]=A;return this}).method("updateAll",function(B){for(var A in B){twttr.tweeters[this.screen_name][A]=B[A]}return this}).method("data",function(B){var A=twttr.tweeters[this.screen_name];return B?A[B]:A});twttr.augmentObject(twttr.User,{UserFetchTimeout:5000,UserFetchUrl:"/users/show",_bail:false,_requesting:false,bail:function(){this._bail=true},isRequesting:function(){return this._requesting},getCurrentUser:function(A){return this.findById(page.sessionUserId,A)},find:function(F,C,G){var B,A;var D=this;if(twttr.is.fn(C)){B=window;A=C}else{B=C;A=G}var E=twttr.is.def(F.screen_name)?F.screen_name.toLowerCase():null;if(E&&twttr.tweeters[E]){A.call(B,new twttr.User(E),true);return true}else{$.ajax({url:this.UserFetchUrl,type:"GET",data:F,dataType:"json",timeout:this.UserFetchTimeout,beforeSend:function(){D._requesting=true},success:function(K){D._requesting=false;var H=K.user;if(H){var I={};var J=H.screen_name.toLowerCase();I[J]=H;twttr.User.merge(I,true);if(D._bail){D._bail=false;return false}A.call(B,new twttr.User(J),false)}else{if(D._bail){D._bail=false;return false}A.call(B,null,false)}},error:function(H){D._requesting=false;if(D._bail){D._bail=false;return false}A.call(B,null,false)}});return false}},findByScreenName:function(B,A,C){return this.find({screen_name:B,hovercard:true},A,C)},findById:function(D,A,C){var B=twttr._birdtags[D];if(twttr.is.def(B)){this.findByScreenName(B,A,C)}else{this.find({user_id:D,hovercard:true},A,C)}},merge:function(){twttr.tweeters={};twttr._birdtags={};return function(D,A){var D=D||{};if(A){twttr.merge(twttr.tweeters,D,true)}else{var C=twttr.merge(D,twttr.tweeters,true);twttr.merge(twttr.tweeters,C,true)}for(var B in twttr.tweeters){twttr._birdtags[twttr.tweeters[B].user_id]=B}}}()});twttr.loadTemplate=function(A,B){if(twttr.templates[A]){return twttr.templates[A]}B=B||function(){};$.get("/mustaches/"+A+".html",null,function(D){var C={templates:{}};C.templates[A]=D;twttr.merge(twttr,C,true);B(twttr.templates)},"html")};twttr.loadTemplates=function(A,B){B=B||function(){};A.forEach(function(D,C){twttr.loadTemplate(D,function(E){var F=A.every(function(G){return twttr.is.def(E[G])});if(F){B(twttr.templates)}})})};twttr.SimplePositioner={setPosition:function(H,I,J){var D={inline:false,direction:null,offsets:{inline:{top:0,left:0},below:{top:0,left:0},above:{top:0,left:0}},hasContainer:false};var A=twttr.merge({},D,J,true);var F=F instanceof jQuery?H:$(H);var C=I instanceof jQuery?I:$(I);var E=A.hasContainer?C.position():C.offset();if(!A.inline){var G=this;function B(K){G.clearPosition();switch(K){case"above":G._positionAbove(F,C,E,A.offsets.above,A.hasContainer);break;case"below":G._positionBelow(F,C,E,A.offsets.below);break;case"prefer below":B("below");if((F.offset().top-$(document).scrollTop())+(A.itemHeight||F.height())>$(window).height()){B("prefer above")}break;default:B("above");if((F.offset().top-$(document).scrollTop())<0){B("below")}break}}B(A.direction)}else{this._positionInline(F,C,E,A.offsets.inline);F.css("left",E.left+A.offsets.inline.left)}},clearPosition:function(){$("body").removeClass("loading-hoverer-above")},_positionAbove:function(E,F,C,A,B){E.addClass("position_above").removeClass("position_below").removeClass("position_inline");var G=Math.round(C.top+A.top);var H;if(B){H=F.parents().filter(function(){return $(this).css("position")=="relative"}).outerHeight()}else{var D=$("body");D.addClass("loading-hoverer-above");var I=parseInt(D.css("padding-top"));G+=I>0?12:0;H=D.outerHeight()}E.css({bottom:H-G,left:this._getLeftPosition(E,F,C)+A.left})},_positionBelow:function(A,C,D,E){var B=Math.round(D.top+C.height()+E.top);A.addClass("position_below").removeClass("position_above").removeClass("position_inline");A.css({top:B,left:this._getLeftPosition(A,C,D)+E.left})},_positionInline:function(A,B,D,C){A.css("top",D.top+C.top).addClass("position_inline").removeClass("position_below").removeClass("position_above")},_getLeftPosition:function(A,B,C){return Math.round(C.left+(B.width()/2))}};twttr.unparam=function(F){var E={};var C=F.split("&");for(var B=0,A=C.length;B<A;B++){var D=C[B].split("=",2);E[decodeURIComponent(D[0])]=(D.length==2?decodeURIComponent(D[1].replace(/\+/g," ")):null)}return E};twttr.klass("twttr.Validator",function(A,C,B){this.$field=$(A);this.value=this.$field.val();if(twttr.is.string(this.value)){this.value=jQuery.trim(this.value)}this.fieldName="";if(twttr.is.object(C)){B=C}else{this.fieldName=C}this.valid=B.valid;this.invalid=B.invalid});twttr.Validator.augmentProto({is:function(){var A=null;var B=this;$.each(arguments,function(D,C){if(!C._decorated){C=C()}if(!C(B.value)){A=C;return false}});if(A){this.invalid(this.$field,this.fieldName,A.errorMessage)}else{this.valid(this.$field,this.fieldName)}}});twttr.validate=function(B,A){function C(D,F,E){return new twttr.Validator(D,F,E)}twttr.augmentObject(C,B);return A(C)};$.fn.helpText=function(){this.each(function(){var B=$(this);var A=B.hasClass("help-focusable");if(A){B.mouseup(function(C){if(!B.helpVal()==""){B.select();C.preventDefault()}})}B.focus(function(C){B.setHelpState(false,A)}).blur(function(){if(document.selection){document.selection.empty()}else{getSelection().removeAllRanges()}B.setHelpState(true)});B.setHelpState(true)});return this};$.fn.helpVal=function(){var A=$.trim(this.val());return A==this.attr("title")?"":A};$.fn.setHelpState=function(A,B){this.each(function(){var D=$(this);var C="help-text";if(A){if(!D.helpVal()){D.val(D.attr("title"));D.addClass(C);if(this.hasFocus&&D.hasClass("help-focusable")){D.select()}}else{D.removeClass(C)}}else{D.removeClass(C);if(!D.helpVal()){if(B){D.select()}else{D.val("")}}}})};$.fn.selectOnClick=function(){this.each(function(){var B=$(this);var A=true;B.click(function(){if(A){A=false;this.select()}}).blur(function(){A=true})});return this};twttr.klass("twttr.autocomplete",function(A){var B=this;B.opts=twttr.merge({getInputVal:function(){return B.opts.$input.val()},hoverClass:"hover",delay:350},A);B.cache={};B._clearFakeFocus();B.opts.$input.keydown(function(C){switch(C.keyCode){case 38:B.arrowUp();break;case 40:B.arrowDown();break;case 13:if(!B.hasFakeFocus){return }B.$fakeFocus.click();break;case 27:if(B.opts.$dropdown.is(":visible")){B.hide()}else{return }break;case 9:if(B.opts.$dropdown.is(":visible")){B.hide()}return ;default:B._onInputChange();return }B.keyDownEvent=true;C.stopPropagation();C.preventDefault()}).keypress(function(C){switch(C.keyCode){case 38:if(!B.keyDownEvent){B.arrowUp()}break;case 40:if(!B.keyDownEvent){B.arrowDown()}break;default:B._onInputChange();return }B.keyDownEvent=false;C.preventDefault()}).change(function(){B._onInputChange()}).blur(function(){if(!B.hovering){B.hide()}})}).method("arrowDown",function(){if(this.hasFakeFocus){this._setFakeFocus(this.$fakeFocus.next())}else{this._show()}}).method("arrowUp",function(){this._setFakeFocus(this.$fakeFocus.prev())}).method("hide",function(){this._clearFakeFocus();this.opts.$dropdown.hide();this.displayedInputVal=this.opts.getInputVal()}).method("_show",function(){this.displayedInputVal="";this._display();this._setFakeFocus(this.opts.$dropdown.children(":first"))}).method("_clearFakeFocus",function(){this.$fakeFocus=$([]);this.hasFakeFocus=false;this.opts.$dropdown.children().removeClass(this.opts.HoverClass)}).method("_setFakeFocus",function(A){if(A.length>0){this.hasFakeFocus=true;this.$fakeFocus=A;this.$fakeFocus.addClass(this.opts.hoverClass).siblings().removeClass(this.opts.hoverClass)}}).method("_onInputChange",function(){var A=this;setTimeout(function(){A._display()},0)}).method("_display",function(){var B=this;var A=B.opts.getInputVal();if(B.displayedInputVal!=A){B._clearFakeFocus();var D=B.opts.$dropdown.hide().empty();B.displayedInputVal="";var C=B.cache[A];if(C){C.forEach(function(G,F){D.append(B.opts.renderMatch(G,F,C))});D.children().hover(function(){if(B.hasFakeFocus){B._setFakeFocus($(this))}else{$(this).addClass(B.opts.hoverClass)}B.hovering=true},function(){if(!B.hasFakeFocus){$(this).removeClass(B.opts.hoverClass)}B.hovering=false});var E=B.opts.$input.position();D.css({left:E.left,top:E.top+B.opts.$input.outerHeight()-1}).show();B.displayedInputVal=A}else{if(A&&C===undefined){B._fetch(A)}}}}).method("_fetch",function(A){var B=this;clearTimeout(B.timerId);B.timerId=setTimeout(function(){B.cache[A]=false;B.opts.fetchMatches(A,function(C){if(C&&C.length>0){B.cache[A]=C;B._display()}},function(){B.cache[A]=undefined})},B.opts.delay)});$.fn.isHomeSearchForm=function(){return this.each(function(){var B=$(this);var A=$(B.find('input[type="text"]')[0]);var C=B.find("#home_search_submit");C.click(function(){B.submit();return false});B.submit(function(){var D=A.val();if(D!=""){C.addClass("loading");searchSummize(D,B,"processHomepageSearch");$("#trends_list li").removeClass("active")}return false});B.bind("loaded",null,function(D){C.removeClass("loading")})})};function processHomepageSearch(A){$(".wrapper, .wrapper-footer-ie").show();$("#signin_q, #searchform_q").val(page.query);$(".logo").unbind();$(".front-trends-section, #trend_info span").remove();$("#big_signup").remove();$(document).trigger("processSummizeBefore");processSummize(A);$(document).trigger("processSummizeAfter")}function initLogging(){$("#home_search").scribe(function(){return{event_name:"search_form_submit",query:$("#home_search_q").val(),bucket:"control"}},"ab_home_page",{clientEvent:"submit"});$("#trends_list, #trends").scribe(function(B){var A=$(B.target);if(A.is(".search_link")){return{event_name:"trend_click",trend:A.text(),bucket:"control",group:"trends"}}return null},"ab_home_page");$("#content").scribe(function(B){var A=$(B.target);var C;if(A.is("img")){A=A.closest("a")}if(A.is(".tweet-url.profile-pic")){C={event_name:"avatar_click"}}else{if(A.is("a, a b")){if(A.is("b")){A=A.closest("a")}C={event_name:"hyperlink_click"};if(A.is(".tweet-url.screen-name")){$.extend(C,{target_class:"twtr-user"})}else{if(A.is(".tweet-url.web")){$.extend(C,{target_class:"twtr-hyperlink",url:A.text()})}else{if(A.is(".tweet-url.hashtag")){$.extend(C,{target_class:"twtr-hashtag",hashtag:A.text()})}else{if(A.is(".tweet-url.username")){$.extend(C,{target_class:"twtr-reply",reply:A.text()})}}}}}}return C?$.extend(C,{screen_name:getScreenNameFromSearchResults(A),bucket:"control",group:"search_results"}):null},"ab_home_page")}function getScreenNameFromSearchResults(A){return $(A).closest("li.search_result").find("a.screen-name").text()}window.SEARCH_CALLBACKS={summize:"processHomepageSearch",load:"pageHomepageLoadSearch",searchLink:"processHomepageSearchLink",trendLink:"processHomepageTrendLink",searchForm:"processHomepageSearchForm",hashtagLink:"processHomepageHashtagLink",inResultsLink:"processHomepageInResultsLink",more:"processHomepageSearchMore",refresh:"processHomepageSearchRefresh"};$.each(window.SEARCH_CALLBACKS,function(){window[this]=window.processHomepageSearch});function initializeSidebar(){action=page.query;if(action){var B=$.grep($("#trends_list li a"),function(C){return $(C).attr("name")==page.query})[0];if(B){var A=$(B).parent("li");if(A.length){A.addClass("active")}}}}twttr.updateLocation=function(A){if(A){A.replace(/^https?:\/\/.+?\//,"").replace(/\"/gi,"%22").replace(/#/gi,"%23").replace(/\s/gi,"+");var B=document.location.search;B.replace(/\"/gi,"%22").replace(/#/gi,"%23").replace(/\s/gi,"+");if("search"+B!=A){document.location.hash=A}}};function setTitleAndHeading(A){setDocumentTitle(_("%{query} - Twitter Search",{query:page.query}));if($("#timeline li").length){$("h2#timeline_heading").html(_("Realtime results for <strong>%{query}</strong>",{query:h(page.query)}))}else{$("h2#timeline_heading").html(_("No results for <strong>%{query}</strong>",{query:h(page.query)}))}}$.fn.isLanguageMenu=function(){return this.each(function(){var C=$(this);var A=$("#lf");var B=$(".language-select li + li");B.click(function(D){var E=B.offset();if($(window).height()<$("body").height()){C.css({top:E.top-C.height()-10,left:E.left})}else{C.css({top:E.top+B.height()-8,left:E.left})}C.toggle();return false});$(document).click(function(){C.hide()});C.find("li").click(function(){A.find("#lang").val(this.id);A.submit()})})};$(function(){$("#home_search_q").focusEnd();$("#home_search").isHomeSearchForm();$(".language-menu").isLanguageMenu();$("#trend_info img").tipsy({gravity:"s",offsetTop:-7});$("#trend_description img").tipsy({gravity:"s",offsetTop:-22});var A=$("#forgot_username_link");A.tipsy({gravity:"w",offsetLeft:7});A.bind("click",function(B){$("#username").focus();B.preventDefault()});$("#trends a").isSearchLink(SEARCH_CALLBACKS.trendLink);$("#trends_list a, .current-trends a, .trendtip-trend").isSearchLink(SEARCH_CALLBACKS.trendLink).bind("loading",null,function(B){$(this).parent("li").addClass("loading")}).bind("loaded",null,function(B){$(this).parent("li").removeClass("loading")});$(".logo").click(function(){return false});if($("body").hasClass("old-front")){initLogging()}});var searchSummize=function(E,B,F,A){page.query=E;var D=$("body#search #timeline li.search_result").attr("id");if(D&&page.retainTimeline){page.maxId=D.substring(7)}else{page.maxId=null}var C={q:page.query,rpp:20,maxId:page.maxId,locale:page.locale,callback:F||window.SEARCH_CALLBACKS.summize,layout:"none"};if(A){C.page=A}$("#side #q").val(E);B.trigger("loading");return $.ajax({url:page.summizeSearchUrl,data:C,dataType:"script",cache:false,complete:function(){$("#side #primary_nav li").removeClass("active");$("body").attr("id","search");var H="";if($("body.front").length){H=$("#trends_list li.active").length?"front/trends":"front/custom_search"}else{var G=$("#side li.active a.search-link").parents("div#trends, div#saved_searches");H=G.length==0?$("#side div#custom_search.active").attr("id"):G.attr("id")}twttr.trackPageView($("body").attr("id"),(page.query&&page.query.length>0?page.query:null),"/"+H+(!page.retainTimeline?"/ajax":"/ajax/more"));page.retainTimeline=null;page.isTimelineChange=false}})};var sponsoredSearch=function(A){if(page.showSSFetchOnly){clearTimelineIfNewSearch();processSummizeInternal(A);$.ajax({url:"/timeline/garuda_search",data:{query:page.query,authenticity_token:twttr.form_authenticity_token},type:"post",dataType:"html"})}else{if(page.showSS){$.ajax({url:"/timeline/garuda_search",data:{query:page.query,authenticity_token:twttr.form_authenticity_token},type:"post",dataType:"html",success:function(B){clearTimelineIfNewSearch();$("#timeline").prepend(B);processSummizeInternal(A);$("#timeline li.garuda-tweet").bind("hovercard",function(D,C){var E=twttr.createAdHoverTrackingParameters($(D.target),C);twttr.asyncAdsClickCount(E)})},error:function(){clearTimelineIfNewSearch();processSummizeInternal(A)}})}else{clearTimelineIfNewSearch();processSummizeInternal(A)}}};var processSummize=function(A){var B=getPageNumAndUrl(A)[0];if((B==2)&&!$("body").hasClass("front")){sponsoredSearch(A)}else{clearTimelineIfNewSearch();processSummizeInternal(A)}};var clearTimelineIfNewSearch=function(){var A=(page.query!="");if(A){if(!page.retainTimeline){$("#timeline").empty();$("#pagination").empty();$("#content .no-results").remove();$("#results_update").hide()}}};var getPageNumAndUrl=function(A){var E=$(A);var B=1;var D;var C=E.find(".paginator a.next");if(C.length){D=C.attr("href");D.match(/\?.*page=([0-9]+)/gi);B=RegExp.$1;B=B?parseInt(B):1}return[B,D]};var processSummizeInternal=function(B){$("#side form#sidebar_search, #side ul.sidebar-menu li a").trigger("loaded");var J=page.trendDescriptions[page.query];if(J){$("#trend_info").hide();$("#trend_description span").text(_("%{trend} is a popular topic on Twitter right now.",{trend:J[0]}));$("#trend").text(_("%{trend}",{trend:J[0]}));$("#trend_description p").html(J[1]);$("#trend_description").show()}else{$("#trend_description").hide();$("#trend_info").show()}(J&&J[1].length>0)?$(".trenddesc").show():$(".trenddesc").hide();var H=$(B);var M=$(".homepage #timeline").length;var C=M&&!$(".homepage #timeline li").length;var F=$("#timeline");var L=(page.query!="");$("body").attr("id","search");var E=getPageNumAndUrl(B)[1];var D=[];if(L){D=renderResultsFromSummize(H,F,M)}$("#container, #side_base").show();F.find(".msgtxt a").each(twttr.appendClassesToSearchResults);F.find(".msgtxt").prev().addClass("tweet-url screen-name");F.find("span.vcard a").addClass("tweet-url profile-pic");F.find(".search_result").find(".status-body a,.vcard a").each(function(){var P=$(this);var N=P.attr("href");if(N.match(/^\/search\?q=([^&]+)/)){P.removeAttr("target");var O=decodeURIComponent(RegExp.$1);P.attr("title",O);P.isSearchLink(O.match(/^#/)?SEARCH_CALLBACKS.hashtagLink:SEARCH_CALLBACKS.inResultsLink)}else{if(N.match(/^https?:\/\/twitter\.com/)){P.removeAttr("target")}}});if(page.searchResults=(D.length>0&&L)){if(!M){enfavoriteSummize(D)}page.maxId=D[0];if(E){$("#pagination").empty().html('<a id="search_more" class="round more" rel="next" href="'+E+'">'+_("more")+"</a>").find("a").isSearchMoreButton(M)}else{$("#pagination").empty().html('<p class="no-more-tweets">'+_("Older tweets are temporarily unavailable.")+"</p>")}}else{var I=[_("Try a more general search."),_("Try using different words.")];var K='<div class="no-results">'+_("Suggestions:")+"<ol>";for(var G=0;G<I.length;G++){K+="<li>"+I[G]+"</li>"}K+="</ol></div>";setTimeout(function(){$("#timeline_heading").after(K)},1)}twttr.updateLocation("search?q="+encodeURIComponent(page.query));initializeSidebar();var A=$("#sidebar_search_q, #home_search_q");if(A.val()!=page.query){A.val(page.query);A.css("color","#000")}onPageChange(C);$("#side #rssfeed a.search-rss").attr("href","http://search.twitter.com/search.atom?q="+h(encodeURIComponent(page.query)));summizeRefresh()};if(!window.SEARCH_CALLBACKS){window.SEARCH_CALLBACKS={summize:"processSummize",load:"pageLoadSearch",searchLink:"processSearchLink",trendLink:"processTrendLink",savedSearchLink:"processSavedSearchLink",searchForm:"processSearchForm",hashtagLink:"processHashtagLink",inResultsLink:"processInResultsLink",more:"processSearchMore",refresh:"processSearchRefresh"};$.each(window.SEARCH_CALLBACKS,function(){window[this]=window.processSummize})}function renderResultsFromSummize(C,B,A){var D=[];C.find(".result").each(function(){var J=$(this);J.find(".location,.thread,.to_av,p.clearleft,.expand,#share").remove();var F=$(J.find(".avatar").get(0));F.replaceWith('<span class="thumb vcard author">'+F.html()+"</span>");var L=$(J.find(".info").get(0));var M,G,E;L.find("a.lit").each(function(){E=$(this).attr("href");var P=E.match(/\/(\w+)\/statuses\/(\d+)/);M=P[2];D.push(M);G=P[1]});var H=L.find(".source").remove();L.find("a").remove();L.html('<a href="'+E+'">'+L.html()+"</a>");L.append(H);var O='<span class="meta entry-meta">'+L.html().replace(/\u00B7/g,"")+"</span>";L.remove();var N=$(J.find(".msg").get(0));N.replaceWith((($.browser.msie&&$.browser.version<7)?'<img src="http://s.twimg.com/a/1275505066/images/white.png" width="1" height="50" align="left">':"")+N.html().replace(/a>\s*:\s*<span/,"a> <span")+O);var K=J.html();if(!A){K='<span class="actions"><div><a href="#" class="fav-action non-fav" id="status_star_'+M+'"> &nbsp; </a></div></span>'+K;K+='<ul class="actions-hover"><li><span class="reply"><span class="reply-icon icon"></span><a href="/home?status=@'+G+"%20&in_reply_to_status_id="+M+"&in_reply_to="+G+'">Reply</a></span></li><li><span class="retweet-link"><span class="retweet-icon icon"></span><a href="#" title="Retweet">Retweet</a></span></li></ul>'}var I=$('<li class="hentry status search_result u-'+G+'" id="status_'+M+'"><span class="status-body">'+K+"</span></li>");B.append(I)});return D}function enfavoriteSummize(A){if(page.loggedIn&&A.length>0){$timeline=$("#timeline");$.ajax({type:"POST",dataType:"json",url:"/favourings/intersect_for_search",data:{authenticity_token:twttr.form_authenticity_token,"status_id[]":A,twttr:true},beforeSend:null,success:function(B){$.map(B,function(C){$timeline.find("#status_"+C+" .non-fav").addClass("fav").removeClass("non-fav")})},complete:null})}}function summizeRefresh(){if(page.timelineRefresher){page.timelineRefresher.stop();page.timelineRefresher=null;addCountToDocumentTitle()}var B=$("#results_update");B.data("count",0);var A=$("#new_results_notification").meta().search;if(page.summizeRefresher||$("#results_update").length==0){return }page.newResults=null;page.summizeRefresher=new Occasionally(A.delay*1000,A.max_delay*1000,function(){var C=false;$.ajax({dataType:"script",url:page.summizeSearchUrl,data:{q:page.query,since_id:page.maxId,locale:page.locale,refresh:true,callback:"processSummizeRefresh"},cache:false,callback:null})},function(){return page.newResults},A.decay);page.summizeRefresher.start()}function processSummizeRefresh(B){if(decodeURIComponent(B.query).replace(/\+/g," ")==page.query&&B.total){page.maxId=B.max_id;var C=page.summizeRefreshResults=(page.summizeRefreshResults||0)+B.total;var A=$("#results_update").is(":visible")?"":' style="display:none;"';var D='<a id="results_update" class="minor-notification"'+A+">";D+=(C==1)?_("1 more tweet since you started searching."):_("%{results_count} more tweets since you started searching.",{results_count:numberWithDelimiter(C)});D+="</a>";$("#results_update").replaceWith(D);$("#results_update:hidden").slideDown();$("#results_update").attr("title",page.query).attr("href","/search?q="+encodeURIComponent(h(page.query))).isSearchLink(SEARCH_CALLBACKS.refresh).click(function(){addCountToDocumentTitle();return false});if(C){addCountToDocumentTitle(C)}page.newResults=true}else{page.newResults=false}}$.fn.isSearchMoreButton=function(A){return this.each(function(){var B=$(this);B.click(function(){B.blur();var D=B.attr("href");D.match(/\?.*page=([0-9]+)/gi);var C=RegExp.$1;page.retainTimeline=true;$("#timeline li:last-child").addClass("last-on-page");searchSummize(page.query,B,SEARCH_CALLBACKS.more,C);B.addClass("loading").html("");return false})})};function onPageChange(A){var C=$("body").attr("id");setTitleAndHeading(C);if(!A){if(page.summizeRefresher){page.summizeRefresher.stop();page.summizeRefresher=null;page.summizeRefreshResults=null}if(!page.retainTimeline){$("#results_update").hide()}$(".no-results").remove();$("#new_results_count").html("0")}if(!$("body").hasClass("front")){$(".in-page-link").isInPageLink();$(".in-page-list-link").isListInPageLink();try{$(".in-page-list-label").isListInPageLabel();$(".in-page-label").isInPageLabel()}catch(B){}}if(C=="list"||C=="list_show"){C=(window.location.hash||window.location.pathname).replace(/^#/,"").replace(/^([^\/])/,"/$1");if(C.indexOf("/list")!=0){C="/list"+C}}twttr.trackPageView(C,(page.query&&page.query.length>0?page.query:null),A?null:"/ajax")}$.fn.isSearchLink=function(A){return this.each(function(){var B=$(this);B.click(function(C){C.preventDefault();if($.browser.msie){this.hideFocus=true}if(page.isTimelineChange&&page.currentTimelineChange){page.currentTimelineChange.abort();page.$oldTimelineLink.trigger("aborted");page.isTimelineChange=false}page.isTimelineChange=true;page.currentTimelineChange=searchSummize(B.attr("name")?B.attr("name"):B.attr("title"),B,A);if(B.parents("#side").length>0){$("#side ul.sidebar-menu li").removeClass("active");B.parent("li").addClass("active")}$("#trends_list li.active a").removeClass("active")})})};$.fn.isSearchForm=function(){return this.each(function(){var B=$(this);var A=$(B.find('input[type="text"]')[0]);var C=B.find("#sidebar_search_submit");A.Watermark(_("Search")).focus(function(){A.select();return true});C.click(function(){B.submit()});B.submit(function(){var D=A.val();if(D!=""){C.addClass("loading");searchSummize(D,B,SEARCH_CALLBACKS.searchForm)}$("#side ul.sidebar-menu li").removeClass("active");$("#side #custom_search").addClass("active");return false});B.bind("loaded",null,function(D){C.removeClass("loading")})})};function loadTrendDescriptions(){$("#trends a").each(function(){var A=$(this);var C=A.parent().find("em");if(C.length){var B=A.text();var D=C.text().replace(new RegExp(B.replace(/([^\w])/gi,"\\$1"),"gi"),"<strong>"+B+"</strong>");var E=A.attr("title").length?A.attr("title"):A.attr("name");page.trendDescriptions[E]=[B,D]}})}$(document).ready(function(){$("#tweet_search_submit").click(function(){$("#tweet_search").submit()});$("#content #trend_description img").tipsy({gravity:"s"});page.trendDescriptions={};loadTrendDescriptions();if($("body").attr("id")=="search"){onCondition(function(){return page.summizeResults},function(){window[SEARCH_CALLBACKS.summize](page.summizeResults)})}});twttr.appendClassesToSearchResults=function(){var A=$(this);A.addClass("tweet-url");if(A.text().match(/^@/)){A.addClass("username")}else{if(A.text().match(/^#/)){A.addClass("hashtag")}else{A.addClass("web")}}};window.twttr=window.twttr||{};window.twttr.bounds=window.twttr.bounds||{};$.extend(twttr.bounds,{Bounds:function(b,d,c,a){this.x=b;this.y=d;this.width=c;this.height=a}});$.extend(twttr.bounds.Bounds.prototype,{encloses:function(a,b){return a>this.x&&a<this.x+this.width&&b>this.y&&b<this.y+this.height},toString:function(){return"("+this.x+","+this.y+") "+this.width+"x"+this.height}});(function(a){a.fn.extend({bounds:function(){var c=this.eq(0);var b=c.offset();return new twttr.bounds.Bounds(b.left,b.top,c.outerWidth(),c.outerHeight())}})})(jQuery);
(function(A){A.extend(window,{TrendTip:{parseIntDefault:function(B,D){D=D||0;var C=parseInt(B);return isNaN(C)?D:C},clearBounds:function(){this.data("bounds",[])},addToBounds:function(B){if(!this.data("bounds")){this.data("bounds",[])}this.data("bounds").push(B)},enclosing:function(B,D){if(!this.data("bounds")){this.data("bounds",[])}var C=false;A.each(this.data("bounds"),function(F,E){if(E.encloses(B,D)){C=true}});return C},clearScrollInterval:function(){clearInterval(this.data("interval"))},setScrollInterval:function(B){if(this.data("interval")){this.clearScrollInterval()}this.data("interval",setInterval(B,30))},duplicateContent:function(B){var C=0;B.children().each(function(){C+=A(this).outerWidth(true);B.append(A(this).clone())});B.css({zoom:1,width:(2*C)+"px"});return C},initScroller:function(){var C=this;var E=this.duplicateContent(C);var B=TrendTip.parseIntDefault(C.css("left"),0);var D=function(){B=(B%E)-1;C.css({left:B})};C.bind("trendEnter",function(){C.clearScrollInterval()}).bind("trendLeave",function(){C.setScrollInterval(D)}).trigger("trendLeave")}}});A.extend(A.fn,{trendTip:function(){var B=false;var C=A(this);A.extend(C,TrendTip);C.initScroller();C.find("li a").each(function(){var D=A(this).closest("li");var E={mouseenter:function(G){var F=A(this);A("#trends .inner").trigger("trendLeave");if(C.oldCapturedTrend){C.oldCapturedTrend.trigger("trendLeave")}C.oldCapturedTrend=F;C.addToBounds(F.bounds());if(C.enclosing(G.pageX,G.pageY)){A("#trends .inner").trigger("trendEnter");F.trigger("trendEnter");var H=function(I){if(!C.enclosing(I.pageX,I.pageY)){A("#trends .inner").trigger("trendLeave");F.trigger("trendLeave")}};A(document).bind("mousemove",H);F.bind("trendLeave",function(I){C.clearBounds();A(document).unbind("mousemove",H)})}},trendenter:function(){if(!C.hoveringTrend){var F=A(".trendtip");var K=A(this).offset();var J=Math.round(A(this).outerWidth()/2);var I=Math.round(F.outerWidth()/2);var H=D.find("a").text();var G=D.find("em.description").html();F.find(".trendtip-trend").html(H);F.find(".trendtip-trend").attr("href",A(this).attr("href")).attr("name",H);if(A.trim(G)!=""){F.find(".trendtip-why").show();F.find(".trendtip-desc").html(G)}else{F.find(".trendtip-why").hide()}B=setTimeout(function(){clearTimeout(B);D.find("a.search_link").addClass("active");F.css({top:K.top+35,left:K.left+J-I,position:"absolute",zIndex:10000});F.fadeIn("fast",function(){C.hoveringTrend=true});C.addToBounds(F.bounds())},400)}},trendleave:function(G){clearTimeout(B);A("#trends a.search_link").removeClass("active");if(C.hoveringTrend){var F=A(".trendtip");F.fadeOut("fast");C.hoveringTrend=false}}};A(this).mouseenter(E.mouseenter).bind("trendEnter",E.trendenter).bind("trendLeave",E.trendleave)});return this}})})(jQuery);function FrontPage(){return $.extend(this,{$submit:$("#home_search"),$query:$("#searchform_q"),$text:$("#home_search p"),$topTweets:$(".twtr-widget"),$sources:$("#sources"),$trends:$("#trends"),$results:$("#results"),$trendTip:$(".trendtip:eq(0)"),$viewAllTopTweets:$("#tweets #view_all_top_tweets"),$topSources:$("#sources li")})}$.extend(FrontPage.prototype,{init:function(){this.initLogging();this.initSearchForm();this.initTrendHover();this.initTopSources();this.initProcessSummize();this.initTopTweetMonitor()},initTopTweetMonitor:function(){var B=$("#tweets").meta()["timeout"];var A=this;setTimeout(function(){if($(".twtr-widget .twtr-tweets .twtr-tweet").length<=0){A.searchRandomTrend();scribe({event_name:"toptweets_failure",timeout:B},"ab_home_page")}else{scribe({event_name:"toptweets_success"},"ab_home_page")}},B)},pickRandomTrend:function(){var B=$("#trends li a");B=$(jQuery.grep(B,function(E,D){return $.trim($(E).closest("li").find(".description").text())!=""}));var C=B.length;var A=Math.min(Math.max(0,Math.floor(Math.random()*C)),C-1);return B.eq(A)},searchRandomTrend:function(){var A=this.pickRandomTrend();if(A.length>0){searchSummize(A.attr("name")?A.attr("name"):A.attr("title"),A,SEARCH_CALLBACKS.trendLink)}},initLogging:function(){var A=this;this.$submit.scribe(function(){return{event_name:"search_form_submit",query:A.$query.val(),bucket:"new_home_page"}},"ab_home_page",{clientEvent:"submit"});this.$trends.scribe(function(C){var B=$(C.target);if(B.is(".search_link")){return{event_name:"trend_click",trend:B.text(),bucket:"new_home_page",group:"trends"}}return null},"ab_home_page");this.$viewAllTopTweets.scribe({event_name:"view_all_top_tweets_click",bucket:"new_home_page",group:"top_tweets"},"ab_home_page");this.$topTweets.scribe(function(D){var B=$(D.target);var E;if(B.is("img")){B=B.closest("a")}if(B.is(".twtr-img a")){E={event_name:"avatar_click"}}else{if(B.is("a")){E={event_name:"hyperlink_click",target_class:B.attr("class")};if(B.is(".twtr-hyperlink")){$.extend(E,{url:B.attr("href")})}else{if(B.is(".twtr-hashtag")){$.extend(E,{hashtag:B.text()})}else{if(B.is(".twtr-reply")){$.extend(E,{reply:B.text()})}}}}}var C=A.getScreenNameFromTopTweets(B);if(C){$.extend(E,{screen_name:C})}return E?$.extend(E,{bucket:"new_home_page",group:"top_tweets"}):null},"ab_home_page");this.$results.scribe(function(C){var B=$(C.target);var D;if(B.is("img")){B=B.closest("a")}if(B.is(".tweet-url.profile-pic")){D={event_name:"avatar_click"}}else{if(B.is("a, a b")){if(B.is("b")){B=B.closest("a")}D={event_name:"hyperlink_click"};if(B.is(".tweet-url.screen-name")){$.extend(D,{target_class:"twtr-user"})}else{if(B.is(".tweet-url.web")){$.extend(D,{target_class:"twtr-hyperlink",url:B.text()})}else{if(B.is(".tweet-url.hashtag")){$.extend(D,{target_class:"twtr-hashtag",hashtag:B.text()})}else{if(B.is(".tweet-url.username")){$.extend(D,{target_class:"twtr-reply",reply:B.text()})}}}}}}return D?$.extend(D,{screen_name:A.getScreenNameFromSearchResults(B),bucket:"new_home_page",group:"search_results"}):null},"ab_home_page");this.$sources.scribe(function(C){var B=$(C.target);if(B.is("img")){B=B.closest("a")}if(B.is("a.avatar")){return{event_name:"source_hc_avatar_click",screen_name:$(this).closest("li").find("a:eq(0)").attr("rel"),bucket:"new_home_page",group:"sources"}}else{if(B.is(".hc-username a")){return{event_name:"source_hc_screen_name_click",screen_name:B.closest("li").find("a:eq(0)").attr("rel"),bucket:"new_home_page",group:"sources"}}else{if(B.is("li > a")){return{event_name:"source_click",screen_name:B.attr("rel"),bucket:"new_home_page",group:"sources"}}}}},"ab_home_page");this.$trendTip.scribe(function(D){var C=$(D.target).closest(".trendtip").find(".trendtip-trend");if(C.length>0){var B=$(D.target);if(B.is(".trendtip-trend")){return{event_name:"trend_tip_trend_click",trend:C.text(),bucket:"new_home_page",group:"trend_tip"}}else{if(B.is(".trendtip-source a")){return{event_name:"trend_what_the_trend_click",trend:C.text(),bucket:"new_home_page",group:"trend_tip"}}}}},"ab_home_page")},initSearchForm:function(){var A=this;var C=true;var B=function(){return $("body").attr("id")=="search"};this.$query.focus(function(){if(B()){return }C=false;A.$text.fadeTo("fast",1)}).blur(function(){if(B()){return }C=true;A.$text.fadeTo("fast",0.6)});this.$text.hover(function(){if(B()){return }if(C){$(this).fadeTo("fast",1)}},function(){if(B()){return }if(C){$(this).fadeTo("fast",0.6)}})},clearBounds:function(){this.bounds=[]},addToBounds:function(A){if(!this.bounds){this.bounds=[]}this.bounds.push(A)},enclosing:function(A,C){if(!this.bounds){this.bounds=[]}var B=false;$.each(this.bounds,function(E,D){if(D.encloses(A,C)){B=true}});return B},initTrendHover:function(){this.hoveringTrend=false;var A=this;$("#trends ul").trendTip()},initTopSources:function(){var A=false;this.$topSources.hover(function(){var B=$(this).find(".hc");$(".hc").fadeOut("fast");A=setTimeout(function(){clearTimeout(A);B.fadeIn("fast")},400)},function(){clearTimeout(A);$(".hc",this).fadeOut("fast")})},initProcessSummize:function(){$(document).bind("processSummizeBefore",function(){$(".trendtip").hide();$("#home_search p").css({opacity:1})}).bind("processSummizeAfter",function(){$("#results > h2 > span").text(page.query);if($("body").hasClass("ie6")||$("body").hasClass("ie7")){$("#front #results, #search #tweets, #search #sources, #front .search-tip, #front .trenddesc, #front .current-trends").hide();$("#search #results, #front #tweets, #search .search-tip, #front #sources, #search .current-trends").show()}})},getScreenNameFromTopTweets:function(A){var B=$(A).closest(".twtr-tweet").find(".twtr-user");return B?B.text():null},getScreenNameFromSearchResults:function(A){return $(A).closest("li.search_result").find("a.screen-name").text()}});(function(){jQuery.inherits=function(A,C){function B(){}B.prototype=C.prototype;A.prototype=new B();A.prototype.constructor=A}})();(function(){jQuery.fn.equals=function(A){return this.get(0)==A.get(0)}})();(function(){jQuery.fn.hasParent=function(A){var B=false;this.parents().map(function(){if($(this).equals(A)){B=true}});return B}})();function Notification(B){this.$bar=jQuery('<div class="notification-bar"></div>');this.$barContainer=jQuery('<div class="notification-bar-container"></div>');this.$barContents=jQuery('<div class="notification-bar-contents"></div>');this.$barBackground=jQuery('<div class="notification-bar-bkg"></div>');this.$message=jQuery('<div class="message"></div>');this.$bar.hide();this.$barBackground.hide();var A=this;this.$bar.click(function(C){A.removeAfterEvent(C)});this.className=B}Notification.SLIDE_SPEED_IN_MS=300;Notification.prototype.remove=function(){var A=this;this.slideUp(function(){A.$bar.remove();A.$barBackground.remove();window.clearTimeout(A.timeout)})};Notification.prototype.removeAfterEvent=function(B){var A=$(B.target);if(A.get(0).nodeName.toLowerCase()=="a"&&A.hasParent(this.$message)){return }this.remove()};Notification.prototype.setMessage=function(A){this.msg=A;return this};Notification.prototype.show=function(){this.$message.addClass(this.className).html(this.msg);this.$barContainer.append(this.$barBackground).append(this.$bar.append(this.$barContents.append(this.$message)));jQuery("#notifications").append(this.$barContainer);this.$barBackground.height(this.$bar.height());this.showBar();if(this.onShow){this.onShow()}return this};Notification.prototype.removeInMilliseconds=function(){var A=this;this.timeout=window.setTimeout(function(){A.remove()},A.timeoutInMilliseconds)};Notification.prototype.showBar=function(){this.$bar.show();this.$barBackground.show()};Notification.prototype.onShow=function(){this.removeInMilliseconds()};Notification.prototype.slideUp=function(A){this.$bar.slideUp(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideUp(Notification.SLIDE_SPEED_IN_MS,A)};function ShortNotification(){Notification.call(this,"message-info");this.timeoutInMilliseconds=3000}jQuery.inherits(ShortNotification,Notification);ShortNotification.prototype.showBar=function(){this.$bar.slideDown(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideDown(Notification.SLIDE_SPEED_IN_MS)};function InfoNotification(){Notification.call(this,"message-info");this.timeoutInMilliseconds=6000}jQuery.inherits(InfoNotification,Notification);InfoNotification.prototype.showBar=function(){this.$bar.slideDown(Notification.SLIDE_SPEED_IN_MS);this.$barBackground.slideDown(Notification.SLIDE_SPEED_IN_MS)};function ProgressNotification(){Notification.call(this,"message-progress");this.timeoutInMilliseconds=1000}jQuery.inherits(ProgressNotification,Notification);ProgressNotification.prototype.setProgressMessage=function(A){return this.setMessage(A)};ProgressNotification.prototype.setCompletedMessage=function(A){this.completedMsg=A;return this};ProgressNotification.prototype.onShow=function(){};ProgressNotification.prototype.cancel=function(){this.timeoutInMilliseconds=0;this.removeInMilliseconds()};ProgressNotification.prototype.done=function(){this.$message.addClass("message-progress-done").removeClass(this.className).html(this.completedMsg);this.removeInMilliseconds()};function ErrorNotification(){Notification.call(this,"message-error");this.timeoutInMilliseconds=8000}jQuery.inherits(ErrorNotification,Notification);function Occasionally(A,D,C,B,E){this.interval=A;this.maxDecayTime=D;this.job=C;this.decayCallback=B;this.timesRun=0;this.decayRate=1;this.decayMultiplier=E||1.25;this.maxRequests=360}Occasionally.prototype.start=function(){this.stop();this.run()};Occasionally.prototype.stop=function(){if(this.worker){window.clearTimeout(this.worker)}};Occasionally.prototype.run=function(){var A=this;this.decayRate=this.decayCallback()?Math.max(1,this.decayRate/this.decayMultiplier):this.decayRate*this.decayMultiplier;var B=this.interval*this.decayRate;B=(B>=this.maxDecayTime)?this.maxDecayTime:B;this.worker=window.setTimeout(function(){A.execute()},Math.floor(B))};Occasionally.prototype.execute=function(){this.job();if(++this.timesRun<this.maxRequests){this.run()}};(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";var getData=function(data){if(typeof data!="string"){return data}if(data.indexOf("{")<0){data=eval("("+data+")")}};var getObject=function(data){if(typeof data!="string"){return data}data=eval("("+data+")");return data};if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/)){name=name.replace(/^data-/,"")}else{return true}object[name]=getObject(this.nodeValue)})}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}$.data(elem,settings.single,object);return object}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);
(function(a){a.fn.tipsy=function(c){c=a.extend({fade:false,gravity:"n"},c||{});if(!c.offsetTop){c.offsetTop=0}if(!c.offsetLeft){c.offsetLeft=0}if(!c.header){c.header=""}if(!c.footer){c.footer=""}if(!c.hideTimeout){c.hideTimeout=100}if(!c.showTimeout){c.hideTimeout=0}if(!c.additionalCSSClass){c.additionalCSSClass=""}var b=false;var d=null,e=false;this.hover(function(){var g=a(this).text();var m=c.header.replace("%{link}",g);var l=c.footer.replace("%{link}",g);a.data(this,"cancel.tipsy",true);var h=a.data(this,"active.tipsy");if(!h){a(".tipsy").hide();h=a('<div class="tipsy '+c.additionalCSSClass+'"><div class="tipsy-inner">'+m+a(this).attr("title")+l+"</div></div>");h.css({position:"absolute",zIndex:100000});a(this).attr("title","");a.data(this,"active.tipsy",h)}else{if(a(this).attr("title")!=""){h.find(".tipsy-inner").html(a(this).attr("title"));a(this).attr("title","")}}var k=a.extend({},a(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});k.top=k.top+c.offsetTop;k.left=k.left+c.offsetLeft;a(".tipsy").hide();h.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var i=h[0].offsetWidth,j=h[0].offsetHeight;switch(c.gravity.charAt(0)){case"n":h.css({top:k.top+k.height,left:k.left+k.width/2-i/2}).addClass("tipsy-north");break;case"l":h.css({top:k.top+k.height,left:k.left+k.width/2-18}).addClass("tipsy-north");break;case"s":h.css({top:k.top-j,left:k.left+k.width/2-i/2}).addClass("tipsy-south");break;case"e":h.css({top:k.top+k.height/2-j/2,left:k.left-i}).addClass("tipsy-east");break;case"w":h.css({top:k.top+k.height/2-j/2,left:k.left+k.width}).addClass("tipsy-west");break}function f(){if(c.fade){h.css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:1})}else{h.css({visibility:"visible"})}}if(c.showTimeout){b=setTimeout(f,c.showTimeout)}else{f()}},function(){clearTimeout(b);a.data(this,"cancel.tipsy",false);var f=this;setTimeout(function(){if(a.data(this,"cancel.tipsy")){return}var g=a.data(f,"active.tipsy");if(c.fade){g.stop().fadeOut(function(){a(this).remove()})}else{g.remove()}},c.hideTimeout)})}})(jQuery);
(function(a){a.extend(a.fn,{livequery:function(f,e,d){var c=this,g;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(h,j){if(c.selector==j.selector&&c.context==j.context&&f==j.type&&(!e||e.$lqguid==j.fn.$lqguid)&&(!d||d.$lqguid==j.fn2.$lqguid)){return(g=j)&&false}});g=g||new a.livequery(this.selector,this.context,f,e,d);g.stopped=false;g.run();return this},expire:function(f,e,d){var c=this;if(a.isFunction(f)){d=e,e=f,f=undefined}a.each(a.livequery.queries,function(g,h){if(c.selector==h.selector&&c.context==h.context&&(!f||f==h.type)&&(!e||e.$lqguid==h.fn.$lqguid)&&(!d||d.$lqguid==h.fn2.$lqguid)&&!this.stopped){a.livequery.stop(h.id)}});return this}});a.livequery=function(c,e,g,f,d){this.selector=c;this.context=e||document;this.type=g;this.fn=f;this.fn2=d;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||a.livequery.guid++;if(d){d.$lqguid=d.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var c=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(d,e){c.fn2.apply(e)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var e=this;var f=this.elements,d=a(this.selector,this.context),c=d.not(f);this.elements=d;if(this.type){c.bind(this.type,this.fn);if(f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){a.event.remove(h,e.type,e.fn)}})}}else{c.each(function(){e.fn.apply(this)});if(this.fn2&&f.length>0){a.each(f,function(g,h){if(a.inArray(h,d)<0){e.fn2.apply(h)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var c=a.livequery.queue.length;while(c--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(d,e){if(!a.fn[e]){return}var c=a.fn[e];a.fn[e]=function(){var f=c.apply(this,arguments);a.livequery.run();return f}})},run:function(c){if(c!=undefined){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}}else{a.each(a.livequery.queries,function(d){if(a.inArray(d,a.livequery.queue)<0){a.livequery.queue.push(d)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(c){if(c!=undefined){a.livequery.queries[c].stop()}else{a.each(a.livequery.queries,function(d){a.livequery.queries[d].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");a(function(){a.livequery.play()});var b=a.prototype.init;a.prototype.init=function(d,f){var e=b.apply(this,arguments);if(d&&d.selector){e.context=d.context,e.selector=d.selector}if(typeof d=="string"){e.context=f||document,e.selector=d}return e};a.prototype.init.prototype=a.prototype})(jQuery);
if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
var scrobject={scribeHost:window.location.hostname,toScribeParams:function(A){var B=[];for(var C in A){B[B.length]=encodeURIComponent(C)+"="+encodeURIComponent(A[C])}return B.join("&")},scribeUrl:function(C,B){var A="/scribe?";if(B.host){A="http://"+B.host+A}else{if(!/[\/\.]twitter\.com/.test(scrobject.scribeHost)&&!/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.test(scrobject.scribeHost)&&scrobject.scribeHost!="localhost"){A="http://twitter.com"+A}}return A+scrobject.toScribeParams(C)}};function scribe(A,D,C,B){C=C||{};if(window.DARKMODE_SCRIBE){return this}if(!D){console.warn("You must specify a category in order to use scribe");return this}if(typeof (A)=="function"){A=A.call(this,B)}if(A==null){console.warn("You must provide logged data in order to use scribe");return this}if(!A.event_name){console.warn('You must include an "event_name" field in your logged data in order to use scribe');return this}var E={log:JSON.stringify(A),ts:(new Date()).getTime()};if(C.filter){E.filter=C.filter}if(D){E.category=D}(new Image()).src=scrobject.scribeUrl(E,C);return this}if(!window.console){window.console={warn:function(A){}}}if(window.jQuery){(function(A){A.extend(A.fn,{scribe:function(B,D,C){C=C||{};A(this).bind(C.clientEvent||"mousedown",function(E){window.scribe.call(this,B,D,C,E)});return this}})})(jQuery)};(function(A){A.fn.extend({isSigninMenu:function(){return this.each(function(){var B=A(this);var C=true;A(".signin").bind("click focus",function(E){E.preventDefault();if(!C){return }C=false;setTimeout(function(){C=true},500);var D=A(this);D.toggleClass("menu-open");B.toggle();if(D.hasClass("menu-open")){A(document).trigger("signinMenu.show");setTimeout(function(){A("#username").focus()},50)}else{A(document).trigger("signinMenu.hide");setTimeout(function(){A("#home_search_q, #searchform_q").focus()},0)}});B.mouseup(function(){return false});A(document).mouseup(function(D){if(A(D.target).parent("a.signin").length==0){A(document).trigger("signinMenu.hide");A(".signin").removeClass("menu-open");B.hide()}})})}})})(jQuery);

