// JavaScript Document

	function GetId(id)
	{
		return document.getElementById(id);
	}
	
	var i=false; // La variable i nous dit si la bulle est visible ou non
	
	function move(e)
	{
		if(i) // Si la bulle est visible, on calcul en temps reel sa position ideale
		{
			if(navigator.appName!="Microsoft Internet Explorer") // Si on est pas sous IE
			{
				GetId("curseur").style.left=e.pageX+5+"px";
				GetId("curseur").style.top=e.pageY+10+"px";
			}
			else // Modif proposé par TeDeum, merci à lui
			{
				if(document.documentElement.clientWidth>0)
				{
					GetId("curseur").style.left=20+event.x+document.documentElement.scrollLeft+"px";
					GetId("curseur").style.top=10+event.y+document.documentElement.scrollTop+"px";
				}
				else
				{
					GetId("curseur").style.left=10+event.x+document.body.scrollLeft+"px";
					GetId("curseur").style.top=20+event.y+document.body.scrollTop+"px";
				}
			}
		}
	}
	
	function montreInfoBulle(id)
	{
		if(i==false)
		{
			GetId("curseur").innerHTML = GetId("curseur"+id).innerHTML
			GetId("curseur").style.visibility="visible"; // Si il est cacher (la verif n'est qu'une securité) on le rend visible.
			
			i=true;
		}
	}
	
	function cacheInfoBulle()
	{
		if(i==true)
		{
			GetId("curseur").style.visibility="hidden"; // Si la bulle etais visible on la cache
			i=false;
		}
	}
	
	document.onmousemove=move; // des que la souris bouge, on appelle la fonction move pour mettre a jour la position de la bulle.

	function openForm()
	{
		var addPlanning = document.getElementById('addPlanning');
		
		if(addPlanning.style.display == 'none')
		{
			addPlanning.style.display = 'block';
		}
		else
		{
			addPlanning.style.display = 'none';
		}
	}
	
	function updateCours(club, id)
	{
		window.location.href = 'admin_planning.php?club='+club+'&editer='+id;
	}	

	function updateCours2(club, id)
	{
		window.location.href = 'admin_planning2.php?club='+club+'&editer='+id;
	}
	
	function deleteCours(evt, id)
	{
		alert(evt.charCode());
		if(confirm('Voulez vous vraiment retirer ce cours ?'))
		{
			window.location.href = 'admin_planning.php?supprimer='+id;
		}
	}
	function deleteCours2(evt, id)
	{
		alert(evt.charCode());
		if(confirm('Voulez vous vraiment retirer ce cours ?'))
		{
			window.location.href = 'admin_planning2.php?supprimer='+id;
		}
	}	
