function timeAgo(date1){

	periods = [];
	periods['week'] = 604800;
	periods['dag'] = 86400;
	periods['uur'] = 3600;
	periods['minuut'] = 60;
	periods['seconde'] = 1;

	plural = [];
	plural['week'] = 'weken';
	plural['dag'] = 'dagen';
	plural['uur'] = 'uur';
	plural['minuut'] = 'minuten';
	plural['seconde'] = 'seconden';

	date1 = new Date(date1).getTime() / 1000;
	date2 = new Date().getTime() / 1000;

	difference = date2 - date1;

	output = '';

	for(var period in periods){
		var value = periods[period];

		if(difference >= value){
			time = Math.floor(difference / value);
			difference %= value;

			output = output +  time + ' ';

			if(time > 1){
				output = output + plural[period];
			}else{
				output = output + period;
			}
			
			return output + ' geleden';
		}

	}
}

function twitterAddLinks(text)
	{
		return text.replace( /http([s]?):\/\/([^\ \)$]*)/g,
						'<a href="http$1://$2" rel="nofollow" title="$2">http$1://$2</a>')
					.replace(/@([a-zA-Z0-9_]*)/g,
						'<a href="http://twitter.com/$1" title="$1 profiel op Twitter" rel="nofollow">@$1</a>')
					.replace(/\#([a-zA-Z0-9_]*)/g,
						'<a href="http://search.twitter.com/?q=%23$1" title="zoek op $1 op Twitter" rel="nofollow">\#$1</a>');
	}
	$(document).ready(function(){
		
		$("#header>#hidden_click").click(function(){
			$("#player_audio")[0].play();
		});
	});
