function GetXmlHttpObject() {
	var xmlHttp=null;
	try { // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) { // Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function getCalendar(strMonth) {
	//document.getElementById("calendar").innerHTML = "<div class=\"wait\"></div>";
	xmlHttp = GetXmlHttpObject()
	if (xmlHttp == null) {
		return;
	} 
	var strUrl = "../includes/calendar.php?strMonth="+strMonth;
	xmlHttp.onreadystatechange = showCalendar;
	xmlHttp.open("GET",strUrl,true);
	xmlHttp.send(null);
}

function showCalendar()  { 
	if (xmlHttp.readyState == 4) { 
		document.getElementById("calendar").innerHTML = xmlHttp.responseText;
	}
}

function showLayer(layerId,show) {
	if (document.getElementById && document.getElementById(layerId)) { objLayer = document.getElementById(layerId); } else if (document.all && document.all[layerId]) { objLayer = document.all[layerId]; } else if (document.layers && document.layers[layerId]) { objLayer = document.layers[layerId]; } else { objLayer = null; }
	if (objLayer !== null) { objLayer.style.display = (show == 1) ? 'block' : 'none'; }
}


function launchSearch() {
		document.getElementById("strSearch").className = "wait";
}

function photo(strFile,strTitle) {
	wndwPopup = window.open('../medias/viewer.php?strFile='+strFile+'&strTitle='+strTitle,'capitole','width=100, height=100, top=100, left=100, scrollbars=no, resizable=no');
	wndwPopup.focus();
}