<!--

var win = null;

function NewWindow(mypage, h, w, day, month, year){
	myname = 'Details';
	LeftPosition = (screen.availwidth) ? (screen.availwidth-w)/2 : 0;
	TopPosition = (screen.availheight) ? (screen.availheight-h)/2 : 0;
	optionsFenetre = ",toolbar=no,location=no,scrollbars=no,resizable=no,menubar=no,directories=no,status=no";
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition + optionsFenetre;
	win = window.open(mypage +"?Date="+day+"&Mois="+month+"&Annee="+year,myname,settings);
}

function Hilite(over,check,image)
{
	//var splitter = name.split("_");

		if(document.images) 
		{
			for (i = 1; i <= 17; i++)
			{	
				if (document.images['activite_'+ check +'_'+ i])
				{				
					if (over) {
						document.images['activite_'+ check +'_'+ i].src = "images/"+image+".gif";
					}
					else {
						document.images['activite_'+ check +'_'+ i].src = "images/spacer.gif";
					}
				
				}
			}
		}
}

function changeBackground(objet,Jour, Usager, Plage)
{
	var hiddenChamp = "";
	if (objet.style.background == 'orange')
	{
		hiddenChamp = document.Update.reservation.value;
		document.Update.reservation.value = "";
		hiddenChamp = hiddenChamp.split(",");
		for (Evenement in hiddenChamp)
		{
			if (hiddenChamp[Evenement] != ""+ Jour + "/" + Usager + "/" + Plage +"")
			{
				if (document.Update.reservation.value == ""){
					document.Update.reservation.value = document.Update.reservation.value + hiddenChamp[Evenement]; 
				}
				else {
					document.Update.reservation.value = document.Update.reservation.value + "," + hiddenChamp[Evenement]; 
				} 
			}
		}
		objet.style.background = 'black';
	}
	else 
	{
		objet.style.background = 'orange';
		if (document.Update.reservation.value == ""){
			document.Update.reservation.value = document.Update.reservation.value + Jour + "/" + Usager + "/" +Plage; 
		}
		else {
			document.Update.reservation.value = document.Update.reservation.value + "," + Jour + "/" + Usager + "/" +Plage; 
		}
	}
}

function changeBackgroundErase(objet, Jour, Usager, Plage, Couleur, User_Plage)
{
	if (User_Plage == Usager)
	{
		var hiddenChamp = "";
		if (objet.style.background == 'red')
		{
			hiddenChamp = document.Update.efface.value;
			document.Update.efface.value = "";
			hiddenChamp = hiddenChamp.split(",");
			for (Evenement in hiddenChamp)
			{
				if (hiddenChamp[Evenement] != ""+ Jour + "/" + Usager + "/" + Plage +"")
				{
					if (document.Update.efface.value == ""){
						document.Update.efface.value = document.Update.efface.value + hiddenChamp[Evenement]; 
					}
					else {
						document.Update.efface.value = document.Update.efface.value + "," + hiddenChamp[Evenement]; 
					} 
				}
			}
			objet.style.background = Couleur;
		}
		else 
		{
			objet.style.background = 'red';
			if (document.Update.efface.value == ""){
				document.Update.efface.value = Jour + "/" + Usager + "/" +Plage; 
			}
			else {
				document.Update.efface.value = document.Update.efface.value + "," + Jour + "/" + Usager + "/" +Plage; 
			}
		}
	}
}

function Changediv(id) {
	if (document.layers && !document.getElementById) { 
		document.layers[''+id+''].visibility = ChangeVisibility(document.layers[''+id+''].visibility, "show", "hide"); 
	}
	else { 
		//if (document.all) {
			//document.all[''+id+''].style.visibility = ChangeVisibility(document.all[''+id+''].style.visibility, "visible", "hidden");
		//}
		//else {
			//if (document.getElementById) { 
				document.getElementById(''+id+'').style.visibility = ChangeVisibility(document.getElementById(''+id+'').style.visibility, "visible", "hidden");
			//}
		//}
	}

}

function ChangeVisibility(valeur, valueShow, valueHide) {
	var secretly = "";
	if (valeur == valueHide) {
		secretly = valueShow; 
	}
	else {
		secretly = valueHide; 
	}
	return secretly;
}

function actualizePos(id) {
	
	var Otrivin = "";

	if (document.all)
	{
		Otrivin = document.all[''+id+''];
	}
	else {
		if (document.getElementById) {
			Otrivin = document.getElementById(''+id+'');
		}
		else {
			if (document.layers)
			{
				Otrivin = document.layers[''+id+''];
			}
		}
	}
	
	//59 x 195
	//alert(Otrivin.offsetHeight); .clip.height
	//alert(Otrivin.offsetWidth); .clip.width
	//screen.availheight

	LeftPosition = (document.layers) ? (window.innerWidth-Otrivin.clip.width)/2 : (document.body.scrollWidth-Otrivin.offsetWidth)/2;
	TopPosition = 175;
  //(document.layers) ? (window.innerHeight-Otrivin.clip.height)/2 : ((document.body.scrollHeight-Otrivin.offsetHeight)/2)-100;
	
	if ((document.all || document.getElementById))
	{
		if (parseInt(document.body.scrollHeight) > parseInt(screen.availheight))
		{	
			TopPosition = 175;
      //parseInt((((document.body.scrollHeight-Otrivin.offsetHeight)-(document.body.scrollHeight-screen.availheight))/2)-175);
		}
	}

	if (document.all) {
		Otrivin.style.pixelTop = TopPosition;
		Otrivin.style.pixelLeft = LeftPosition;
	}
	else
		if (document.getElementById && !document.all) {
			Otrivin.style.top = TopPosition;
			Otrivin.style.left = LeftPosition;
		}
		else
			if (document.layers) {
				Otrivin.top = TopPosition;
				Otrivin.left = LeftPosition;
			}
}

function actualizePosRight(id) {
	
	var Otrivin = "";

	if (document.all)
	{
		Otrivin = document.all[''+id+''];
	}
	else {
		if (document.getElementById) {
			Otrivin = document.getElementById(''+id+'');
		}
		else {
			if (document.layers)
			{
				Otrivin = document.layers[''+id+''];
			}
		}
	}

	LeftPosition = (document.layers && !document.getElementById) ? (window.innerWidth-Otrivin.clip.width) : ((document.body.offsetWidth-Otrivin.offsetWidth)-20);  
	//(document.body.scrollWidth-Otrivin.offsetWidth);

	//TopPosition = document.body.scrollHeight-document.body.offsetHeight-Otrivin.offsetWidth;
	TopPosition = 0;
	
	/*if ((document.all || document.getElementById))
	{
		if (parseInt(document.body.scrollHeight) > parseInt(screen.availheight))
		{
			TopPosition =parseInt((((document.body.scrollHeight-Otrivin.offsetHeight)-(document.body.scrollHeight-screen.availheight))/2)-175);
		}
	}*/

	if (document.all) {
		Otrivin.style.pixelTop = TopPosition;
		Otrivin.style.pixelLeft = LeftPosition;
		//Otrivin.style.visibility = "visible";
	}
	else
		if (document.getElementById && !document.all) {
			Otrivin.style.top = TopPosition;
			Otrivin.style.left = LeftPosition;
			//Otrivin.style.visibility = "visible";
		}
		else
			if (document.layers) {
				Otrivin.top = TopPosition;
				Otrivin.left = LeftPosition;
				//Otrivin.style.visibility = "show";
			}
}

//--> 
