function ajaxifyPrettyDates() {
	console.log("ajaxify PrettyDates...");

	$(".PrettyDate").not(".ajaxed").each(function() {		
		$(this).addClass("ajaxed")

		if(Creole.timeFormat === undefined) {
			if(!$(this).attr("timestamp")) { 
				console.log("PrettyDateWidget", "The 'timestamp' attribute does not contain any data. Aborting.");
				return;
			}
		
			var update = _.bind(function() {
				var date = new Date(parseInt($(this).attr("timestamp")));

				var pdt = prettyDate(date);
				
				if (DEBUG) pdt += " "+date;
				
				$(this).text(pdt);
			}, this);

			update();
	
			setInterval(update, 1000 * 30);
		} else {
			$(this).text(
				PHPJS.date(Creole.timeFormat, $(this).attr("timestamp") / 1000)
			);
		}
	});

	console.log("... ajaxify PrettyDates done.");
};

console.log("registering ajaxify PrettyDates...");
ajaxifyFunctions.push(ajaxifyPrettyDates);

$(ajaxifyPrettyDates);

