$(document).ready(function(){$(".btn").each(function(){if(!($(this).hasClass("follow"))){var C=$(this);var D=C.text()||C.val();if($(":submit,:button",this)){C=$("<a>").insertAfter(this).addClass(this.className).attr("id",this.id);$(this).remove()}if(D=="Update"){C.text("").css({cursor:"pointer"}).prepend("<i></i>").append($("<span>").text(D).append('<img id="img-btn-blank" src="http://twitoaster.com/wp-content/themes/twitoaster/i/btn/img-btn-blank.gif" width="1" height="37" alt="" /><i></i><span></span>'))}else{C.text("").css({cursor:"pointer"}).prepend("<i></i>").append($("<span>").text(D).append("<i></i><span></span>"))}}});$(".btn").click(function(){if(!($(this).hasClass("follow"))){$(this).parents("form").submit()}});$('a[rel="external"]').click(function(){window.open($(this).attr("href"));return false});$('a[rel="external nofollow"]').click(function(){window.open($(this).attr("href"));return false})});function tweeter_fix_images(){$("img").each(function(){$(this).error(function(){if($(this).hasClass("avatar-24")){$(this).attr("src","http://twitoaster.com/wp-content/themes/twitoaster/i/error/avatar-24.png")}else{if($(this).hasClass("avatar-32")){$(this).attr("src","http://twitoaster.com/wp-content/themes/twitoaster/i/error/avatar-32.png")}else{if($(this).hasClass("avatar-48")){$(this).attr("src","http://twitoaster.com/wp-content/themes/twitoaster/i/error/avatar-48.png")}else{if($(this).hasClass("avatar-73")){$(this).attr("src","http://twitoaster.com/wp-content/themes/twitoaster/i/error/avatar-73.png")}}}}})})}function head_alert_block(J,H){var G=$("#head_alert_block");if(J=="more"){var I="Get more from Twitoaster!";var F='<span class="img-paging-list"><strong>Got a Blog?</strong> Make it more conversational with our <a href="http://wordpress.org/extend/plugins/twitoaster/">WordPress plugin</a></span>.';if(H>0){F=F+'<br /><span class="img-paging-list"><strong>Love Analytics?</strong> Pick our <a href="http://twitoaster.com/charts/'+H+'/">charts &amp; buttons</a> to gain more followers and replies</span>.'}F=F+'<br /><span class="img-paging-list"><strong>Need more?</strong> Take a look on our <a href="http://twitoaster.com/api/">API</a> and its conversational methods</span>.'}G.html('<div class="head_alert"><div class="head_alert-title">'+I+'</div><div class="head_alert-content">'+F+"</div></div>")}function textcounter(E,D,F){if(E.value.length>F){E.value=E.value.substring(0,F)}else{D.innerHTML=""+(F-E.value.length)+""}}function tweeter_chars_total(B){if(B.checked==false){return 140}else{return 420}}function tweeter_reply_init(B){document.getElementById("commentform").elements.comment.value=B;textcounter(document.getElementById("commentform").elements.comment,document.getElementById("tweeter_chars_left"),tweeter_chars_total(document.getElementById("commentform").elements.extended))}function tweeter_reply_main_init(B){if(document.getElementById("commentform").elements.comment.value==""){tweeter_reply_init("@"+B+" ")}}function tweet_extended_style(F){var E=$("textarea");if(E.css("height")=="40px"){E.animate({height:"80px"},{queue:false,duration:"slow"});if(F=="Update"){var D=$("#img-btn-blank")}}else{E.animate({height:"40px"},{queue:false,duration:"slow"});if(F=="Update"){var D=$("#img-btn-blank")}}}function category_update_show_desc(H){var L=$("#category-"+H).html();var I=$("#category-desc");var K=$("#category-btn");var G=$("#category-change");var J=$("#category-action");if(J.css("display")=="none"){G.slideUp("normal",function(){G.css("display","none");J.slideDown("normal")})}if(H!=0){I.slideUp("normal",function(){I.html(L);I.css("display","none");I.slideDown("normal")})}}function replaceAll(E,D,F){while(E.indexOf(D)!=-1){E=E.replace(D,F)}return E}function AccentToNoAccent(F){var G=new Array("À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","ý","þ","ÿ");var E=new Array("a","a","a","a","a","a","a","c","e","e","e","e","i","i","i","i","d","n","o","o","o","o","o","o","u","u","u","u","y","b","s","a","a","a","a","a","a","a","c","e","e","e","e","i","i","i","i","d","n","o","o","o","o","o","o","u","u","u","u","y","y","b","y");for(var H=0;H<G.length;H++){F=replaceAll(F,G[H],E[H])}return F}function InterditToNoInterdit(F){var G=new Array("@","[","]","<",">","*","~","=","^","$");var E="";for(var H=0;H<G.length;H++){F=replaceAll(F,G[H],E)}return F}function search_check_input(K){var N=$("#s");var H=$("#sa");var L=$("#st");var J=$("#sr");var I=$("#search_form");if((N.val()=="")||(N.css("color")=="rgb(153, 153, 153)")||(N.css("color")=="#999")){N.val("");N.css("color","rgb(85, 85, 85)");N.focus()}else{if(K=="submit"){var M=new Array();M[2]=N.val().toLowerCase();M[2]=AccentToNoAccent(M[2]);M[2]=InterditToNoInterdit(M[2]);if(J.val()=="yes"){M[3]="revelance/"}else{M[3]=""}M[2]=encodeURIComponent(M[2].replace(/\s{2,}/g," ").replace(/^\s+/g,"").replace(/\s+$/g,"")).replace(/%20/g,"-");if((L.attr("checked"))&&(L.val()=="yes")){M[1]="titles"}else{M[1]="conversations"}if((H.attr("checked"))&&(H.val())){M[0]=H.val()}else{M[0]="all"}window.location.href="http://twitoaster.com/search/"+M[0]+"/"+M[1]+"/"+M[2]+"/"+M[3]}}}function comment_highlight(D){var E=$("#div-comment-"+D);var F=E.children("p");F.animate({opacity:"0.1"},"normal","",function(){F.animate({opacity:"1"},"normal","",function(){F.animate({opacity:"0.1"},"normal","",function(){F.animate({opacity:"1"},"normal","",function(){F.animate({opacity:"0.1"},"normal","",function(){F.animate({opacity:"1"},"normal")})})})})})}function post_highlight(D){var C=$("#post-"+D);C.animate({opacity:"0.1"},"normal","",function(){C.animate({opacity:"1"},"normal","",function(){C.animate({opacity:"0.1"},"normal","",function(){C.animate({opacity:"1"},"normal","",function(){C.animate({opacity:"0.1"},"normal","",function(){C.animate({opacity:"1"},"normal")})})})})})}function update_sync_author(M){var N="http://twitoaster.com/wp-content/themes/twitoaster/i/loading-73.gif";jQuery("<img>").attr("src",N);var K=$("#sync-now");K.attr("onclick","return false;");var H=$("#sync-now-div");H.attr("onclick","return false;");var I=$("#sync-author-status");var L=$(".avatar-author");var J=L.attr("src");L.fadeOut("normal",function(){L.attr("src",N);L.css("display","none");L.fadeIn("normal")});$.post("http://twitoaster.com/"+M+"/",{update_sync_author:1},function(A){if(A=="0"){window.location.replace("http://twitoaster.com/"+M+"/")}else{L.attr("src",J);I.html(A)}},"html");return false}function twitter_oauth_login(){var B=$("#twitter-oauth-login");B.fadeOut("normal",function(){B.html('<span class="img-twitter-loading">Connecting to Twitter...</span>');B.css("display","none");B.fadeIn("normal")})}function twitter_follow(){var D=$("#form-twitter-follow");var C=$("#twitter-follow");D.submit();C.fadeOut("normal",function(){C.html('<span class="img-twitter-loading">Following...&nbsp;</span>');C.css("display","none");C.fadeIn("normal")})}function twitoaster_home_load(){var B=new Array();B["twitoaster-home-api"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-api.gif";B["twitoaster-home-over-api"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-over-api.gif";jQuery("<img>").attr("src",B["twitoaster-home-over-api"]);B["twitoaster-home-guide"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-guide.gif";B["twitoaster-home-over-guide"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-over-guide.gif";jQuery("<img>").attr("src",B["twitoaster-home-over-guide"]);B["twitoaster-home-press"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-press.gif";B["twitoaster-home-over-press"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-over-press.gif";jQuery("<img>").attr("src",B["twitoaster-home-over-press"]);B["twitoaster-home-wordpress"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-wordpress.gif";B["twitoaster-home-over-wordpress"]="http://twitoaster.com/wp-content/themes/twitoaster/i/home/twitoaster-home-over-wordpress.gif";jQuery("<img>").attr("src",B["twitoaster-home-over-wordpress"]);return B}function twitoaster_help_load(){var B=new Array();for(i=1;i<=5;i++){B[i]="http://twitoaster.com/wp-content/themes/twitoaster/i/help/530-"+i+".jpg";jQuery("<img>").attr("src",B[i])}return B}function twitoaster_help_change(D){var C=$("#img-help-current");if(C.length>0){C.fadeOut("normal",function(){C.attr("src",img_help[D]);C.css("display","none");C.fadeIn("normal")})}else{if(D==1){window.location.replace("http://twitoaster.com/quick-guide/")}else{window.location.replace("http://twitoaster.com/quick-guide/"+D+"/")}}}function tweet_replies_style(D){var E=$("#link-"+D);var F=E.parent("span");F.css("cursor","pointer");E.css("color","#d54e21");F.css("border","1px solid #999")}function tweet_replies_unstyle(D){var E=$("#link-"+D);var F=E.parent("span");E.css("color","#777");F.css("border","1px solid #ccc")}function tweet_replies(J){var H=$("#link-"+J);var I=H.parent("span");var L=$("#avatar-post-"+J);var K=$("#post-"+J);var G=$("#line-"+J);if(I.css("opacity")=="1"){I.fadeOut("slow",function(){L.animate({width:"48px",height:"48px"},{queue:false,duration:"slow"})});$.post(H.attr("href").replace("/#comments","/"),{tweet_replies:J},function(B){G.css("display","none");K.after($(B));var A=$(".commentlist");A.slideDown("slow");tweeter_fix_images()},"html")}return false}function tweet_unreplies(N){var K=$("#link-"+N);var M=K.parent("span");var P=$("#avatar-post-"+N);var O=$("#post-"+N);var I=$("#line-"+N);if(I.css("display")=="none"){var L=$("#replies-to-"+N);var J=L.children(".commentlist");J.slideUp("slow",function(){L.remove();I.css("display","")});P.animate({width:"32px",height:"32px"},"slow","",function(){M.fadeIn("slow");M.css("display","")})}return false}addComment={moveForm:function(Z,Y,Q,X,N){var R=this,P,V=R.I(Z),O=R.I(Q),U=R.I("cancel-comment-reply-link"),S=R.I("comment_parent"),T=R.I("comment_post_ID");if(!V||!O||!U||!S){return }R.respondId=Q;X=X||false;tweeter_reply_init(N);if(!R.I("wp-temp-form-div")){P=document.createElement("div");P.id="wp-temp-form-div";P.style.display="none";O.parentNode.insertBefore(P,O)}V.parentNode.insertBefore(O,V.nextSibling);if(T&&X){T.value=X}S.value=Y;U.style.display="";U.onclick=function(){tweeter_reply_init("");var B=addComment,C=B.I("wp-temp-form-div"),A=B.I(B.respondId);if(!C||!A){return }B.I("comment_parent").value="0";C.parentNode.insertBefore(A,C);C.parentNode.removeChild(C);this.style.display="none";this.onclick=null;return false};try{R.I("comment").focus()}catch(W){}return false},I:function(B){return document.getElementById(B)}};