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)}}}if(!window.console||!console.firebug){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 _(C,A){if(twttr.i18n){var B=twttr.i18n[C];if(B){C=B}}if(A){for(var D in A){C=C.replace(new RegExp("\\%\\{"+D+"\\}","gi"),A[D])}}return C}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,C){A=A?A:",";C=C?C:".";parts=(""+B).split(".");parts[0]=reverseString(reverseString(parts[0]).replace(/(\d\d\d)/g,"$1"+A));if(parts[0][0]==A){parts[0]=parts[0].substring(1)}return parts.join(C)};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}});(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 T={};T.inherit=function(B,C){var A=function(){};A.prototype=C.prototype;B.prototype=new A();B.prototype.constructor=B;B.superclass=C.prototype};T.augment=function(B,C){for(var A in C){B.prototype[A]=C[A]}return T};T.augmentObject=function(B,C){for(var A in C){B[A]=C[A]}};T.each=function(A,B){if(A instanceof Array){A.forEach(function(E,D,C){B(E)})}else{B(A)}};var _tmp={};window.twttr=window.twttr||{};T.augmentObject(twttr,{timeouts:{},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>"+content+"</div>";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)}})}},truncateToHeight:function(B,C,G,A,E){if(!E){E={}}if(!E.minlength){E.minlength=0}if(E.minlength&&(B.length<E.minlength)){C.text(B);return B}var F=B.substring(0,E.minlength);for(var D=E.minlength;D<B.length;D++){F+=B.charAt(D);C.text(F+"...");if(A>=0&&G.height()>A){C.text(F=F.substring(0,F.length-1)+"...");return F}}C.text(F);return F},googleAnalytics:function(A){if(window.pageTracker){window.pageTracker._trackEvent("Ajax","refresh",A,null)}},trackPageView:function(C,B,D){if(window.pageTracker){var A;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){if(A){document.location.hash=A.replace(/^https?:\/\/.+?\//,"").replace(/#/gi,"%23").replace(/\s/gi,"+")}},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)}});T.$=$;T.EventManager=function(B){this.events=this.events||[];for(var A in B){this.events[A]=B[A]}};T.augment(T.EventManager,{add:function(B,A){this.events[B]=A}});T.createEvents=function(A,B){if(B instanceof T.EventManager){A.prototype.Event=B}};T.Component=function(){};T.augment(T.Component,{attach:function(B,A){if(A){this._els.concat(T.query(B))}else{this._els=T.$(B)}return this},listen:function(A,B){if(!this.Event.events[A]){throw new Error('Twitter Error: Event type "'+A+'" is not supported for this component');return this}this.Event.events[A].call(this,B);return this},bind:function(A,B){this._els.bind(A,B);return this},unbind:function(A,B){this._els.unbind(A,B);return this}});$.extend($.expr[":"],{onthepage:"($(elem).is(':visible') && $(elem).parents(':hidden').length == 0)"});$.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 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.focusFirstTextElement=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.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)})})};var updateCount=function(A,E){try{var D=$(A);var C=parseInt(D.html().replace(/[^0-9]/g,""));D.html(numberWithDelimiter(C+=E));return C}catch(B){return false}};var updateFollowingCount=function(A){return updateCount("#following_count",A)};var updateFollowersCount=function(A){return updateCount("#follower_count",A)};$.fn.isUpdateForm=function(){return this.each(function(){var K=$(this);var F=K.find("textarea").isCharCounter();var A=K.find("input[type=submit]");var B=K.find("label.doing");var G=K.find(".char-counter");var E=/^\s*@(\w+)\W+/;var D=/^\s*[dD][mM]?\s+(?:(\w+)\W+)?/;function J(){var L=F.val();if(L.length>140){alert(_("That tweet is over 140 characters!"));return false}else{if(L.replace(/s\*/g,"")==""){return false}else{A.attr("disabled","disabled");return true}}}function H(L){A.removeAttr("disabled","disabled");var M=L.text;if(L.messageForFlash){(new ShortNotification()).setMessage(L.messageForFlash).show()}else{if($("body").attr("id")!="home"){(new ShortNotification()).setMessage(_("Your status has been updated!")).show()}else{if(L.status_li){$("#timeline tr.hentry:first").removeClass("latest-status");$.Timeline.prepend(L.status_li)}}updateStatusCount(L.status_count);if(L.latest_status){$("#latest_status").html(L.latest_status).isCurrentStatus(true)}}F.val("").focusEnd();$("#in_reply_to_status_id").val("");$("#in_reply_to").val("");C("");F.trigger("change");G.removeClass("loading");if(document.all){G.text("140")}else{G.css("color","#ccc")}}function C(M){var L;if(L=M.match(D)){B.html(L[1]?_("Direct message %{person}:",{person:L[1]}):_("Direct message:"));A.val(_("send"))}else{if(L=M.match(E)){B.html(_("Reply to %{screen_name}:",{screen_name:L[1]}));A.val(_("reply"))}else{B.html(_("What are you doing?"));A.val(_("update"))}}}F.bind("keyup blur focus",function(){C($(this).val())});K.submit(function(){if(J()){twttr.googleAnalytics("/status/update/refresh");var Q=F.val();var P={authenticity_token:twttr.form_authenticity_token,status:Q,twttr:true};var M=window.location.href;if($("body").attr("id")=="home"&&((M.indexOf("page=")==-1)||M.match(/page=1(?!\d)/))){P.return_rendered_status=true}var L=$("#in_reply_to_status_id").val();var O;if(L&&(O=Q.match(E))){if(O[1]==$("#in_reply_to").val()){P.in_reply_to_status_id=L}}var N=$("#source").val();if(N){P.source=N}$.ajax({type:"POST",dataType:"json",url:"/status/update",data:P,beforeSend:function(){G.addClass("loading");if(document.all){G.html("&nbsp;&nbsp;&nbsp;&nbsp;")}else{G.css("color","transparent")}},success:H})}return false});try{F.focusEnd()}catch(I){}})};$.fn.isDirectMessageForm=function(){return this.each(function(){var L=$(this);var D=L.find("textarea").isCharCounter();var B=/^\s*[dD][mM]?\s+([A-Za-z0-9]{1,20})[^A-Za-z0-9]/;var F=L.find("select");var A=L.find("#dm-submit");var E=L.find(".char-counter");var G="";L.find("input[type=submit]").attr("disabled","disabled").addClass("disabled");try{D.focusEnd()}catch(I){}function C(N){if(F.val()){return }if((matches=N.match(B))&&matches[1]&&(G!=matches[1])){var M=true;F.find("option").each(function(){if(this.innerHTML.toLowerCase()==matches[1].toLowerCase()){F.val(this.value);M=false;return false}});if(M){F.append(_('<option value="%{screen_name}">%{screen_name}</option>',{screen_name:matches[1]}));F.val(matches[1])}G=matches[1]}}A.click(function(M){var P=D.val();var N=P.match(B);var O=F.find("option[value="+F.val()+"]");if(N&&N[1]&&N[1].toLowerCase()==O.text().toLowerCase()){D.val(P.replace(B,""))}return true});F.change(function(M){D.trigger("update",M)});D.bind("keyup blur focus",function(M){C($(this).val());D.trigger("update",M)});function H(M){(new ShortNotification()).setMessage(M.messageForFlash).show();if($("body").attr("id")=="sent"){$.Timeline.prepend(M.direct_message_li)}D.val("");F.val("");G="";D.trigger("change");E.removeClass("loading");if(document.all){E.text("140")}else{E.css("color","#ccc")}}if(F.length>0){function J(){if(F.length&&(F.find("option").length==0)){$.ajax({type:"GET",dataType:"json",url:"/direct_messages/recipients_list",data:{twttr:true},success:function(N){if(N){var M=[];$.each(N,function(){var O=this;if((O.length>1)&&O[0]&&O[1]){M.push('<option value="'+O[0]+'">'+O[1]+"</option>")}});F.html('<option value="" selected="selected"></option>'+M.join(""))}},error:function(M){alert("error: "+M)}})}}var K=$("body").attr("id");if(K=="direct_messages"||K=="inbox"||K=="sent"){J()}L.bind("loadrecipients",null,function(M){J()});L.submit(function(){twttr.googleAnalytics("/direct_messages/create/refresh");var N=D.val();var M={authenticity_token:twttr.form_authenticity_token,text:N,"user[id]":F.val(),twttr:true};$.ajax({type:"POST",dataType:"json",url:"/direct_messages/create",data:M,beforeSend:function(){E.addClass("loading");if(document.all){E.text("")}else{E.css("color","transparent")}},success:H});return false})}})};$.fn.isDMTabLink=function(){return this.each(function(){var A=$(this);A.click(function(){$("body").attr("id",$(this).parent("li").attr("id").replace("_tab",""))}).bind("loading",null,function(B){A.parent("li").addClass("loading")}).bind("loaded",null,function(B){A.parent("li").removeClass("loading")}).bind("aborted",null,function(B){A.parent("li").removeClass("loading")})})};$.fn.isCharCounter=function(){return this.each(function(){var A=true;var F=$(this);var J=F.parents("form");var E=J.find(".char-counter");var H=J.find("input[type=submit]");var D=J.find("select");function C(){H.attr("disabled","disabled").addClass("disabled");A=true}function G(){if(A){H.removeAttr("disabled").removeClass("disabled");A=false}}function B(){var L=F.val();var K=L.length;E.html(""+(140-K));if(K<=0){E.css("color","#cccccc");C()}else{if(K<=140&&(D.length==0||D.val())){G()}else{C()}if(K>130){E.css("color","#d40d12")}else{if(K>120){E.css("color","#5c0002")}else{E.css("color","#cccccc")}}}}var I="blur focus change "+($.browser.mozilla?"paste input":"keyup");F.bind(I,function(K){B()});D.change(function(K){B()});F.focus()})};$.fn.isCurrentStatus=function(A){return this.each(function(){var F=$(this);var C=F.find("#latest_text");var E=C.find(".status-text");var D=$(this).parent("#currently");var H=D.find("strong");$("#latest_text_full, #latest_text").click(function(){$("#latest_text_full, #latest_text").toggle()});var G=E.css("color");C.css("color","transparent");var B=$("#latest_text_full .status-text").text();twttr.truncateToHeight(B,$("#latest_text .status-text"),$("#latest_text"),40,{minlength:60});C.css("color",G);if(A){if(D.css("visibility")=="hidden"){D.css("visibility","visible")}var I=D.find("span, strong").animate({color:"#333333"},500);clearTimeout(twttr.timeouts.latest_status_timeout);twttr.timeouts.latest_status_timeout=setTimeout(function(){I.animate({color:G},1500)},1500)}})};function initializeTimeline(){$("#timeline").Timeline()}function getListItemFromChild(A){return A.parents(".hentry:first")}function getStatusIdFromListItem(B){var A=/status_(.*)/i.exec(B.attr("id"));return(A)?A[1]:null}function getScreenNameFromListItem(B){var A=/u-([A-Za-z0-9_]+)/i.exec(B.attr("class"));return(A)?A[1]:null}function getShareIdFromListItem(B){var A=/(.)* s-([\d]+)(.)*/i.exec(B.attr("class"));return(A)?A[2]:getStatusIdFromListItem(B)}(function(){$(document).ready(function(){$().Page();initializeTimeline();$("#pagination #more").isMoreButton()});$.fn.Page=function(){var A=$('meta[name="session-user-screen_name"]:first').get(0);var D=$('meta[name="page-user-screen_name"]:first').get(0);var B=$('meta[name="session-userid"]:first').get(0);var C=A&&D&&A.content==D.content;if(typeof (page)=="undefined"){page={}}page=$.extend(page,{timeline:null,sessionUserScreenName:(A?A.content:null),sessionUserId:(B?B.content:null),pageUserScreenName:(D?D.content:null),loggedIn:$('meta[name="session-loggedin"][content="y"]').length>0,hideUnfavorited:C,isTimelineChange:false,currentTimelineChange:{},$oldTimelineLink:""})};$.fn.Timeline=function(){page.timeline=$(this);return this.each(function(){var A=$(this);var B={};$.Timeline.settings=$.extend({},$.Timeline.defaults);settings=$.extend($.Timeline.settings,page);var C=A.find(".hentry");if(settings.loggedIn){$.each($.Timeline.actions.tweet,function(){this.apply(C,[settings])})}})};$.Timeline={defaults:{timeline:$("#timeline")},prepend:function(A){$.Timeline.settings.timeline.prepend(A)},append:function(A){$.Timeline.settings.timeline.append(A)},actions:{tweet:{isTweet:function(A){return this.livequery(function(){if($("body").attr("id")!="profile"){var B=$(this).find("a.hashtag");B.isSearchLink(SEARCH_CALLBACKS.hashtagLink)}})},isHoverable:function(A){if($("body.ie,body.ie6").get(0)){return this.livequery(function(){var B=$(this);B.hover(function(){B.addClass("hover")},function(){B.removeClass("hover")})})}},isFavoriteable:function(A){return this.find(".fav-action").livequery(function(){var B=$(this);B.click(function(){var C=B.parents(".hentry:first");var F=C.attr("id").replace(/status_/,"");var E=B.hasClass("fav");var D=E?"destroy":"create";twttr.googleAnalytics("/favorites/"+D+"/refresh/"+F);$.ajax({type:"POST",url:"/favorites/"+D+"/"+F,data:{authenticity_token:twttr.form_authenticity_token},beforeSend:function(){B.attr("title","").removeClass(E?"fav":"non-fav").addClass("fav-throb")},success:function(){if($("body#favourings").hasClass("favourings")&&A.hideUnfavorited){C.fadeOut(500,function(){C.remove()})}else{B.attr("title",(E?"favorite":"un-favorite")+" this tweet").removeClass("fav-throb").addClass(E?"non-fav":"fav")}}});return false})})},isReplyable:function(A){return this.find(".reply").livequery(function(){var B=$(this);B.click(function(){var E=B.parents(".hentry:first");var H=E.attr("id").replace(/status_/,"");var C=E.attr("class").match(/u-([A-Za-z0-9_]+)/);var D=C[1];if(!D){alert(_("Whoops! Something went wrong. Please refresh the page and try again!"));return }if(E.hasClass("direct_message")){var G=$("#text");twttr.googleAnalytics("/direct_messages/reply/"+D+"/"+H);var F=$("#direct_message_user_id");if(!F.find("option[text='"+D+"']").attr("selected",true).length){F.append('<option value="'+D+'" selected="selected">'+D+"</option>")}G.trigger("update");$("#text").focusEnd()}else{if(E.hasClass("status")||E.hasClass("share")){var G=$("#status");twttr.googleAnalytics("/reply/"+D+"/"+H);G.val("@"+D+" "+G.val().replace(RegExp("@"+D+" ?","i"),"")).trigger("update");$("#status").focusEnd();$("#in_reply_to_status_id").val(H);$("#in_reply_to").val(D);window.scroll(0,0)}}window.scroll(0,0);return false})})},isRetweetable:function(A){return this.find(".retweet-link").livequery(function(){var B=$(this);B.click(function(D){var C=_("Yes");var E=_("Retweet to your followers?");var F=B.parent().offset();(new InlineForm(E,C)).show(B,parseInt(F.top)+20,parseInt(F.left)-240);D.preventDefault()})})},isDeleteable:function(A){return this.find(".del").livequery(function(){var B=$(this);B.click(function(){var C=B.parents(".hentry:first");var F;var E=C.hasClass("latest-status");var D;if(C.hasClass("direct_message")){F=C.attr("id").replace(/direct_message_/,"");D="/direct_messages/destroy"}else{if(C.hasClass("status")){F=C.attr("id").replace(/status_/,"");D="/status/destroy"}}if(confirm(_("Sure you want to delete this tweet? There is NO undo!"))){twttr.googleAnalytics(D+"/refresh/"+F);$.ajax({type:"POST",url:D+"/"+F,data:{authenticity_token:twttr.form_authenticity_token,latest_status:E},dataType:(D=="/status/destroy"?"json":null),beforeSend:function(){B.attr("title","").removeClass("del").addClass("del-throb")},success:function(G){var H=C.parents(".conversation");var I=H.get(0)?H:C;I.fadeOut(500,function(){I.remove();if(D=="/status/destroy"){if(E){twttr.processJson(G);updateLatest()}}});updateStatusCount(G.status_count)}})}return false})})},isUndoable:function(A){return this.find(".undo").livequery(function(){var B=$(this);B.click(function(){var D=B.parents(".hentry:first");var C=D.attr("id").replace(/status_/,"");if(confirm(_("Sure you want to undo this retweet?"))){$.ajax({type:"POST",url:"/statuses/"+C+"/retweet",data:{_method:"delete",authenticity_token:twttr.form_authenticity_token,controller_name:page.controller_name,action_name:page.action_name},dataType:"json",beforeSend:function(){B.attr("title","").removeClass("undo").addClass("del-throb")},success:function(E){D.replaceWith(E.status_li)}})}return false})})}}}}})();(function(){$.fn.isMoreButton=function(){return this.livequery(function(){$(this).click(function(){var B=$(this);B.blur();var A=B.attr("href");$.ajax({type:"GET",url:A,dataType:"json",beforeSend:function(){$("#more").addClass("loading").html("")},success:function(C){$("#timeline").append($(C["#timeline"]).find(".hentry"));$("#pagination").html(C["#pagination"]);if(window.onPageChange){onPageChange()}},error:function(){alert(_("Whoops! Something went wrong. Please try refreshing the page."))}});return false})})}})();$(function(){var request=function(data,success){return function(){var self=this;$this=$(this);var notification=(new ProgressNotification()).setProgressMessage($this.attr("progress")).setCompletedMessage($this.attr("completed"));$.ajax({type:$this.attr("method"),dataType:"json",url:$this.attr("href")||$this.attr("action"),data:data.apply(self),success:function(){notification.done();if(success){success.apply(self)}},beforeSend:function(){twttr.loading();notification.show()},complete:twttr.loaded});return false}};$("form.restful").livequery("submit",request(function(){return $(this).serializeArray()},function(){$(this).trigger("submitted")}));$("a.restful").livequery("click",request(function(){return eval("("+$(this).attr("data")+")")}))});function updateLatest(){var A=$("#latest_status");if(A.length){A.isCurrentStatus(true)}$("#timeline li:first").addClass("latest-status")}function updateStatusCount(A){if(A!=undefined){$("#update_count").fadeOut("medium",function(){$("#update_count").html(numberWithDelimiter(A)).fadeIn("medium")})}}function setTitleAndHeading(C){var J=$("#timeline_heading h1");var C=C||$("body").attr("id");var A=h(page.query);var D=page.user_screenname?page.user_screenname:$('meta[name="session-user-screen_name"]:first').get(0).content;if(!twttr.titles_and_headings){var H={user:D,name:page.user_fullname};twttr.titles_and_headings={home:{title:_("Home"),heading:_("Home")},replies:{title:("@"+D),heading:_("Tweets mentioning @%{user}",H)},favorites:{title:_("Your Favorites"),heading:_("Your Favorites")},inbox:{title:_("Direct Messages"),heading:_("Direct messages sent only to you")},direct_messages:{title:_("Direct Messages"),heading:_("Direct messages sent only to you")},sent:{title:_("Sent Direct Messages"),heading:_("Direct messages you've sent")},retweets_by_others:{title:_("Retweets",H),heading:_("Retweets",H)},profile_favorites:{title:_("%{user}'s Favorites",H),heading:_("%{user}'s Favorites",H)},profile:{title:_("%{name} (%{user}) on Twitter",H),heading:null}}}var E;if(C=="search"){E={title:_("Search - %{query}",{query:page.query})};var B=$("#side #saved_searches ul.sidebar-menu li.active");var I;if(B.length){var F=B.attr("id").replace("ss_","");I='<a href="/saved_searches/destroy/'+F+'" title="'+A+'" class="delete-search-link">'+_("Remove this saved search")+"</a></label>"}else{I='<a href="/saved_searches/create" class="save-search-link" title="'+A+'">'+_("Save this search")}I="<label>"+I+"</a></label>";if(page.searchResults){E.heading=I+_("Real-time results for <b>%{query}</b>",{query:A})}else{E.heading=I+_("No results for <b>%{query}</b>",{query:A})}}else{E=twttr.titles_and_headings[C]}if(E){var G=(C=="profile")?"":"Twitter / ";setDocumentTitle(G+E.title);if(E.heading){J.html(E.heading);J.parent("div").show()}else{J.parent("div").hide()}if(C=="search"){J.find(".save-search-link").isSaveSearchLink().end().find(".delete-search-link").isRemoveSearchLink()}}}$.fn.isSaveSearchLink=function(){return this.each(function(){var A=$(this);var B=$("#saved_searches");var C=B.find("ul.sidebar-menu");A.click(function(){if(C.find("li").length>=10){(new InfoNotification()).setMessage(_("You can only save ten searches. To remove a saved search, select the search and click <strong>remove this saved search</strong>.")).show();return false}var E=A.attr("title");var D=$('<li><a href="/search?q='+encodeURIComponent(E)+'" class="search-link" title="'+h(E)+'"><span>'+h(E)+"</span></a></li>");D.find("a").isSearchLink(SEARCH_CALLBACKS.savedSearchLink);D.fadeOut(1,function(){C.append(D);D.fadeIn(100)});if(B.hasClass("collapsed")){B.trigger("expand")}B.fadeIn();$("#side ul.sidebar-menu li").removeClass("active");$("#side #custom_search").removeClass("active");D.addClass("active");$.ajax({type:"POST",dataType:"json",url:"/saved_searches/create",data:{q:E,authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){A.replaceWith('<span class="loading">'+_("Save this search")+"</span>")},success:function(F){D.attr("id","ss_"+F.id);setTitleAndHeading("search")},error:function(F){(new InfoNotification()).setMessage(F.responseText).show();D.remove()}});return false})})};$.fn.isRemoveSearchLink=function(){return this.each(function(){var A=$(this);var C=A.attr("title");var B=A.attr("href");A.click(function(){var D=$("#side #saved_searches li a[title='"+C+"']").parent("li");D.fadeOut(100,function(){D.remove();var E=$("#saved_searches ul.sidebar-menu a");if(E.length==0){$("#saved_searches").hide()}setTitleAndHeading("search");$("#side #custom_search").addClass("active")});$.ajax({type:"POST",url:B,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:function(){A.replaceWith('<span class="loading">'+_("Remove this saved search")+"</span>")},error:function(){(new InfoNotification()).setMessage(_("Whoops! Something went wrong. Please refresh the page and try again!")).show()}});return false})})};function initializePage(A){if("home,search".indexOf(A)==-1){twttr.updateLocation(A)}initializeSidebar();$(".sidebar-menu a").isSidebarTab();$("#side form#sidebar_search").isSearchForm();$("#side .collapsible").isCollapsibleMenu();onPageChange(true);$(".in-page-link").isInPageLink();$(".saved-search-links li a").isSearchLink(SEARCH_CALLBACKS.savedSearchLink);$(".trends-links li a").isSearchLink(SEARCH_CALLBACKS.trendLink);$("#dm_tabs a").isDMTabLink();$("div.bulletin").isBulletin()}function initializeSidebar(){if($("#side ul.sidebar-menu li.active").length==0){var B=$("body").attr("id");var A=null;if(B=="search"){B=page.query;if(B){var C=$.grep($("#side ul.sidebar-menu li a"),function(D){return $(D).attr("title")==page.query})[0];if(C){A=$(C).parent("li")}else{$("#side #custom_search").addClass("active")}}}else{if(B){if(B=="sent"||B=="inbox"){B="direct_messages"}A=$("#side ul.sidebar-menu li#"+B+"_tab")}}if(A&&A.length){$(A.get(0)).addClass("active")}}}$.fn.isCollapsibleMenu=function(){function A(){var B=[];$("#side .collapsible").each(function(){var C=$(this);var E=C.find("h2.sidebar-title").attr("id");if(E){E=E.replace("_menu","")}else{return true}var D=C.hasClass("collapsed")?"C":"O";B.push(E+D)});$.cookie("menus",B.join("_"))}return this.each(function(){var D=$(this);var B=D.find("h2.sidebar-title");function F(G){$.ajax({type:"GET",url:G,dataType:"html",beforeSend:function(){D.addClass("loading")},success:function(H){D.find(".sidebar-menu").remove();B.after(H);C()},complete:function(){D.removeClass("loading")}})}function C(){var G=D.find(".sidebar-menu");D.find("#friends_view_all").fadeIn();G.slideDown(100,function(){D.removeClass("collapsed");A()})}function E(){var G=D.find(".sidebar-menu");D.find("a.xref").fadeOut(100);D.find("div#friends_view_all").fadeOut(100);console.log(G);G.slideUp(100,function(){D.addClass("collapsed");A()})}D.bind("expand",function(){C()});D.bind("collapse",function(){E()});B.click(function(H){if(H.target.nodeName.toLowerCase()=="a"){return true}var G=D.find("a.fetch-contents");if(D.hasClass("collapsed")){D.find("a.xref").fadeIn(100);if(G.length){F(G.attr("href"));G.remove()}else{C()}}else{E()}})})};$.fn.isSidebarTab=function(){return this.each(function(){var A=$(this);A.click(function(){if(A.parents("#side").length>0){$(window).scrollTop(0);$("#side ul.sidebar-menu li").removeClass("active");$("#side #custom_search").removeClass("active");A.parent("li").addClass("active")}}).bind("loading",null,function(B){A.parent("li").addClass("loading")}).bind("loaded",null,function(B){A.parent("li").removeClass("loading")}).bind("aborted",null,function(B){A.parent("li").removeClass("loading")})})};$.fn.isInPageLink=function(){return this.each(function(){var A=$(this);var C=A.parent("li");var B=C.attr("new_id")||C.attr("id").replace("_tab","");A.click(function(){if($.browser.msie){this.hideFocus=true}var D=A.attr("href");page.query="";if(page.isTimelineChange){page.currentTimelineChange.abort();page.$oldTimelineLink.trigger("aborted")}page.currentTimelineChange=$.ajax({type:"GET",url:D,dataType:"json",beforeSend:function(){page.isTimelineChange=true;A.trigger("loading");page.$oldTimelineLink=A},success:function(E){twttr.processJson(E);twttr.updateLocation(D);page.action_name=B;$("body").attr("id",B);if(B=="direct_messages"||B=="inbox"||B=="sent"){$("#direct_message_form").trigger("loadrecipients")}},complete:function(){$("#sidebar_search_q").val("").blur();onPageChange();$("body").addClass("replyable");initializeTimeline();A.trigger("loaded");page.isTimelineChange=false}});return false})})};$.fn.isBulletin=function(){return this.each(function(){var A=$(this);var B=A.find("a.close, a.hide");B.click(function(){A.fadeOut();return false})})};$.fn.isBrowserUpgradeBulletin=function(A){return this.each(function(){var B=$(this);B.find("a.close, a.hide").click(function(){$.cookie(A+"_upgrade","y")})})};$.fn.isDeviceFailBulletin=function(){return this.each(function(){var A=$(this);var B=A.find("a.hide-fail-notice, a.close, a.hide");var C=B.attr("id").replace("hide_device_","");B.click(function(){$.ajax({type:"POST",dataType:"text",url:"/devices/update/"+C,data:{authenticity_token:twttr.form_authenticity_token,"device[fail_alert]":"0",twttr:true},success:function(D){if(D.match(/success/)){A.fadeOut(200)}else{twttr.error()}},beforeSend:null,complete:null});return false})})};$.fn.isBouncingEmailBulletin=function(){return this.each(function(){var A=$(this);A.find("a.close, a.hide").click(function(){$.ajax({type:"POST",dataType:"text",url:"/bouncers/reset",data:{authenticity_token:twttr.form_authenticity_token,twttr:true},beforeSend:null,complete:function(){(new InfoNotification()).setMessage(_("Your email notifications should resume shortly.")).show()}});return false})})};$.fn.isNotificationSetting=function(){return this.each(function(){var B=$(this);var A=B.attr("id").replace("notify_on_","").replace("notify_off_","");B.click(function(){var C=B.attr("value");$.ajax({type:"POST",dataType:"text",url:"/friendships/device_"+C+"/"+A,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},success:function(D){if(D.match(/success/)){$(".follow-control").trigger("refresh",["notify_"+(C=="follow"?"on":"off")])}else{twttr.error()}}})})})};$.fn.isNudgable=function(){return this.each(function(){var A=$(this);A.click(function(){var B=A.parents("form");B.find("input[name=authenticity_token]").val(twttr.form_authenticity_token);B.submit();return false})})};$.fn.isSlugField=function(B,A){return this.bind("keyup",function(){var C=slug($(this).val());if(B){B.val(C)}if(A){A.text(C)}})};var slug=function(A){return A.toLowerCase().replace(/^[\W_]+/,"").replace(/\W/g,"-").replace(/-+/g,"-")};$.fn.isDeleteButton=function(A){if(!confirm(A)){return false}};$.fn.disable=function(){$(this).attr("disabled","disabled").addClass("disabled")};$.fn.enable=function(){$(this).removeAttr("disabled").removeClass("disabled")};$.fn.isFollowControl=function(){return this.each(function(){var I=$(this);var H=I.parents(".follow-actions");var A=I.find(".follow-button");var B=H.attr("class").split(" ").pop();var E=H.attr("id").replace("follow_actions_","");var C=H.find("#follow-toggle");var G=H.find(".remove-button");var D=$("#flash");H.find(".notify-input").isNotificationSetting();function F(J){$.ajax({type:"GET",dataType:"json",url:"/account/refresh_follow_control/"+E,data:{action_taken:J},success:function(K){twttr.processJson(K);$(".follow-control").isFollowControl()}})}A.click(function(){$.ajax({type:"POST",dataType:"json",url:"/friendships/create/"+E,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},success:function(J){if(J.result=="Bring"){twttr.error()}else{if(J.success){I.trigger("refresh",["followed"])}else{if(J.result!="242"){if(J.notice){var K=(new ErrorNotification());K.setMessage(J.notice);K.show()}else{twttr.error()}}}}},beforeSend:function(){$("#follow-flash").css("visibility","hidden");twttr.loading()},complete:twttr.loaded});return false});I.bind("refresh",function(J,K){F(K)});C.click(function(){$("#follow-flash").css("visibility","hidden");var J=H.find("#follow-details").toggle();if(J.css("display")=="block"){C.removeClass("closed").addClass("opened")}else{C.removeClass("opened").addClass("closed")}return false});G.click(function(){$.ajax({type:"POST",dataType:"json",url:"/friendships/destroy/"+E,data:{authenticity_token:twttr.form_authenticity_token,twttr:true},success:function(J){if(J.success){I.trigger("refresh",["removed"])}else{twttr.error()}}});return false})})};$.fn.isFollowRequestLinks=function(){return this.each(function(){var B=$(this);var D=B.hasClass("ifr-profile");var F=D?B.attr("id").replace("ifr_",""):"";var A=B.find("#accept_all_requests");var C=B.find("#deny_all_requests");function E(G){var H={decision:G,authenticity_token:twttr.form_authenticity_token};if(D){H.id=F;H.source="profile"}$.ajax({type:"POST",url:"/friend_requests/"+(D?"decision":"all"),dataType:"text",data:H,cache:false,success:function(I){if(I=="fail"){alert(_("Whoops! Something went wrong. Please refresh the page and try again!"))}else{if(D){B.fadeOut("medium",function(){B.html(I)});B.fadeIn("medium")}else{var J=window.location;uri=J.protocol+"//"+J.host+"/";window.location=uri}}}})}A.click(function(){E("accept");return false});C.click(function(){E("deny");return false})})};$.fn.isPasswordStrengthField=function(A,B){return this.each(function(){if(!A){return }if(!B){B={}}var H=$(this);var J=$(A);J.append('<span class="pstrength-text"></span>');var F=J.find(".pstrength-text");function E(K){J.children().each(function(){var L=$(this);if(L.hasClass("pstrength-text")){if(K){L.show()}else{L.hide()}}else{if(K){L.hide()}else{L.show()}}})}function I(K){var M=0;var L=B.minlength?B.minlength:6;if(K.length<L){return{score:K.length,message:_("Too short"),className:"password-invalid"}}if(B.username){var N=(typeof (B.username)=="function")?B.username():B.username;if(N&&(K.toLowerCase()==N.toLowerCase())){return{score:0,message:_("Too obvious"),className:"password-invalid"}}}if($.inArray(K.toLowerCase(),twttr.BANNED_PASSWORDS)!=-1){return{score:0,message:_("Too obvious"),className:"password-invalid"}}M+=K.length*4;M+=(D(1,K).length-K.length)*1;M+=(D(2,K).length-K.length)*1;M+=(D(3,K).length-K.length)*1;M+=(D(4,K).length-K.length)*1;if(K.match(/(.*[0-9].*[0-9].*[0-9])/)){M+=5}if(K.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){M+=5}if(K.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){M+=10}if(K.match(/([a-zA-Z])/)&&K.match(/([0-9])/)){M+=15}if(K.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&K.match(/([0-9])/)){M+=15}if(K.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&K.match(/([a-zA-Z])/)){M+=15}if(K.match(/^\w+$/)||K.match(/^\d+$/)){M-=10}if(M<0){M=0}if(M>100){M=100}if(M<34){return{score:M,message:_("Weak"),className:"password-weak"}}if(M<50){return{score:M,message:_("Good"),className:"password-good"}}if(M<75){return{score:M,message:_("Strong"),className:"password-strong"}}return{score:M,message:_("Very Strong"),className:"password-verystrong"}}function D(L,O){var K="";for(var N=0;N<O.length;N++){var P=true;for(var M=0;M<L&&(M+N+L)<O.length;M++){P=P&&(O.charAt(M+N)==O.charAt(M+N+L))}if(M<L){P=false}if(P){N+=L-1;P=false}else{K+=O.charAt(N)}}return K}function C(K){if(K&&J.hasClass(K)){return false}J.removeClass("password-weak").removeClass("password-good").removeClass("password-strong").removeClass("password-verystrong").removeClass("password-invalid");return true}function G(){var L=H.val();if(L.length==0){C();E(false)}else{if(L.length){E(true)}}if(L.length>0){var K=I(L);F.html(K.message);if(C(K.className)){J.addClass(K.className)}}}H.bind("show-password-meter",function(){J.show()});H.bind("hide-password-meter",function(){J.hide()});H.keyup(function(){G()});H.blur(function(){if(this.value.length==0){C();H.trigger("hide-password-meter")}});if(H.val()){G();J.show()}})};$.fn.isOAuthApplication=function(){return this.each(function(){var C=$(this);var B=C.attr("id").replace("oauth_application_","");var A=C.find(".revoke-access");A.click(function(){$.ajax({type:"POST",dataType:"json",url:"/oauth/revoke",data:{authenticity_token:twttr.form_authenticity_token,token:B,twttr:true},success:function(D){if(D.revoked){C.addClass("revoked")}else{C.removeClass("revoked")}A.text(D.label)}});return false})})};$.fn.screenName=function(){return $(this).find(".screen-name").text()||page.sessionUserScreenName};$.fn.userId=function(){var A;if(A=$(this).attr("id")){return A.replace("user_","")}else{return page.sessionUserId}};var searchSummize=function(E,B,F,A){page.query=E;var D=$("body#search #timeline :first-child").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,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 G=$("#side li.active a.search-link").parents("div#trends, div#saved_searches");var 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"));B.trigger("loaded");page.retainTimeline=null;page.isTimelineChange=false}})};var processSummize=function(B){var H=$(B);var L=$(".homepage #timeline").length;var C=L&&!$(".homepage #timeline li").length;var F=$("#timeline");var K=(page.query!="");$("body").attr("id","search");var M=1;$pageBtn=H.find(".paginator a.next");var E;if($pageBtn.length){E=$pageBtn.attr("href");E.match(/\?.*page=([0-9]+)/gi);M=RegExp.$1;M=M?parseInt(M):1}var D=[];if(K){if(!page.retainTimeline){$("#timeline").empty();$("#pagination").empty();$("#content .no-results").remove();$("#results_update").hide()}D=renderResultsFromSummize(H,F,L)}$("#container, #side_base").show();F.find(".msgtxt a").each(twttr.appendClassesToSearchResults);F.find("span.vcard a").addClass("tweet-url profile-pic");F.find(".status-body a,.vcard a").each(function(){var O=$(this);if(O.attr("href").match(/^\/search\?q=([^&]+)/)){O.removeAttr("target");var N=decodeURIComponent(RegExp.$1);O.attr("title",N);O.isSearchLink(N.match(/^#/)?SEARCH_CALLBACKS.hashtagLink:SEARCH_CALLBACKS.inResultsLink)}});if(page.searchResults=(D.length>0&&K)){if(!L){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(L)}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 J='<div class="no-results">'+_("Suggestions:")+"<ol>";for(var G=0;G<I.length;G++){J+="<li>"+_(I[G])+"</li>"}J+="</ol></div>";setTimeout(function(){$("#timeline_heading").after(J)},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 I=$(this);I.find(".location,.thread,.to_av,p.clearleft,.expand,#share").remove();var F=$(I.find(".avatar").get(0));F.replaceWith('<span class="thumb vcard author">'+F.html()+"</span>");var K=$(I.find(".info").get(0));var L,G,E;K.find("a.lit").each(function(){E=$(this).attr("href");var O=E.match(/\/(\w+)\/statuses\/(\d+)/);L=O[2];D.push(L);G=O[1]});var H=K.find(".source").remove();K.find("a").remove();K.html('<a href="'+E+'">'+K.html()+"</a>");K.append(H);var N='<span class="meta">'+K.html().replace(/\u00B7/g,"")+"</span>";K.remove();var M=$(I.find(".msg").get(0));M.replaceWith('<span class="status-body">'+($.browser.msie6?'<img src="/images/white.png" width="1" height="50" align="left">':"")+M.html().replace(/a>\s*:\s*<span/,"a> <span")+N+"</span>");var J=I.html();if(!A){J+='<span class="actions"><a href="#" class="fav-action non-fav" id="status_star_'+L+'"> &nbsp; </a><a href="/home?status=@'+G+"%20&in_reply_to_status_id="+L+"&in_reply_to="+G+'" class="reply"> &nbsp; </a></span>'}B.append('<li class="hentry status u-'+G+'" id="status_'+L+'">'+J+"</li>")});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.summizeRefresh||page.darkmodeSummizeRefresh){return }page.newResults=null;page.summizeRefresh=new Occasionally(20000,180000,function(){var A=false;$.ajax({dataType:"script",url:page.summizeSearchUrl,data:{q:page.query,since_id:page.maxId,refresh:true,callback:"processSummizeRefresh"},cache:false,callback:null})},function(){return page.newResults});page.summizeRefresh.start()}function processSummizeRefresh(A){if(decodeURIComponent(A.query).replace(/\+/g," ")==page.query&&A.total){page.maxId=A.max_id;page.summizeRefreshResults=(page.summizeRefreshResults||0)+A.total;$("#results_update").replace_text(/results? /,pluralize(page.summizeRefreshResults,"result ","results "));$("#new_results_count").html(page.summizeRefreshResults);$("#results_update:hidden").slideDown();$("#search_refresh_link").attr("title",page.query).attr("href","/search?q="+encodeURIComponent(page.query)).isSearchLink(SEARCH_CALLBACKS.refresh);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;searchSummize(page.query,B,SEARCH_CALLBACKS.more,C);B.addClass("loading").html("");return false})})};function onPageChange(A){var B=$("body").attr("id");setTitleAndHeading(B);if(!A){if(page.summizeRefresh){page.summizeRefresh.stop();page.summizeRefresh=null;page.summizeRefreshResults=null}$("#results_update").hide();$(".no-results").remove();$("#new_results_count").html("0")}twttr.trackPageView(B,(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")}})})};$.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")})})};$(document).ready(function(){$("#tweet_search_submit").click(function(){$("#tweet_search").submit()});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")}}};(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=12000}jQuery.inherits(ErrorNotification,Notification);/*
 * Copyright (c) 2007 Josh Bush (digitalbush.com)
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:

 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

/*
 * Version: Beta 1
 * Release: 2007-06-01
 */
(function($) {
	var map=new Array();
	$.Watermark = {
		ShowAll:function(){
			for (var i=0;i<map.length;i++){
				if(map[i].obj.val()==""){
					map[i].obj.val(map[i].text);
					map[i].obj.css("color",map[i].WatermarkColor);
				}else{
				    map[i].obj.css("color",map[i].DefaultColor);
				}
			}
		},
		HideAll:function(){
			for (var i=0;i<map.length;i++){
				if(map[i].obj.val()==map[i].text)
					map[i].obj.val("");
			}
		}
	}

	$.fn.Watermark = function(text,color) {
		if(!color)
			color="#aaa";
		return this.each(
			function(){
				var input=$(this);
				var defaultColor=input.css("color");
				map[map.length]={text:text,obj:input,DefaultColor:defaultColor,WatermarkColor:color};
				function clearMessage(){
					if(input.val()==text)
						input.val("");
					input.css("color",defaultColor);
				}

				function insertMessage(){
					if(input.val().length==0 || input.val()==text){
						input.val(text);
						input.css("color",color);
					}else
						input.css("color",defaultColor);
				}

				input.focus(clearMessage);
				input.blur(insertMessage);
				input.change(insertMessage);

				insertMessage();
			}
		);
	};
})(jQuery);
/*
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor', 'borderColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}

			fx.elem.style[attr] = "rgb(" + [
				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
			].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}

	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break;

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};

	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};

})(jQuery);
/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */

(function($) {

$.extend($.fn, {
	livequery: function(type, fn, fn2) {
		var self = this, q;

		// Handle different call patterns
		if ($.isFunction(type))
			fn2 = fn, fn = type, type = undefined;

		// See if Live Query already exists
		$.each( $.livequery.queries, function(i, query) {
			if ( self.selector == query.selector && self.context == query.context &&
				type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )
					// Found the query, exit the each loop
					return (q = query) && false;
		});

		// Create new Live Query if it wasn't found
		q = q || new $.livequery(this.selector, this.context, type, fn, fn2);

		// Make sure it is running
		q.stopped = false;

		// Run it immediately for the first time
		q.run();

		// Contnue the chain
		return this;
	},

	expire: function(type, fn, fn2) {
		var self = this;

		// Handle different call patterns
		if ($.isFunction(type))
			fn2 = fn, fn = type, type = undefined;

		// Find the Live Query based on arguments and stop it
		$.each( $.livequery.queries, function(i, query) {
			if ( self.selector == query.selector && self.context == query.context &&
				(!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )
					$.livequery.stop(query.id);
		});

		// Continue the chain
		return this;
	}
});

$.livequery = function(selector, context, type, fn, fn2) {
	this.selector = selector;
	this.context  = context || document;
	this.type     = type;
	this.fn       = fn;
	this.fn2      = fn2;
	this.elements = [];
	this.stopped  = false;

	// The id is the index of the Live Query in $.livequery.queries
	this.id = $.livequery.queries.push(this)-1;

	// Mark the functions for matching later on
	fn.$lqguid = fn.$lqguid || $.livequery.guid++;
	if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;

	// Return the Live Query
	return this;
};

$.livequery.prototype = {
	stop: function() {
		var query = this;

		if ( this.type )
			// Unbind all bound events
			this.elements.unbind(this.type, this.fn);
		else if (this.fn2)
			// Call the second function for all matched elements
			this.elements.each(function(i, el) {
				query.fn2.apply(el);
			});

		// Clear out matched elements
		this.elements = [];

		// Stop the Live Query from running until restarted
		this.stopped = true;
	},

	run: function() {
		// Short-circuit if stopped
		if ( this.stopped ) return;
		var query = this;

		var oEls = this.elements,
			els  = $(this.selector, this.context),
			nEls = els.not(oEls);

		// Set elements to the latest set of matched elements
		this.elements = els;

		if (this.type) {
			// Bind events to newly matched elements
			nEls.bind(this.type, this.fn);

			// Unbind events to elements no longer matched
			if (oEls.length > 0)
				$.each(oEls, function(i, el) {
					if ( $.inArray(el, els) < 0 )
						$.event.remove(el, query.type, query.fn);
				});
		}
		else {
			// Call the first function for newly matched elements
			nEls.each(function() {
				query.fn.apply(this);
			});

			// Call the second function for elements no longer matched
			if ( this.fn2 && oEls.length > 0 )
				$.each(oEls, function(i, el) {
					if ( $.inArray(el, els) < 0 )
						query.fn2.apply(el);
				});
		}
	}
};

$.extend($.livequery, {
	guid: 0,
	queries: [],
	queue: [],
	running: false,
	timeout: null,

	checkQueue: function() {
		if ( $.livequery.running && $.livequery.queue.length ) {
			var length = $.livequery.queue.length;
			// Run each Live Query currently in the queue
			while ( length-- )
				$.livequery.queries[ $.livequery.queue.shift() ].run();
		}
	},

	pause: function() {
		// Don't run anymore Live Queries until restarted
		$.livequery.running = false;
	},

	play: function() {
		// Restart Live Queries
		$.livequery.running = true;
		// Request a run of the Live Queries
		$.livequery.run();
	},

	registerPlugin: function() {
		$.each( arguments, function(i,n) {
			// Short-circuit if the method doesn't exist
			if (!$.fn[n]) return;

			// Save a reference to the original method
			var old = $.fn[n];

			// Create a new method
			$.fn[n] = function() {
				// Call the original method
				var r = old.apply(this, arguments);

				// Request a run of the Live Queries
				$.livequery.run();

				// Return the original methods result
				return r;
			}
		});
	},

	run: function(id) {
		if (id != undefined) {
			// Put the particular Live Query in the queue if it doesn't already exist
			if ( $.inArray(id, $.livequery.queue) < 0 )
				$.livequery.queue.push( id );
		}
		else
			// Put each Live Query in the queue if it doesn't already exist
			$.each( $.livequery.queries, function(id) {
				if ( $.inArray(id, $.livequery.queue) < 0 )
					$.livequery.queue.push( id );
			});

		// Clear timeout if it already exists
		if ($.livequery.timeout) clearTimeout($.livequery.timeout);
		// Create a timeout to check the queue and actually run the Live Queries
		$.livequery.timeout = setTimeout($.livequery.checkQueue, 20);
	},

	stop: function(id) {
		if (id != undefined)
			// Stop are particular Live Query
			$.livequery.queries[ id ].stop();
		else
			// Stop all Live Queries
			$.each( $.livequery.queries, function(id) {
				$.livequery.queries[ id ].stop();
			});
	}
});

// Register core DOM manipulation methods
$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove');

// Run Live Queries when the Document is ready
$(function() { $.livequery.play(); });


// Save a reference to the original init method
var init = $.prototype.init;

// Create a new init method that exposes two new properties: selector and context
$.prototype.init = function(a,c) {
	// Call the original init and save the result
	var r = init.apply(this, arguments);

	// Copy over properties if they exist already
	if (a && a.selector)
		r.context = a.context, r.selector = a.selector;

	// Set properties
	if ( typeof a == 'string' )
		r.context = c || document, r.selector = a;

	// Return the result
	return r;
};

// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091)
$.prototype.init.prototype = $.prototype;

})(jQuery);function Occasionally(A,D,C,B){this.interval=A;this.maxDecayTime=D;this.job=C;this.decayCallback=B;this.timesRun=0;this.decayRate=1;this.decayMultiplier=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;if(this.timesRun>=this.maxRequests){this.stop()}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();this.timesRun++;this.run()};twttr.countClick=function(){var A=twttr.createTrackingParameters(this);if(A.linkType=="hashtag"){twttr.ajaxClickCount(A)}else{twttr.redirectToTracker(this,A)}setTimeout(twttr.resetLink,100,this);return true};twttr.resetLink=function(B){var A=$(B).attr("original-href");if(A){B.href=A}};twttr.ajaxClickCount=function(A){jQuery.get("/link_click_count",A)};twttr.redirectToTracker=function(A,B){$(A).attr("original-href",A.href);A.href="/link_click_count?"+$.param(B)};twttr.createTrackingParameters=function(F){var B=$(F);var A=function(){var K=B.attr("class");var I=["hashtag","profile-pic","username","web"];for(var J in I){if(K.indexOf(I[J])!==-1){return I[J]}}}();var E=B.closest(".status").find(".meta").children("a").get(0).href.split("/");var G=E[E.length-1];var H=$('meta[name="session-userid"]');var D=H.attr("content")||-1;var C=twttr.form_authenticity_token||$('input[name="authenticity_token"]').attr("value");return{url:F.href,linkType:A,tweetId:G,userId:D,authenticity_token:C}};$(document).ready(function(){var A=$("#content a.tweet-url");A.live("click",twttr.countClick)});