///////
// JS for frontpage tweets 

var from=" ";
//elem.attr('title');
jQuery.fn.reverse=Array.prototype.reverse;String.prototype.linkify=function()
{return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g,function(m)
{return m.link(m);});};String.prototype.linkuser=function()
{return this.replace(/[@]+[A-Za-z0-9-_]+/g,function(u)
{var username=u.replace("@","")
return u.link("http://twitter.com/"+username);});};String.prototype.linktag=function()
{return this.replace(/[#]+[A-Za-z0-9-_]+/,function(t)
{var tag=t.replace("#","%23")
return t.link("http://search.twitter.com/search?q="+tag);});};function fetch_tweets(elem)
{elem=$(elem);input='from%3AGrannenfelt+OR+from%3Aesapeltonen+OR+from%3Atiinaruottinen+OR+from%3Amineom+OR+from%3AMama_Sheep+OR+from%3Apaikky+OR+from%3Arobinpe+OR+from%3Apetterilaamo+OR+from%3Atuuukka';lang=elem.attr('lang');if(input!=window.monitter['text-'+input])
{window.monitter['last_id'+input]=0;window.monitter['text-'+input]=input;window.monitter['count-'+input]=3;;}
if(window.monitter['count-'+input]>10)
{elem.prepend('<div class="tweet"></div>');window.monitter['count-'+input]=0;}
var url="http://search.twitter.com/search.json?q="+input+"&lang="+lang+"&rpp="+rrp+"&since_id="+window.monitter['last_id'+input]+"&callback=?";$.getJSON(url,function(json)
{$('div.tweet:gt('+window.monitter['limit']+')',elem).each(function(){$(this).fadeOut('slow')});$(json.results).reverse().each(function()
{if($('#tw'+this.id,elem).length==0)
{window.monitter['count-'+input]++;var thedate=new Date(Date.parse(this.created_at));var thedatestr=thedate.getHours()+':'+thedate.getMinutes();var divstr='<div id="tw'+this.id+'" class="tweet"><p class="text">'+this.text.linkify().linkuser().linktag()+'&nbsp;<b></div><div class="tweet_footer"><img width="20" height="20" src="'+this.profile_image_url+'" >'+from+'<a href="http://twitter.com/'+this.from_user+'" target="_blank">'+this.from_user+'</a></b>&nbsp;-&nbsp;<b>'+thedatestr+'</b></p></div><div><div class="line"></div>';window.monitter['last_id'+input]=this.id;elem.prepend(divstr);$('#tw'+this.id,elem).hide();$('#tw'+this.id+' img',elem).hide();$('#tw'+this.id+' img',elem).fadeIn(0);$('#tw'+this.id,elem).fadeIn('slow');}});input=escape(input);rrp=1;setTimeout(function(){fetch_tweets(elem)},120000);});return(false);}
$(document).ready(function(){window.monitter={};$('.monitter').each(function(e){rrp=3;fetch_tweets(this);});});


///// Some js for
// Tweets.inc.php

var from=" ";
//elem.attr('title');
jQuery.fn.reverse=Array.prototype.reverse;String.prototype.linkify=function()
{return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g,function(m)
{return m.link(m);});};String.prototype.linkuser=function()
{return this.replace(/[@]+[A-Za-z0-9-_]+/g,function(u)
{var username=u.replace("@","")
return u.link("http://twitter.com/"+username);});};String.prototype.linktag=function()
{return this.replace(/[#]+[A-Za-z0-9-_]+/,function(t)
{var tag=t.replace("#","%23")
return t.link("http://search.twitter.com/search?q="+tag);});};function fetch_tweets(elem)
{elem=$(elem);input='from%3AGrannenfelt+OR+from%3Aesapeltonen+OR+from%3Atiinaruottinen+OR+from%3Amineom+OR+from%3AMama_Sheep+OR+from%3Apaikky+OR+from%3Arobinpe+OR+from%3Apetterilaamo+OR+from%3Atuuukka';lang=elem.attr('lang');if(input!=window.monitter['text-'+input])
{window.monitter['last_id'+input]=0;window.monitter['text-'+input]=input;window.monitter['count-'+input]=3;;}
if(window.monitter['count-'+input]>10)
{elem.prepend('<div class="tweet"></div>');window.monitter['count-'+input]=0;}
var url="http://search.twitter.com/search.json?q="+input+"&lang="+lang+"&rpp="+rrp+"&since_id="+window.monitter['last_id'+input]+"&callback=?";$.getJSON(url,function(json)
{$('div.tweet:gt('+window.monitter['limit']+')',elem).each(function(){$(this).fadeOut('slow')});$(json.results).reverse().each(function()
{if($('#tw'+this.id,elem).length==0)
{window.monitter['count-'+input]++;var thedate=new Date(Date.parse(this.created_at));var thedatestr=thedate.getHours()+':'+thedate.getMinutes();var divstr='<div id="tw'+this.id+'" class="tweet2"><p class="text2">'+this.text.linkify().linkuser().linktag()+'&nbsp;<b></div><div class="tweet_footer2"><img width="48" height="48" src="'+this.profile_image_url+'" >'+from+'<a href="http://twitter.com/'+this.from_user+'" target="_blank">'+this.from_user+'</a></b> &nbsp;-&nbsp;<b>'+thedatestr+'</b></p></div><div class="line"></div>';window.monitter['last_id'+input]=this.id;elem.prepend(divstr);$('#tw'+this.id,elem).hide();$('#tw'+this.id+' img',elem).hide();$('#tw'+this.id+' img',elem).fadeIn(0);$('#tw'+this.id,elem).fadeIn('slow');}});input=escape(input);rrp=1;setTimeout(function(){fetch_tweets(elem)},120000);});return(false);}
$(document).ready(function(){window.monitter={};$('.monitter_all').each(function(e){rrp=50;fetch_tweets(this);});});