// Convert text URLs into Links
function ahrefs(s){
s = s.replace(/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi,function(url){
nice = url;
if( url.match('^https?:\/\/') ){
nice = nice.replace(/^https?:\/\//i,'')
}else{
url = 'http://'+url;
}
return '<a target="_blank" rel="nofollow" href="http://40bd4cee.linkbucks.com/url/'+ url +'">'+ nice.replace(/^www./i,'') +'</a>';
});
return s;
}