function PopupImage(img) {
	titre="ZOOM";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+80); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 onClick='javascript:window.close();' style='cursor:hand'>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function affCalendar(chps)
{
	urlCalendar = "";
	document.getElementById("calendardu").style.visibility = 'hidden';
	document.getElementById("calendardu").innerHTML = "";
	document.getElementById("calendarau").style.visibility = 'hidden';
	document.getElementById("calendarau").innerHTML = "";
	if(document.getElementById("du"))
	{
		if(document.getElementById("du").value != " jj/mm/aaaa" && document.getElementById("du").value != "")
		{
			urlCalendar = "../_includes/asp/calendar.asp?chps="+chps+"&dateLimite="+document.getElementById("du").value;
		}else{
			urlCalendar = "../_includes/asp/calendar.asp?chps="+chps;
		}
	}else{
		urlCalendar = "../_includes/asp/calendar.asp?chps="+chps;
	}
	//alert(urlCalendar);
	loadPage(urlCalendar,'calendar'+chps);
}

function select_date(dat,cible){
	document.getElementById(cible).value=dat;
	document.getElementById("calendar"+cible).style.visibility = 'hidden';
	document.getElementById("calendar"+cible).innerHTML = "";
}

function closeCalendar(cible)
{
	document.getElementById("calendar"+cible).style.visibility = 'hidden';
	document.getElementById("calendar"+cible).innerHTML = "";
}

function validFormCalendar(chps)
{
	loadPage("../_includes/asp/calendar.asp?chps="+chps+"&START_MONTH="+document.getElementById("START_MONTH").options[document.getElementById("START_MONTH").selectedIndex].value+"&START_YEAR="+document.getElementById("START_YEAR").options[document.getElementById("START_YEAR").selectedIndex].value,"calendar"+chps);
}

function loadPage(url,cible)
{
	//Changement du contenu
	var xhr_object = null; 
	document.getElementById(cible).innerHTML = '<div style="background-color:#fff; width: 160px; height:140px; margin: 0px;"><img src="/img-sarthe-tourisme/loading.gif" hspace="64" vspace="54"></div>';
	document.getElementById(cible).style.visibility = 'visible';
	//document.getElementById(cible).innerHTML = "";
 
	if(window.XMLHttpRequest) // Firefox 
	   xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // Internet Explorer 
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   return; 
	} 
 
	xhr_object.open("GET", url, true);
	
	xhr_object.onreadystatechange = function() 
	{ 
	   if(xhr_object.readyState == 4)
	   {
	   		document.getElementById(cible).innerHTML = xhr_object.responseText;
			document.getElementById(cible).style.visibility = 'visible';
		}
	} 
	 
	xhr_object.send(null); 
}