var TB_version="3.1.10",TB_rateLimitData,TB_tmp,TB_mode="widget",TB_started=false,TB_monthNumber={
    Jan:1,
    Feb:2,
    Mar:3,
    Apr:4,
    May:5,
    Jun:6,
    Jul:7,
    Aug:8,
    Sep:9,
    Oct:10,
    Nov:11,
    Dec:12
},TB_timePeriods=new Array("second","minute","hour","day","week","month","year","decade"),TB_timePeriodLengths=new Array("60","60","24","7","4.35","12","10"),TB_tweetsToCache=new Object(),TB_allSources=new Array(),jQnc=jQuery.noConflict();
function TB_start(){
    if(TB_started){
        return
    }else{
        TB_started=true
        }
        if(typeof(TB_config)=="undefined"){
        TB_showMessage(null,"noconf","No configuration settings found.",true);
        return
    }
    TB_config.widgets=new Object();
    jQuery.each(jQuery("form.tb-widget-configuration"),function(d,f){
        var b=f.id,e,c,a=false;
        if(jQuery("#"+f.id).next().length>0){
            if(jQuery("#"+f.id).next().attr("id")!=""){
                if(jQuery("#"+f.id).next().attr("id").indexOf("-mc")>0){
                    e=b.substr(0,b.length-2)
                    }else{
                    a=true;
                    e=b
                    }
                }else{
            a=true;
            e=b
            }
        }else{
        a=true;
        e=b
        }
        TB_config.widgets[e]=new Object;
    jQuery.each(jQuery("#"+b).children("input"),function(g,h){
        TB_config.widgets[e][h.name]=h.value
        });
    jQuery.each(jQuery("#"+b+" > div").children("input"),function(g,h){
        TB_config.widgets[e][h.name]=h.value
        });
    if(typeof(TB_config.widgets[e].sources)!="undefined"){
        TB_allSources=TB_allSources.concat(TB_config.widgets[e].sources.split(","))
        }
        if(a){
        c='<div id="'+e+'-mc"><div class="tb_header"><img class="tb_twitterlogo" src="'+TB_pluginPath+'/img/twitter-logo.png" alt="Twitter Logo" /><div class="tb_tools" style="background-image:url('+TB_pluginPath+'/img/bg_sm.png)"><a class="tb_infolink" href="http://kirill-novitchenko.com" title="Tweet Blender by Kirill Novitchenko" style="background-image:url('+TB_pluginPath+'/img/info-kino.png)"> </a><a class="tb_refreshlink" href="javascript:TB_blend(\''+e+'\');" title="Refresh Tweets"><img src="'+TB_pluginPath+'/img/ajax-refresh-icon.gif" alt="Refresh" /></a></div></div>';
        if(TB_config.general_seo_tweets_googleoff){
            tweetHTML+='<!--googleoff: index--><div class="tb_tweetlist"></div><!--googleon: index-->'
            }else{
            c+='<div class="tb_tweetlist"></div>'
            }
            c+='<div class="tb_footer">';
        if(!TB_config.archive_is_disabled){
            if(TB_config.widgets[e].viewMoreUrl){
                c+='<a class="tb_archivelink" href="'+TB_config.widgets[e].viewMoreUrl+'">view more &raquo;</a>'
                }else{
                if(TB_config.default_view_more_url){
                    c+='<a class="tb_archivelink" href="'+TB_config.default_view_more_url+'">view more &raquo;</a>'
                    }
                }
        }
    c+="</div></div>";
jQuery("#"+f.id).after(c)
}
});
if(TB_getObjectSize(TB_config.widgets)<1){
    return
}
TB_allSources=TB_getUniqueElements(TB_allSources);
jQuery("div.tb_tools").css("background-image","url("+TB_pluginPath+"/img/bg.png)").width(56);
jQuery("a.tb_infolink").css("display","inline").css("margin-right","11px");
if(typeof(jQuery.toJSON)=="undefined"&&typeof(jQnc.toJSON)=="function"){
    jQuery.toJSON=jQnc.toJSON
    }
    if(!TB_config.default_view_more_url){
    jQuery("a.defaultUrl").hide()
    }
    if(typeof(TB_config)!="undefined"){
    if(TB_config.advanced_reroute_on){
        TB_config.rate_limit_url={
            url:TB_pluginPath+"/ws.php?action=rate_limit_status",
            dtype:"json"
        }
    }else{
    TB_config.rate_limit_url={
        url:"http://twitter.com/account/rate_limit_status.json",
        dtype:"jsonp"
    }
}
for(widgetId in TB_config.widgets){
    if(typeof(TB_config.widgets[widgetId].sources)=="undefined"||TB_config.widgets[widgetId].sources==""){
        TB_showMessage(widgetId,"nosrc","Twitter sources to blend are not defined",true)
        }else{
        TB_initInfoBox(widgetId);
        TB_makeAjaxURLs(widgetId);
        TB_config.widgets[widgetId]["minTweetId"]=0;
        TB_config.widgets[widgetId]["maxTweetId"]=0;
        if(jQuery("#"+widgetId+"-mc > div.tb_tweetlist > div.tb_tweet").size()>0){
            if(TB_tmp=parseInt(jQuery("#"+widgetId+"-mc > div.tb_tweetlist > div:last").attr("id").substr(1))){
                TB_config.widgets[widgetId]["minTweetId"]=TB_tmp
                }
                if(TB_tmp=parseInt(jQuery("#"+widgetId+"-mc > div.tb_tweetlist > div:first").attr("id").substr(1))){
                TB_config.widgets[widgetId]["maxTweetId"]=TB_tmp
                }
                if(typeof(TB_customFormat)=="function"){
                jQuery.each(jQuery("#"+widgetId+"-mc > div.tb_tweetlist").children("div"),function(a,b){
                    jQuery("#"+b.id).html(TB_customFormat(b.innerHTML))
                    })
                }
            }
        TB_config.widgets[widgetId]["tweetsShown"]=jQuery("#"+widgetId+"-mc > div.tb_tweetlist").children("div").size();
    jQuery.each(jQuery("#"+widgetId+"-mc > div.tb_tweetlist").children("div"),function(a,b){
        TB_wireMouseOver(b.id.substr(1))
        });
    jQuery("a.tb_photo, .tb_author a, .tb_msg a, .tweet-tools a, .tb_infolink").click(function(){
        this.target="_blank"
        });
    if(parseInt(TB_config.widgets[widgetId].refreshRate)>1){
        setInterval("TB_blend('"+widgetId+"');",parseInt(TB_config.widgets[widgetId].refreshRate)*1000)
        }
        if(parseInt(TB_config.widgets[widgetId].refreshRate)==1||TB_config.widgets[widgetId].tweetsShown<TB_config.widgets[widgetId].tweetsNum){
        TB_blend(widgetId)
        }
    }
}
}else{
    TB_showMessage(null,"noconf","Cannot retrieve Tweet Blender configuration options",true);
    jQuery("a.tb_refreshlink").remove();
    jQuery("div.tb_tools").css("background-image","url("+TB_pluginPath+"/img/bg_sm.png)").width(28)
    }
    $(".tb_tweet:odd").css("background-color", "#f5f6f6");
}
function TB_makeAjaxURLs(d){
    var f=new Array(),e=new Array(),b=new Array(),c="",a="";
    TB_config.widgets[d]["ajaxURLs"]=new Array();
    jQuery.each(TB_config.widgets[d].sources.split(","),function(g,h){
        h=jQuery.trim(h);
        if(h.charAt(0)=="!"){
            if(TB_config.widgets[d].favoritesOnly){
                TB_addAjaxUrl(d,"favorites",h.substr(2),h,1)
                }else{
                if(TB_config.advanced_no_search_api){
                    TB_addAjaxUrl(d,"user_timeline","screen_name="+h.substr(2),h,1)
                    }else{
                    TB_addAjaxUrl(d,"search","&from="+h.substr(2),h,1)
                    }
                }
        }else{
        if(h.charAt(0)=="@"&&h.indexOf("/")==-1){
            if(TB_config.widgets[d].favoritesOnly){
                TB_addAjaxUrl(d,"favorites",h.substr(1),h,0)
                }else{
                if(h.indexOf("|")>1){
                    c=h.substr(1,h.indexOf("|")-1);
                    a=h.substr(h.indexOf("|")+1);
                    if(a.charAt(0)=="#"){
                        TB_addAjaxUrl(d,"search","&from="+c+"&tag="+a.substr(1),h,0)
                        }else{
                        TB_addAjaxUrl(d,"search","&from="+c+"&ors="+a,h,0)
                        }
                    }else{
                if(TB_config.advanced_no_search_api){
                    TB_addAjaxUrl(d,"user_timeline","screen_name="+h.substr(1),h,0)
                    }else{
                    if(escape(e.join(" OR ")).length+h.length>140){
                        TB_addAjaxUrl(d,"search","&q="+escape(e.join(" OR ")),escape("@"+b.join(",@")),0);
                        b=new Array();
                        e=new Array()
                        }
                        b.push(h.substr(1));
                    if(TB_config.filter_hide_mentions){
                        e.push("from:"+h.substr(1))
                        }else{
                        e.push(h+" OR from:"+h.substr(1))
                        }
                    }
            }
    }
}else{
    if(h.charAt(0)=="@"&&h.indexOf("/")>1){
        if(TB_config.advanced_reroute_on||TB_config.reached_api_limit){
            TB_addAjaxUrl(d,"list_timeline","&user="+h.substr(1,h.indexOf("/")-1)+"&list="+h.substr(h.indexOf("/")+1),h,0)
            }else{
            TB_addAjaxUrl(d,"list_timeline",h.substr(1,h.indexOf("/")-1)+"/lists/"+h.substr(h.indexOf("/")+1)+"/statuses.json",h,0)
            }
        }else{
    if(h!=""){
        if(escape(f.join(" ")).length+h.length>140){
            TB_addAjaxUrl(d,"search","&ors="+escape(f.join(" ")),escape(f.join(",")),0);
            f=new Array()
            }
            f.push(h)
        }
    }
}
}
});
if(f.length>0){
    TB_addAjaxUrl(d,"search","&ors="+escape(f.join(" ")),escape(f.join(",")),0)
    }
    if(b.length>0){
    TB_addAjaxUrl(d,"search","&q="+escape(e.join(" OR ")),escape("@"+b.join(",@")),0)
    }
}
function TB_addAjaxUrl(f,c,e,b,g){
    var i="",d="",h="",a="";
    if(typeof(TB_config.filter_lang)!="undefined"&&TB_config.filter_lang.length==2){
        i="&lang="+TB_config.filter_lang
        }
        if(typeof(TB_config.filter_bad_strings)!="undefined"&&TB_config.filter_bad_strings.length>0){
        h="&nots="+escape(TB_config.filter_bad_strings.split(",").join(" "))
        }
        if(g){
        a="&private=1"
        }
        if(c=="search"&&(TB_config.advanced_reroute_on||TB_config.reached_api_limit||g)){
        TB_config.widgets[f]["ajaxURLs"].push({
            url:TB_pluginPath+"/ws.php?action=search"+e+i+d+h+a,
            source:b,
            privateSrc:g,
            dtype:"json"
        })
        }else{
        if(c=="search"){
            TB_config.widgets[f]["ajaxURLs"].push({
                url:"http://search.twitter.com/search.json?"+d+e+i+h,
                source:b,
                privateSrc:0,
                dtype:"jsonp"
            })
            }else{
            if(c=="list_timeline"&&(TB_config.advanced_reroute_on||TB_config.reached_api_limit)){
                TB_config.widgets[f]["ajaxURLs"].push({
                    url:TB_pluginPath+"/ws.php?action=list_timeline"+e,
                    source:b,
                    privateSrc:0,
                    dtype:"json"
                })
                }else{
                if(c=="list_timeline"){
                    TB_config.widgets[f]["ajaxURLs"].push({
                        url:"http://api.twitter.com/1/"+e,
                        source:b,
                        privateSrc:0,
                        dtype:"jsonp"
                    })
                    }else{
                    if(c=="user_timeline"&&(TB_config.advanced_reroute_on||TB_config.reached_api_limit||g)){
                        TB_config.widgets[f]["ajaxURLs"].push({
                            url:TB_pluginPath+"/ws.php?action=user_timeline&"+e,
                            source:b,
                            privateSrc:0,
                            dtype:"json"
                        })
                        }else{
                        if(c=="user_timeline"){
                            TB_config.widgets[f]["ajaxURLs"].push({
                                url:"http://twitter.com/statuses/user_timeline.json?"+e,
                                source:b,
                                "private":0,
                                dtype:"jsonp"
                            })
                            }else{
                            if(c=="favorites"&&(TB_config.advanced_reroute_on||TB_config.reached_api_limit||g)){
                                TB_config.widgets[f]["ajaxURLs"].push({
                                    url:TB_pluginPath+"/ws.php?action=favorites&user="+e,
                                    source:b,
                                    privateSrc:0,
                                    dtype:"json"
                                })
                                }else{
                                if(c=="favorites"){
                                    TB_config.widgets[f]["ajaxURLs"].push({
                                        url:"http://api.twitter.com/1/favorites/"+e+".json",
                                        source:b,
                                        "private":0,
                                        dtype:"jsonp"
                                    })
                                    }
                                }
                        }
                }
        }
}
}
}
}
function TB_initInfoBox(a){
    TB_config.widgets[a].sourcesHTML="";
    TB_config.widgets[a].sourcesCount=0;
    jQuery.each(TB_config.widgets[a].sources.split(","),function(b,c){
        if(c.charAt(0)=="!"){
            c=c.substr(1)
            }
            TB_config.widgets[a].sourcesHTML+='<a href="';
        if(c.charAt(0)=="@"){
            TB_config.widgets[a].sourcesHTML+="http://twitter.com/"+c.substr(1)
            }else{
            TB_config.widgets[a].sourcesHTML+="http://search.twitter.com/search?q="+escape(c)
            }
            TB_config.widgets[a].sourcesHTML+='">'+c+"</a> ";
        TB_config.widgets[a].sourcesCount++
    });
    jQuery("#"+a+"-mc").children("div.tb_header").children("img.tb_twitterlogo").click(function(){
        TB_showMessage(a,"info","Powered by Tweet Blender plugin v"+TB_version+" blending "+TB_config.widgets[a].sourcesHTML,false)
        })
    }
    function TB_blend(a){
    TB_showLoader(a);
    if(!TB_config.advanced_reroute_on&&!TB_config.reached_api_limit){
        jQuery.ajax({
            url:TB_config.rate_limit_url.url,
            dataType:TB_config.rate_limit_url.dtype,
            success:function(d){
                if(d.error||d.remaining_hits<TB_config.widgets[a].ajaxURLs.length){
                    TB_config.reached_api_limit=true;
                    if(!TB_config.advanced_disable_cache){
                        var e=1000*60*5,c=new Date(),b;
                        if(d.reset_time){
                            b=TB_str2date(d.reset_time);
                            e=Math.round(b.getTime()-c.getTime())
                            }
                            setTimeout("TB_config.reached_api_limit=false;TB_makeAjaxURLs('"+a+"');TB_blend('"+a+"');",e);
                        TB_makeAjaxURLs(a);
                        TB_getTweets(a)
                        }else{
                        if(TB_config.advanced_show_limit_msg){
                            TB_showMessage(a,"limit","You reached Twitter API connection limit. Next reset "+TB_verbalTime(TB_str2date(d.reset_time)),false)
                            }
                        }
                }else{
            TB_getTweets(a)
            }
        },
    error:function(){
        TB_getTweets(a)
        }
    })
}else{
    TB_getTweets(a)
    }
}
function TB_checkComplete(a){
    if(TB_config.widgets[a].urlsDone==TB_config.widgets[a].ajaxURLs.length){
        TB_hideLoader(a);
        if(jQuery("#"+a+"-mc > div.tb_tweetlist").children("div").size()==0){
            TB_showMessage(a,"notweets","No tweets found for "+TB_config.widgets[a].sourcesHTML,true)
            }else{
            TB_hideMessage(a,"notweets");
            if(!TB_config.advanced_disable_cache){
                TB_cacheNewTweets()
                }
            }
    }
}
function TB_getTweets(a){
    TB_config.widgets[a]["urlsDone"]=0;
    jQuery.each(TB_config.widgets[a].ajaxURLs,function(c,b){
        jQuery.ajax({
            dataType:b.dtype,
            url:b.url,
            success:function(d){
                if(d.error){
                    if(d.error.indexOf("Rate limit exceeded")==0){
                        TB_config.reached_api_limit=true
                        }
                        TB_config.widgets[a].urlsDone++;
                    TB_checkComplete(a)
                    }else{
                    TB_addTweets(a,d,b)
                    }
                },
        error:function(){
            TB_config.widgets[a].urlsDone++;
            TB_checkComplete(a)
            }
        })
    })
}
function TB_cacheNewTweets(){
    if(TB_getObjectSize(TB_tweetsToCache)>0){
        jQuery.ajax({
            url:TB_pluginPath+"/ws.php?action=cache_data",
            type:"POST",
            dataType:"json",
            data:({
                tweets:jQuery.toJSON(TB_tweetsToCache)
                }),
            success:function(a){
                if(!a.error){
                    TB_tweetsToCache=new Object()
                    }
                }
        })
}
}
function TB_addTweets(d,c,a){
    var f=c,b,e=false;
    if(typeof(c.results)!="undefined"){
        f=c.results
        }
        jQuery.each(f,function(h,k){
        e=false;
        b=jQuery.extend(true,{},k);
        if(TB_config.filter_hide_replies&&(k.in_reply_to_user_id||k.to_user_id)){
            return true
            }
            if(jQuery("#t"+k.id).length>0){
            return true
            }else{
            if(TB_config.widgets[d].tweetsShown==0){
                TB_config.widgets[d].tweetsShown++;
                TB_config.widgets[d].minTweetId=k.id;
                TB_config.widgets[d].maxTweetId=k.id;
                jQuery("#"+d+"-mc > div.tb_tweetlist").append(TB_makeHTML(k));
                e=true
                }else{
                if(TB_config.widgets[d].minTweetId>0&&k.id<TB_config.widgets[d].minTweetId){
                    if(TB_config.widgets[d].tweetsShown>=TB_config.widgets[d].tweetsNum){
                        return false
                        }else{
                        TB_config.widgets[d].tweetsShown++;
                        jQuery("#"+d+"-mc > div.tb_tweetlist").append(TB_makeHTML(k));
                        TB_config.widgets[d].minTweetId=k.id;
                        if(TB_config.widgets[d].tweetsNum==1){
                            TB_config.widgets[d].maxTweetId=k.id
                            }
                            e=true
                        }
                    }else{
                if(TB_config.widgets[d].maxTweetId>0&&k.id>TB_config.widgets[d].maxTweetId){
                    TB_enforceLimit(d);
                    jQuery("#"+d+"-mc > div.tb_tweetlist").prepend(TB_makeHTML(k));
                    TB_config.widgets[d].tweetsShown++;
                    TB_config.widgets[d].maxTweetId=k.id;
                    if(TB_config.widgets[d].tweetsNum==1){
                        TB_config.widgets[d].minTweetId=k.id
                        }
                        e=true
                    }else{
                    TB_enforceLimit(d);
                    var g=TB_config.widgets[d].maxTweetId,j;
                    jQuery("#"+d+"-mc > div.tb_tweetlist > div.tb_tweet").each(function(l,m){
                        j=m.id.substr(1);
                        if(k.id<g&&k.id>j){
                            jQuery("#t"+g).after(TB_makeHTML(k));
                            TB_config.widgets[d].tweetsShown++;
                            return false
                            }
                            g=j
                        });
                    if(jQuery("#t"+k.id).length<=0){
                        jQuery("#t"+TB_config.widgets[d].minTweetId).after(TB_makeHTML(k));
                        TB_config.widgets[d].minTweetId=k.id;
                        if(TB_config.widgets[d].tweetsNum==1){
                            TB_config.widgets[d].maxTweetId=k.id
                            }
                            TB_config.widgets[d].tweetsShown++
                    }
                    e=true
                    }
                }
        }

    }
if(e&&!TB_config.advanced_disable_cache){
    TB_tweetsToCache[k.id]={
        s:a.source,
        p:a.privateSrc,
        t:b
    }
}
TB_wireMouseOver(k.id)
});
TB_config.widgets[d].urlsDone++;
jQuery("a.tb_photo, .tb_author a, .tb_msg a, .tweet-tools a, .tb_infolink").click(function(){
    this.target="_blank"
    });
TB_checkComplete(d);

}
function TB_wireMouseOver(a){
    if(TB_config[TB_mode+"_show_reply_link"]||TB_config[TB_mode+"_show_follow_link"]){
        jQuery("#t"+a).hover(function(){
            jQuery(this).find("div:last").slideDown()
            },function(){
            jQuery(this).find("div:last").slideUp()
            })
        }
    }
function TB_enforceLimit(b){
    if(TB_config.widgets[b].tweetsShown==TB_config.widgets[b].tweetsNum){
        var a=jQuery("#t"+TB_config.widgets[b].minTweetId),c=a.prev("div.tb_tweet");
        a.remove();
        TB_config.widgets[b].tweetsShown--;
        delete TB_tweetsToCache[TB_config.widgets[b].minTweetId];
        if(TB_config.widgets[b].tweetsShown==0){
            TB_config.widgets[b].minTweetId=0;
            TB_config.widgets[b].maxTweetId=0;
            return
        }else{
            if(c.length>0){
                TB_config.widgets[b].minTweetId=parseInt(c.attr("id").substr(1))
                }
            }
    }
}
function TB_makeHTML(e){
    var d="",b,c,a;
    if(typeof(e.user)=="undefined"){
        if(e.from_user){
            e.user={
                screen_name:e.from_user
                }
            }else{
        e.user={
            screen_name:""
        }
    }
}
b='<div class="tb_tweet" id="t'+e.id+'">';
if(TB_config.widget_show_photos){
    if(!e.user.profile_image_url&&e.profile_image_url){
        e.user.profile_image_url=e.profile_image_url
        
        }
        e.user.profile_image_url = e.user.profile_image_url.replace('normal', 'bigger');
        d+='<a class="tb_photo" rel="nofollow" href="http://twitter.com/'+e.user.screen_name+'"><div class="overlay"></div>';
    d+='<img src="'+e.user.profile_image_url+'" alt="'+e.user.screen_name+'" />';
    d+="</a>"
    }
    if(TB_config.widget_show_user){
    d+='<span class="tb_author"><a rel="nofollow" href="http://twitter.com/'+e.user.screen_name+'">'+e.user.screen_name+"</a>: </span> "
    }
    if(TB_config.general_link_urls){
    e.text=e.text.replace(/(https?:\/\/\S+)/gi,'<a rel="nofollow" href="$1">$1</a>')
    }
    if(TB_config.general_link_screen_names){
    e.text=e.text.replace(/\@([\w]+)/gi,'<a rel="nofollow" href="http://twitter.com/$1">@$1</a>')
    }
    if(TB_config.general_link_hash_tags){
    e.text=e.text.replace(/\#([\w\-]+)/gi,'<a rel="nofollow" href="http://search.twitter.com/search?q=%23$1">#$1</a>')
    }
    d+='<span class="tb_msg">'+e.text+"</span><br/>";
if(!TB_config.general_seo_tweets_googleoff&&TB_config.general_seo_footer_googleoff){
    d+="<!--googleoff: index-->"
    }
    d+=' <span class="tb_tweet-info">';
d+='<a rel="nofollow" href="http://twitter.com/'+e.user.screen_name+"/statuses/"+e.id+'">';
a=TB_str2date(e.created_at);
if(TB_config.general_timestamp_format){
    if(typeof(jQuery.PHPDate)!="undefined"){
        d+=jQuery.PHPDate(TB_config.general_timestamp_format,a)
        }else{
        if(typeof(jQnc.PHPDate)!="undefined"){
            d+=jQnc.PHPDate(TB_config.general_timestamp_format,a)
            }
        }
}else{
    d+=TB_verbalTime(a)
    }
    d+="</a>";
if(TB_config.widget_show_source&&e.source){
    d+=" from ";
    if(e.source.indexOf("&lt;")>=0){
        d+=jQuery("<textarea/>").html(e.source).val()
        }else{
        d+=e.source
        }
    }
d+="</span>";
if(!TB_config.general_seo_tweets_googleoff&&TB_config.general_seo_footer_googleoff){
    d+="<!--googleon: index-->"
    }
    if(TB_config.widget_show_follow_link||TB_config.widget_show_reply_link){
    d+='<div class="tweet-tools" style="display:none;">';
    if(TB_config.widget_show_reply_link){
        d+='<a rel="nofollow" href="http://twitter.com/home?status=@'+e.user.screen_name+"%20&in_reply_to_status_id="+e.id+"&in_reply_to="+e.user.screen_name+'">reply</a>'
        }
        if(TB_config.widget_show_follow_link&&TB_config.widget_show_reply_link){
        d+=" | "
        }
        if(TB_config.widget_show_follow_link){
        d+='<a rel="nofollow" href="http://twitter.com/'+e.user.screen_name+'">follow '+e.user.screen_name+"</a>"
        }
        d+="</div>"
    }
    c="</div>\n";
if(typeof(TB_customFormat)=="function"){
    d=TB_customFormat(d)
    }
    return b+d+c
}
function TB_showLoader(a){
    if(TB_config.widgets[a].tweetsShown==0){
        TB_showMessage(a,"loading","Loading tweets...",true)
        }
        jQuery("#"+a+"-mc > div.tb_header > div.tb_tools > a.tb_refreshlink > img").attr("src",TB_pluginPath+"/img/ajax-refresh.gif");
    jQuery("#"+a+"-mc > div.tb_header > div.tb_tools > a.tb_refreshlink").addClass("loading")
    }
    function TB_hideLoader(a){
    TB_hideMessage(a,"loading");
    jQuery("#"+a+"-mc > div.tb_header > div.tb_tools > a.tb_refreshlink > img").attr("src",TB_pluginPath+"/img/ajax-refresh-icon.gif");
    jQuery("#"+a+"-mc > div.tb_header > div.tb_tools > a.tb_refreshlink").removeClass("loading")
    }
    function TB_showMessage(b,a,d,c){
    if(!b){
        jQuery("div.tb_tweetlist").before('<div id="msg_'+a+'" class="tb_msg" style="display:none;">'+d+"</div>");
        return
    }
    if(!jQuery("#"+b+"-mc").children("#msg_"+a).length){
        jQuery("#"+b+"-mc").children("div.tb_tweetlist").before('<div id="msg_'+a+'" class="tb_msg" style="display:none;">'+d+"</div>");
        jQuery("#"+b+"-mc").children("#msg_"+a).slideDown();
        if(!c){
            setTimeout('TB_hideMessage("'+b+'","'+a+'")',8000)
            }
        }else{
    if(jQuery("#"+b+"-mc").children("#msg_"+a).is(":hidden")){
        jQuery("#"+b+"-mc").children("#msg_"+a).slideDown()
        }
    }
}
function TB_hideAllMessages(){
    jQuery("div.tb_msg").fadeOut("fast",function(){
        jQuery("div.tb_msg").remove()
        })
    }
    function TB_hideMessage(b,a){
    jQuery("#"+b+"-mc").children("#msg_"+a).fadeOut("fast",function(){
        jQuery("#"+b+"-mc").children("#msg_"+a).remove()
        })
    }
    function TB_str2date(c){
    var a=new Date(),b=c.split(/[\s\:]/);
    if(c.indexOf(",")>=0){
        a.setUTCFullYear(b[3],TB_monthNumber[""+b[2]]-1,b[1]);
        a.setUTCHours(b[4],b[5],b[6])
        }else{
        a.setUTCFullYear(b[7],TB_monthNumber[""+b[1]]-1,b[2]);
        a.setUTCHours(b[3],b[4],b[5])
        }
        return a
    }
    function TB_verbalTime(a){
    var c,b=new Date(),g,d,e="",f="";
    if(b.getTime()>a.getTime()){
        g=Math.round((b.getTime()-a.getTime())/1000);
        f=" ago"
        }else{
        g=Math.round((a.getTime()-b.getTime())/1000);
        e="in "
        }
        for(c=0;g>=TB_timePeriodLengths[c]&&c<TB_timePeriodLengths.length;c++){
        g=g/TB_timePeriodLengths[c]
        }
        g=Math.round(g);
    d=TB_timePeriods[c];
    if(g!=1){
        d+="s"
        }
        return e+g+" "+d+f
    }
    function TB_addLoadEvent(a){
    var b=window.onload;
    if(typeof window.onload!="function"){
        window.onload=a
        }else{
        window.onload=function(){
            b();
            a()
            }
        }
}
function TB_getObjectSize(c){
    var b=0,a;
    for(a in c){
        if(c.hasOwnProperty(a)){
            b++
        }
    }
    return b
}
function TB_getUniqueElements(a){
    var d=[],b,c;
    for(b=a.length;b--;){
        c=a[b];
        if(jQuery.inArray(c,d)===-1){
            d.unshift(c)
            }
        }
    return d
}
TB_addLoadEvent(TB_start);
jQuery(document).ready(TB_start);