function ReplaceAll(Source,stringToFind,stringToReplace){
	var temp = Source;
    var index = temp.indexOf(stringToFind);
    while(index != -1){
    	temp = temp.replace(stringToFind,stringToReplace);
    	index = temp.indexOf(stringToFind);
    }
    return temp;
}

function init_ajax_modules(){
	$(".module_ajax").each(function() {
        a = $(this);
		var content = a.html();
        content = ReplaceAll(content,'&amp;','&');
        a.show();
        a.html('chargement...');
        a.load(content, callback_calendar_updated);
	});
}

$(document).ready(init_ajax_modules);

function callback_calendar_updated() {
	$('td.td_case_jour').each(
		function() {$(this).hover(
			function() { apercu(this) },
			function() { close_apercu(this) }
		);}
	);
}

function update_calendar_url(url) {
	var module = $("#calendar_module");
	//module.html('chargement...');
	module.load(url, callback_calendar_updated);
}
