// URL of the current page
var calendar_current_url = document.location;
// We retrieve the date to display
var calendar_month_date = "";
// We also retrieve the SID if it exists for the session
var SID = "";
var query_string = this.location.search.substring(1);
if (query_string.length > 0) {
	var params = query_string.split("&");
	for (var i = 0; i < params.length; i++) {
		var pos = params[i].indexOf("=");
		if (params[i].substring(0, pos) == "calendar_date") {
			calendar_month_date = params[i].substring(pos + 1);
		}
		if (params[i].substring(0, pos) == "PHPSESSID") {
			SID = "PHPSESSID=" + params[i].substring(pos + 1);
		}
	}
}

// We display the calendar via a second JavaScript call
document.write('<script type="text/javascript" src="/calendar_js.php?...&amp;display_calendar=true&amp;JS_URL=' + escape(calendar_current_url) + '&amp;calendar_date=' + calendar_month_date + '&amp;' + SID + '"></script>');
