
Lycos.webon.modules.twitter=function(instId,subInstId){this.type="twitter";this.lyModule=Lycos.webon.module;this.lyModule(instId,subInstId);var tmp=this;this.addEventListener("setRemoteAccount",function(e){tmp.onSetRemoteAccount(e);});this.callback=function(C){this.loaded=true;var A=[];for(var D=0;D<C.length;D++){var E=C[D].user.screen_name;var B=C[D].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(F){return'<a href="'+F+'">'+F+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(F){return F.charAt(0)+'<a href="http://www.twitter.com/'+F.substring(1)+'">'+F.substring(1)+"</a>"});A.push("<li>"+B+' <p><a style="font-size:85%;white-space:nowrap;" href="http://twitter.com/'+E+"/statuses/"+C[D].id+'">'+this.relativeTime(C[D].created_at)+"</a></p></li>");}
var H=A.join("");document.getElementById("updatelist"+this.instId).innerHTML=(H.length>0?H:"This user doesn't have any public tweets.");};this.relativeTime=function(C){var B=C.split(" ");C=B[1]+" "+B[2]+", "+B[5]+" "+B[3];var A=Date.parse(C);var D=(arguments.length>1)?arguments[1]:new Date();var E=parseInt((D.getTime()-A)/1000);E=E+(D.getTimezoneOffset()*60);if(E<60){return"less than a minute ago";}else{if(E<120){return"about a minute ago";}
else{if(E<(60*60)){return(parseInt(E/60)).toString()+" minutes ago";}else{if(E<(120*60)){return"about an hour ago";}
else{if(E<(24*60*60)){return"about "+(parseInt(E/3600)).toString()+" hours ago";}
else{if(E<(48*60*60)){return"1 day ago";}
else{return(parseInt(E/86400)).toString()+" days ago";}}}}}}};this.setRemoteAccount=function(){return this.lyAjaxForm(document.getElementById("twitterSetup"+this.instId),"setRemoteAccount");}
this.onSetRemoteAccount=function(evt){Lycos.use("http://twitter.com/statuses/user_timeline/"+evt.lyResponse.linked_remote_account+".json?callback=Lycos.twitterCallback"+this.instId+"&count="+evt.lyResponse.tweets,null,true,true,true);var frm=document.getElementById("twitterSetup"+this.instId);if(frm)frm.style.display="none";document.getElementById("updatelist"+this.instId).style.display="";var pb=document.getElementById("postedby"+this.instId);pb.style.display="";pb=pb.getElementsByTagName("a")[0];pb.href="http://www.twitter.com/"+evt.lyResponse.linked_remote_account+"/";pb.innerHTML=evt.lyResponse.linked_remote_account;}}