function getTwitterPosts(C) { for(var A=[], B, E, D=0; D<C.length; D++){ E=C[D].user.screen_name, 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><span>"+B+'</span><br /><a href="http://twitter.com/'+E+"/statuses/"+C[D].id+'">'+relative_time(C[D].created_at)+"</a></li>")} document.getElementById("twitter").innerHTML=A.join("");  for(var l=document.links, h = window.location.hostname, i = 0, a; a = l[i]; i++) { if (a.hostname!=h) { a.target='_blank'; }} };
function relative_time (C) { var B = C.split(" "); C = B[1]+" "+B[2]+", "+B[5]+" "+B[3]; var A = Date.parse(C), D = (arguments.length>1) ? arguments[1] : new Date(), E = parseInt((D.getTime()-A)/1000); E = E + (D.getTimezoneOffset()*60);	if (E < 60) { return "il y a moins d'une minute"; } else { if(E<120){ return"il y a une minute"; } else { if(E<(60*60)){ return "il y a " +(parseInt(E/60)).toString()+" minutes"; } else { if (E<(120*60)){ return "il y a une heure"; } else { if(E<(24*60*60)){ return "il y a "+(parseInt(E/3600)).toString()+" heures"; } else { if(E<(48*60*60)){return "il y a 1 jour";} else { return "il y a " +(parseInt(E/86400)).toString()+" jours";}}}}}}};
jQuery(function($) {
	var addthis_pub             = 'nyamsprod';
	var addthis_logo            = 'http://nyams.planbweb.com/images/icon.gif';
	var addthis_logo_background = 'f5f5f5';
	var addthis_logo_color      = '336699';
	var addthis_brand           = "nyamsprod";
	var addthis_language        = 'fr';
	var addthis_options         = 'favorites, email, digg, delicious, myspace, facebook, google, live, more';
	$('.addThisButton').click(function(){return addthis_sendto();});		
	$('.addThisButton').mouseover(function(event){ addthis_open(event.target, '', (window.location.hash === '') ? window.location.href : window.location.href.substring(0, window.location.href.lastIndexOf('#')), document.title);	});
	$('.addThisButton').mouseout(function(){addthis_close();});
	$('#main_menu a').click(function(){if(jQuery.browser.msie===true){$('#main_menu li').attr('class','');$(this).parent().attr('class','target');}});
	for(var l = document.links, h = window.location.hostname, i = 0, a; a = l[i]; i+= 1) { if (a.hostname !== h) {a.target = '_blank';} }
	if ($('#twitter').length==1) {
		var script = document.createElement('script');
		script.setAttribute('type','text/javascript');
		script.src = 'http://twitter.com/statuses/user_timeline/nyamsprod.json?callback=getTwitterPosts&count=3';
		document.body.appendChild(script);
	}
});
