var superglobaleListe=0;
var superglobaleListe2=0;
function changerFormation(champ)
{		
	if(champ.value==1)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"O\">Offensif</option><option value=\"N\">Normal</option><option value=\"D\">Defensif</option></select>";
	}
	else if(champ.value==2)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"O\">Offensif</option><option value=\"N\">Normal</option><option value=\"D\">Defensif</option></select>";
	}
	else if(champ.value==3)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"N\">Normal</option></select>";
	}
	else if(champ.value==4)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"N\">Normal</option></select>";
	}
	else if(champ.value==5)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"N\">Normal</option></select>";
	}
	else if(champ.value==6)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"N\">Normal</option></select>";
	}
	else if(champ.value==7)
	{
		var parent = document.getElementById('etage');
		parent.innerHTML = "<select id=\"agress\" name=\"agressivite\" onchange=\"changerTerrain()\"><option value=''>Choisissez</option><option value=\"N\">Normal</option></select>";
	}
}


function sauverStrat(eqp)
{
	var testz = document.getElementById('strat');
	var champ = document.getElementById('etage');
	champ = champ.firstChild;
	var xhr;
    if(window.XMLHttpRequest || window.ActiveXObject) 
	{
        if(window.XMLHttpRequest) {
            xhr = new XMLHttpRequest();
        } 
        else {
            try {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } catch(e) {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
    }
    else {
        alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
        return;
    }
	var equipetype = eqp;
    xhr.open("GET", "traitementRequete2.php?cle=5&equipetype="+equipetype+"&test="+testz.value+"&champ="+champ.value, false);
    xhr.send(null);
	alert(xhr.responseText);
}


function sauverStratTactic(eqp, date)
{
	var date = date;
	var testz = document.getElementById('strat');
	var champ = document.getElementById('etage');
	champ = champ.firstChild;
	var xhr;
    if(window.XMLHttpRequest || window.ActiveXObject) 
	{
        if(window.XMLHttpRequest) {
            xhr = new XMLHttpRequest();
        } 
        else {
            try {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } catch(e) {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
    }
    else {
        alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
        return;
    }
	var equipetype = eqp;
    xhr.open("GET", "traitementRequete2.php?cle=55&equipetype="+equipetype+"&test="+testz.value+"&champ="+champ.value+"&date="+date, false);
    xhr.send(null);
	alert(xhr.responseText);
}



















function changerTerrain()
{
	var testz = document.getElementById('strat');
	var champ = document.getElementById('etage');
	champ = champ.firstChild;
	var terrain = document.getElementById("idTerrain");
	var t = new Array(0, 0);
				
	t[0] = terrain.offsetLeft;
	t[1] = terrain.offsetTop;
	while(terrain.offsetParent){
		terrain = terrain.offsetParent;
		t[0] += terrain.offsetLeft;
		t[1] += terrain.offsetTop;
	}
	var y = t[1]-150;
	var x = t[0]+15;
	if(testz.value=="1")
	{
		if(champ.value=="O")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
		
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(300))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(240))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(350))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(275))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(460))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(460))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
		}
		else if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
		}
		else if(champ.value=="D")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(270))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(270))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
		}
	}
	else if(testz.value=="2")
	{
		if(champ.value=="O")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(320))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(320))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(450))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
		}
		else if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(260))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(260))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(400))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(400))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(400))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
		}
		else if(champ.value=="D")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(250))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(295))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(380))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(440))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(380))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
		}
	}
	else if(testz.value=="3")
	{
		if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(90))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(360))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(210))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(360))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(305))+"px";
		}
	}
	else if(testz.value==4)
	{
		if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
			
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(200))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(200))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(310))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(60))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(310))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(250))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
		}
	}
	else if(testz.value==5)
	{
		if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
		
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(130))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(60))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(250))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(350))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(290))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(80))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(290))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(230))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(350))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
		}
	}
	else if(testz.value==6)
	{
		if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
		
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(210))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
			
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(105))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
			
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(210))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(350))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(0))+"px";
			
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(295))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(95))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(295))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(220))+"px";
						
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(350))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
					
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
		}
	}
	else if(testz.value==7)
	{
		if(champ.value=="N")
		{
			document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
			document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
			document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
			document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
			document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
			document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
			document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
			document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
			document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
			document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(390))+"px";
			document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
				
			document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(300))+"px";
			document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
					
			document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(220))+"px";
			document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
			
			document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
			document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
						
			document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(390))+"px";
			document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
			
			document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(420))+"px";
			document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
		}
	}
}

function changerCouleurIn(champ)
{
	for(var i=1; i<12; ++i)
	{
		if(champ.id=="strategie"+i)
		{
			var case1 = document.getElementById(i+"a");
			var case2 = document.getElementById(i+"b");
			var case3 = document.getElementById("corpsStrategie"+i);
						
			case1.style.backgroundColor = "#5d7b5a";
			case2.style.backgroundColor = "#5d7b5a";
			case3.style.backgroundColor = "#5d7b5a";
		}
	}
}
	
function changerCouleurOut(champ)
{
	for(var i=1; i<12; ++i)
	{
		if(champ.id=="strategie"+i)
		{
			var case1 = document.getElementById(i+"a");
			var case2 = document.getElementById(i+"b");
			var case3 = document.getElementById("corpsStrategie"+i);
		
			
			case1.style.backgroundColor = "white";
			case2.style.backgroundColor = "white";
			case3.style.backgroundColor ="white";
		}
	}
}
	
function apparitionInformationStrat(champ, pseudo)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
		if(window.XMLHttpRequest) {
				xhr = new XMLHttpRequest();
		} 
		else {
				try {
						xhr = new ActiveXObject("Msxml2.XMLHTTP");
				} catch(e) {
						xhr = new ActiveXObject("Microsoft.XMLHTTP");
				}
		}
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
	
	xhr.onreadystatechange = function() {
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		   
			document.getElementById('blockInfoStrat').innerHTML = xhr.responseText;			
		}
   } 
	
	xhr.open("GET", "traitementRequete2.php?cle=6&pseudo="+pseudo, true);
    xhr.send(null);
	document.getElementById('blockInfoStrat').style.visibility="visible";
}

function changerCouleurIn2(champ, pseudo)
{
	for( var i=0; i<12; ++i)
	{
		if(champ.id==i+"a" || champ.id==i+"b")
		{
			var case1 = document.getElementById(i+"a");
			var case2 = document.getElementById(i+"b");
			var case3 = document.getElementById("corpsStrategie"+i);
			
			case1.style.backgroundColor = "#5d7b5a";
			case2.style.backgroundColor = "#5d7b5a";
			case3.style.backgroundColor = "#5d7b5a";
		}
	}
	//On fait apparaitre les informations du joueur
	apparitionInformationStrat(champ, pseudo);
}

function changerCouleurOut2(champ)
{
	for(var i=1; i<12; ++i)
	{
		if(champ.id==i+"a" || champ.id==i+"b")
		{
			var case1 = document.getElementById(i+"a");
			var case2 = document.getElementById(i+"b");
			var case3 = document.getElementById("corpsStrategie"+i);
			/*case3 = case3.lastChild;
			case3 = case3.previousSibling;
			case4 = case3.previousSibling;
			case4 = case4.previousSibling;*/
			case1.style.backgroundColor = "white";
			case2.style.backgroundColor = "white";
			case3.style.backgroundColor ="white";
			//case4.style.backgroundColor ="transparent";
			//alert(case3.innerHTML);
		}
	}
}

function changerCouleurIn3(champ, pseudo)
{
	var case1 = champ.parentNode;
	case1= case1.firstChild;
	case1 = case1.nextSibling;
	var case2 = case1.nextSibling;
	case2 = case2.nextSibling;
	case1.style.backgroundColor = "#5d7b5a";
	case2.style.backgroundColor = "#5d7b5a";
	//On fait apparaitre les informations du joueur
	apparitionInformationStrat(champ, pseudo);
}
	
function changerCouleurOut3(champ, pseudo)
{
	var case1 = champ.parentNode;
	case1= case1.firstChild;
	case1 = case1.nextSibling;
	var case2 = case1.nextSibling;
	case2 = case2.nextSibling;
	case1.style.backgroundColor = "white";
	case2.style.backgroundColor = "white";

	//On fait apparaitre les informations du joueur
	apparitionInformationStrat(champ, pseudo);
}
	
	
function remplacer(champ, eqp)
{
	changerCouleurIn2(champ);
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
		if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
	    } 
		else {
		    try {
		        xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		}
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
	    return;
	}
	xhr.onreadystatechange = function() {
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
			document.getElementById('bordel').innerHTML = xhr.responseText;			
		}
	} 
	var equipetype = eqp;
	xhr.open("GET", "traitementRequete2.php?cle=0&posJoueur="+champ.id+"&equipetype=" + equipetype, true);
	xhr.send(null);
	var doc = document.getElementById('petitMenuStrategie');
	var blocEnCoursY=0;
	var blocEnCoursX = 0;
	var elem = champ;
	while(elem.offsetParent)
	{
		blocEnCoursY=blocEnCoursY + elem.offsetTop;
		blocEnCoursX = blocEnCoursX + elem.offsetLeft;
		elem = elem.offsetParent;
	}
	var bordel = document.getElementById('bordel');
	bordel.style.left = blocEnCoursX+80 + "px";
	bordel.style.top = blocEnCoursY-156+"px";
}

	function remplacer2(champ, pseudo)
{
	changerCouleurIn2(champ, pseudo);
}

function remplacerOut(champ)
{
	document.getElementById('petitMenuStrategie').innerHTML = '';
}

function preparerChangement(champ)
{
	var case1;
	var case2;
	var case3;
	var parent = champ.parentNode;
	case1 = parent.firstChild;
	case2 = case1.nextSibling;
	case3 = case2.nextSibling;
	case1.style.backgroundColor = "midnightblue";
	case2.style.backgroundColor = "midnightblue";
	case3.style.backgroundColor = "midnightblue";
	case1.style.color = "white";
	case2.style.color = "white";
	case3.style.color = "white";
}

function preparerChangementOut(champ)
{
		var case1;
		var case2;
		var case3;
		var parent = champ.parentNode;
		case1 = parent.firstChild;
		case2 = case1.nextSibling;
		case3 = case2.nextSibling;
		case1.style.backgroundColor = "white";
		case2.style.backgroundColor = "white";
		case3.style.backgroundColor = "white";
		case1.style.color = "black";
		case2.style.color = "black";
		case3.style.color = "black";
}
	
function rectifierBDD(place, pseudo, pseudoAncien, eqp)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
		if(window.XMLHttpRequest) {
		    xhr = new XMLHttpRequest();
		} 
		else {
		    try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
		        xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
	    }
	}
	else {
	    alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
	    return;
	}
	var equipetype = eqp;
    xhr.open("GET", "traitementRequete2.php?cle=1&pseudo="+pseudo+"&place=" +place+"&pseudoAncien="+pseudoAncien, false);
    xhr.send(null);
	//document.getElementById('menuGaucheStrategie3').innerHTML = xhr.responseText;
}
	
function validerChangement(champ, idChamp1, pseudo2, eqp)
{	
	//Liste des joueurs remplacant (on l'efface)
	//document.getElementById('menuGaucheStrategie3').innerHTML = "";
	var i;
	for(i=1; i<12; ++i)
	{
		if(idChamp1==(i+"a") || idChamp1==(i+"b"))
		{
		pseudo = document.getElementById(i+'a').innerHTML;
		//var parente = document.getElementById($i+'a').parentNode;
		/*parente.innerHTML = "<td class=\"caseStrategieGauche\" id=\""+$i+"a\" onmouseover=\"changerCouleurIn2(this)\" onmouseout=\"changerCouleurOut2(this)\">"+pseudo2+"</td><td class=\"caseStrategieDroite\" id=\""+$i+"b\" onmouseover=\"remplacer2(this, '"+pseudo2+"')\" onmouseout=\"changerCouleurOut2(this)\">Remplacer</td>";*/
		rectifierBDD(i,pseudo2, pseudo, eqp);
		}
	}
	//document.getElementById('petitMenuStrategie').innerHTML = '';
	window.location.reload();
}

	function montrerMenu(event)
{
	var posX = event.clientX;
	var posY = event.clientY;
	var CMenu = document.getElementById('CMenu');
	var Menu2 = document.getElementById("menuEditionStrat");
	if(Menu2.style.visibility=="hidden")
	{
		CMenu.style.visibility= "visible";
		CMenu.style.top = posY+document.documentElement.scrollTop+"px";
		CMenu.style.left = posX+"px";
	}
}

function MasquerMenu(){
	var CMenu = document.getElementById('CMenu');
	CMenu.style.visibility = "hidden";
	document.getElementById('bordel').innerHTML = "";
	document.getElementById('menuEditionStrat').style.visibility="hidden";
}

function sortirListe(club, equipetype, boiteDessus)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 3)
		{
			//script d'attente
			var lig=document.getElementById('ligthBox');
			lig.innerHTML = "<span id=\"blockInte\"><img src=\"Images/chargement.gif\" /></span>";
			var blockInte = document.getElementById('blockInte');
			blockInte.style.position="absolute";
			blockInte.style.left = "40%";
			blockInte.style.top = "40%";
			
		}
		else if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		boiteDessus.innerHTML = xhr.responseText;	
		boiteDessus.style.margin = "15px auto";
		//boiteDessus.style.marginRight = "10%";
		document.getElementById('blockInte').innerHTML="";
		}
	} 
	xhr.open("GET", "traitementRequete2.php?cle=3&club="+club+"&equipetype="+equipetype, true);
	xhr.send(null);
}

function masquerLightBox()
{
	document.getElementById('ligthBox').style.visibility = "hidden";
	document.getElementById('boiteDessus').style.visibility = "hidden";
}

function ajouterJoueur(eqp, idclub)
{
	var ligthBox = document.getElementById('ligthBox').style;
	var opacity = 70;
	//On commence par regarder la taille de la fenetre
	//On incormpore un fond de cette taille
	
	
//	ligthBox.top=(document.documentElement.scrollTop + document.body.scrollTop)+"px";
//	ligthBox.left="0px";
	ligthBox.backgroundColor = "black";
	
	ligthBox.opacity = (opacity / 100);
    ligthBox.MozOpacity = (opacity / 100);
    ligthBox.KhtmlOpacity = (opacity / 100);
    ligthBox.filter = "alpha(opacity=" + opacity + ")";
	var boiteDessus = document.getElementById('boiteDessus');
	boiteDessus.style.visibility = "visible";
ligthBox.visibility = "visible";
	boiteDessus.style.position = "absolute";
	boiteDessus.style.left="350px";
	boiteDessus.style.top="0px";
	sortirListe(''+idclub+'', ''+eqp+'', boiteDessus);
}

function sourisSurCase(champ)
{
	var parent = champ;
	var nom = champ.firstChild;
	var prenom = nom.nextSibling;
	var  place = prenom.nextSibling;
	var titulaire = place.nextSibling;
	nom.style.backgroundColor = "#5d7b5a";
	prenom.style.backgroundColor = "#5d7b5a";
	place.style.backgroundColor = "#5d7b5a";
	titulaire.style.backgroundColor = "#5d7b5a";
	nom.style.color = "white";
	prenom.style.color = "white";
	place.style.color = "white";
	titulaire.style.color = "white";
}

function sourisDehorsCase(champ, dispo)
{
	var parent = champ;
	var nom = champ.firstChild;
	var prenom = nom.nextSibling;
	var  place = prenom.nextSibling;
	var titulaire = place.nextSibling;
	
	if(dispo=="titulaire dans une equipe")
	{
		nom.style.backgroundColor = "#9f0000";
		prenom.style.backgroundColor = "#9f0000";
		place.style.backgroundColor = "#9f0000";
		titulaire.style.backgroundColor = "#9f0000";
		
		nom.style.color = "white";
		prenom.style.color = "white";
		place.style.color = "white";
		titulaire.style.color = "white";
	}
	else if (dispo=="ne joue dans aucune equipe"){
		nom.style.backgroundColor = "white";
		prenom.style.backgroundColor = "white";
		place.style.backgroundColor = "white";
		titulaire.style.backgroundColor = "white";
		nom.style.color = "black";
		prenom.style.color = "black";
		place.style.color = "black";
		titulaire.style.color = "black";
	}
	else
	{
		nom.style.backgroundColor = "#b6e3c9";
		prenom.style.backgroundColor = "#b6e3c9";
		place.style.backgroundColor = "#b6e3c9";
		titulaire.style.backgroundColor = "#b6e3c9";
		nom.style.color = "black";
		prenom.style.color = "black";
		place.style.color = "black";
		titulaire.style.color = "black";
	}
}
function sourisDehorsCase2(champ, dispo)
{
	var parent = champ;
	var nom = champ.firstChild;
	var prenom = nom.nextSibling;
	var  place = prenom.nextSibling;
	var titulaire = place.nextSibling;
	
	if(dispo=="non")
	{
		nom.style.backgroundColor = "white";
		prenom.style.backgroundColor = "white";
		place.style.backgroundColor = "white";
		titulaire.style.backgroundColor = "white";
		
		nom.style.color = "black";
		prenom.style.color = "black";
		place.style.color = "black";
		titulaire.style.color = "black";
	}
	else
	{
		nom.style.backgroundColor = "#b6e3c9";
		prenom.style.backgroundColor = "#b6e3c9";
		place.style.backgroundColor = "#b6e3c9";
		titulaire.style.backgroundColor = "#b6e3c9";
		nom.style.color = "black";
		prenom.style.color = "black";
		place.style.color = "black";
		titulaire.style.color = "black";
	}
}
function validerJoueurExt(champ, equipetype, pseudo, club, titu)
{
	if(titu=="non")
	{
		var continuer = confirm("Attention, le joueur que vous essayez de prendre joue d\351j\340 en temps que titulaire dans une autre \351quipe. Si vous continuez, cette \351quipe pourrait bien se retrouver en sous-nombre. Il est conseill\351 de voir avec l'entraineur du joueur en question afin de s'assurer que son absence ne soit pas genante. Voulez vous quand meme continuer ?");
	}
	else
	{
		continuer=true;
	}
	if(continuer == true)
	{
		var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
		        xhr = new XMLHttpRequest();
			} 
			else {
			    try {
			         xhr = new ActiveXObject("Msxml2.XMLHTTP");
			    } 
				catch(e) {
			        xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
			}
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}	         
		xhr.open("GET", "traitementRequete2.php?cle=4&club="+club+"&equipetype="+equipetype+"&pseudo="+pseudo+"&titu="+titu, false);
		xhr.send(null);
		document.getElementById('partieGaucheStrategie').innerHTML=xhr.responseText;
		document.getElementById('ligthBox').style.visibility = "hidden";
		document.getElementById('boiteDessus').style.visibility = "hidden";
	}	
	else
	{
		alert("Le changement a \351t\351 annul\351");
	}
}
function fermerInfos()
{
	document.getElementById('blockInfoStrat').style.visibility="hidden";
}

function selec(champ)
{
	champ.style.backgroundColor = "midnightblue";
	champ.style.color = "white";
}
function deselec(champ)
{
	champ.style.backgroundColor = "white";
	champ.style.color = "black";
}

function menuEditionStrat(event, nom, prenom, pseudo)
{
	var posX = event.clientX+ (document.documentElement.scrollLeft + document.body.scrollLeft);
	var posY = event.clientY+(document.documentElement.scrollTop + document.body.scrollTop);
	var CMenu; 
	CMenu = document.getElementById('CMenu');
	CMenu.style.visibility= "hidden";
	CMenu= document.getElementById('menuEditionStrat');
	CMenu.style.visibility= "visible";
	CMenu.style.top = posY-156+"px";
	CMenu.style.left = posX+"px";
	CMenu.innerHTML ="<table class=\"texte1\"><tr height=\"20\" onClick=\"detitulariser('"+pseudo+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">D&eacute;titulariser</td></tr><tr height=\"20\" onClick=\"sortirDeLequipe('"+pseudo+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">Sortir de l'&eacute;quipe</td></tr><tr height=\"10\"><td colspan=\"2\"><hr width=\"80%\" align=\"center\"></td></tr><tr height=\"20\" onClick=\"voirFiche('"+pseudo+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">Voir Fiche</td></tr></table>";
}
function menuEditionStratTactic(event, nom, prenom, pseudo, date)
{
	var posX = event.clientX+ (document.documentElement.scrollLeft + document.body.scrollLeft);
	var posY = event.clientY+(document.documentElement.scrollTop + document.body.scrollTop);
	var CMenu; 
	CMenu = document.getElementById('CMenu');
	CMenu.style.visibility= "hidden";
	CMenu= document.getElementById('menuEditionStrat');
	CMenu.style.visibility= "visible";
	CMenu.style.top = posY-156+"px";
	CMenu.style.left = posX+"px";
	CMenu.innerHTML ="<table style=\"width=\\\"290\\\"\" cellpadding=\"0\" cellspacing=\"0\" class=\"texte1\" style=\"display:inline;\"><tr height=\"20\" onClick=\"detitulariserTactic('"+pseudo+"', '"+date+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">D&eacute;titulariser</td></tr><tr height=\"20\" onClick=\"nepasconvoquer('"+pseudo+"', '"+date+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">Ne pas convoquer</td></tr><tr height=\"10\"><td colspan=\"2\"><hr width=\"80%\" align=\"center\"></td></tr><tr height=\"20\" onClick=\"voirFiche('"+pseudo+"');\" onMouseOut=\"deselec(this)\" onMouseOver=\"selec(this)\"><td width=\"25\"></td><td width=\"175\">Voir Fiche</td></tr></table>";
}

function detitulariser(pseudo)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	xhr.open("GET", "traitementRequete2.php?cle=7&pseudo="+pseudo, false);
	xhr.send(null);
	window.location.reload();
}
function sortirDeLequipe(pseudo)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	xhr.open("GET", "traitementRequete2.php?cle=70&pseudo="+pseudo, false);
	xhr.send(null);
	window.location.reload();
}

function nepasconvoquer(pseudo, date)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	xhr.open("GET", "traitementRequete2.php?cle=71&pseudo="+pseudo+"&date="+date, false);
	xhr.send(null);
	window.location.reload();
}

function detitulariserMasse(eqp, idclub)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	xhr.open("GET", "traitementRequete2.php?cle=58&equipetype="+eqp+"&idclub="+idclub, false);
	xhr.send(null);
	window.location.reload();
}

function voirFiche(pseudo)
{
	document.location ='voirjoueur.php?login='+pseudo;
}

function formation1(formation, formation2)
	{
				var terrain = document.getElementById("idTerrain");
				var t = new Array(0, 0);
				
				t[0] = terrain.offsetLeft;
//alert('Ceci vous montre la formation type et non la formation que l\'entraineur a choisie pour  son prochain match !');
				t[1] = terrain.offsetTop;
				while(terrain.offsetParent){
					terrain = terrain.offsetParent;
					t[0] += terrain.offsetLeft;
					t[1] += terrain.offsetTop;
				}
				var y = t[1]-145;
				var x = t[0]+15;
				
				if(formation=="1")
				{	
					if(formation2=="O")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(240))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(460))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(460))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
					else if(formation2=="N")
					{
						
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
					else if(formation2=="D")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(270))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(270))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation=="2")
				{
					if(formation2=="O")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(320))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(320))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(450))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
					else if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
					}
					else if(formation2=="D")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(380))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(440))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(380))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
					}
				}
				else if(formation=="3")
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(90))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(360))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(360))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(305))+"px";
					}
				}
				else if(formation==4)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(200))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(200))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(310))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(60))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(310))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(250))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation==5)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(60))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(250))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(290))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(290))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation==6)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(210))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(105))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(210))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(220))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
				}
				else if(formation==7)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(390))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(220))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(390))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(420))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
				}
			 }
			 
			 function remplacerTactic(champ, eqp, date)
	{
		changerCouleurIn2(champ);
		var xhr;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhr = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhr = new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhr = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		        
		      /*  xhr.onreadystatechange = function() {
		                if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		                   
							document.getElementById('bordel').innerHTML = xhr.responseText;			
		                }*/
		       // } 
		        
		        var equipetype = eqp;
				var date = date;
		        xhr.open("GET", "traitementRequete2.php?cle=50&posJoueur="+champ.id+"&equipetype=" + equipetype+"&date="+date, false);
		        xhr.send(null);
				document.getElementById('bordel').innerHTML = xhr.responseText;	
				var doc = document.getElementById('petitMenuStrategie');
				var blocEnCoursY=0;
				var blocEnCoursX=0;
				var elem = champ;
				while(elem.offsetParent)
					{
						blocEnCoursY=blocEnCoursY + elem.offsetTop;
						blocEnCoursX=blocEnCoursX + elem.offsetLeft;
						elem = elem.offsetParent;
					}
					
					
				var bck = document.getElementById('bordel');
				bck.style.left = blocEnCoursX +83+"px";
				bck.style.top = blocEnCoursY-156+"px";
				
	}
	
	function rectifierBDDTactic(place, pseudo, pseudoAncien, eqp, date)
	{
		var xhr;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhr = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhr = new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhr = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		        
		      /*  xhr.onreadystatechange = function() {
		                if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		                   
							document.getElementById('bordel').innerHTML = xhr.responseText;			
		                }*/
		       // } 
		        
		        var equipetype = eqp;
				var date = date;
		        xhr.open("GET", "traitementRequete2.php?cle=51&pseudo="+pseudo+"&place=" +place+"&pseudoAncien="+pseudoAncien+"&date="+date+"&equipetype="+equipetype, false);
		        xhr.send(null);
				//document.getElementById('menuGaucheStrategie3').innerHTML = xhr.responseText;
	}
	function validerChangementTactic(champ, idChamp1, pseudo2, eqp, date)
	{	
		//alert(document.getElementById('menuGaucheStrategie3').innerHTML);
		//document.getElementById('menuGaucheStrategie3').innerHTML = "";
		  var i;
		for(i=1; i<12; ++i)
		{
			if(idChamp1==(i+"a") || idChamp1==(i+"b"))
			{
			pseudo = document.getElementById(i+'a').innerHTML;
			
			//var parent = document.getElementById($i+'a').parentNode;
			//parent.innerHTML = "<td class=\"caseStrategieGauche\" id=\""+$i+"a\" onmouseover=\"changerCouleurIn2(this)\" onmouseout=\"changerCouleurOut2(this)\">"+pseudo2+"</td><td class=\"caseStrategieDroite\" id=\""+$i+"b\" onmouseover=\"remplacer2(this, '"+pseudo2+"')\" onmouseout=\"changerCouleurOut2(this)\">Remplacer</td>";
			rectifierBDDTactic(i,pseudo2, pseudo, eqp, date);
			}
		}
		//document.getElementById('petitMenuStrategie').innerHTML = '';
		window.location.reload();
	}
	
	function sortirListeTactic(club, equipetype, boiteDessus, date, idmatch)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
		        
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 3)
		{
			//script d'attente
			var lig=document.getElementById('ligthBox');
			lig.innerHTML = "<span id=\"blockInte\"><img src=\"Images/chargement.gif\" /></span>";
			var blockInte = document.getElementById('blockInte');
			blockInte.style.position="absolute";
			blockInte.style.left = "40%";
			blockInte.style.top = "40%";
			
		}
		else if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		boiteDessus.innerHTML = xhr.responseText;	
		boiteDessus.style.marginLeft = "10%";
		boiteDessus.style.marginRight = "10%";
		document.getElementById('blockInte').innerHTML="";
		}
	} 
		        
	xhr.open("GET", "traitementRequete2.php?cle=53&club="+club+"&equipetype="+equipetype+"&date="+date+"&idmatch="+idmatch, true);
	xhr.send(null);
}

function ajouterJoueurTactic(eqp, idclub, date, idmatch)
{
	var ligthBox = document.getElementById('ligthBox').style;
	var opacity = 70;
	//On commence par regarder la taille de la fenetre
	//On incormpore un fond de cette taille

	ligthBox.top=(document.documentElement.scrollTop + document.body.scrollTop)+"px";
	ligthBox.left="0px";
	ligthBox.backgroundColor = "black";
	ligthBox.visibility = "visible";
	ligthBox.opacity = (opacity / 100);
    ligthBox.MozOpacity = (opacity / 100);
    ligthBox.KhtmlOpacity = (opacity / 100);
    ligthBox.filter = "alpha(opacity=" + opacity + ")";
	var boiteDessus = document.getElementById('boiteDessus');
	boiteDessus.style.visibility = "visible";
	sortirListeTactic(''+idclub+'', ''+eqp+'', boiteDessus, ''+date+'', ''+idmatch+'');
}


function validerJoueurExtTactic(champ, equipetype, pseudo, club, titu, date, idmatch)
{
	
	if(titu=="non")
	{
		var continuer = confirm("Attention, le joueur que vous essayez de prendre joue d\351j\340 en temps que titulaire dans une autre \351quipe. Si vous continuez, cette \351quipe pourrait bien se retrouver en sous-nombre. Il est conseill\351 de voir avec l'entraineur du joueur en question afin de s'assurer que son absence ne soit pas genante. Voulez vous quand meme continuer ?");
	}
	else
	{
		continuer=true;
	}
	if(continuer == true)
	{
		var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
		        xhr = new XMLHttpRequest();
		    } 
		    else {
		        try {
		            xhr = new ActiveXObject("Msxml2.XMLHTTP");
		        } 
					catch(e) {
		                xhr = new ActiveXObject("Microsoft.XMLHTTP");
		            }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}	         

		xhr.open("GET", "traitementRequete2.php?cle=54&club="+club+"&equipetype="+equipetype+"&pseudo="+pseudo+"&titu="+titu+"&date="+date+"&idmatch="+idmatch, false);
		
		xhr.send(null);
		
		document.getElementById('partieGaucheStrategie').innerHTML=xhr.responseText;
		document.getElementById('ligthBox').style.visibility = "hidden";
		document.getElementById('boiteDessus').style.visibility = "hidden";
	}	
	else
	{
		alert("Le changement a été annulé");
	}
}

function detitulariserTactic(pseudo, date)
{
	var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         

	xhr.open("GET", "traitementRequete2.php?cle=57&pseudo="+pseudo+"&date="+date, false);
	xhr.send(null);
	window.location.reload();
}

function enregistrerForum(nom, prenom, pseudo, idjoueur){
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	
	xhr.open("GET", "traitementForum.php?nom="+nom+"&prenom="+prenom+"&pseudo="+pseudo+"&idjoueur="+idjoueur, false);
	xhr.send(null);

}
function modifierForum(nom, prenom, pseudo, idjoueur){
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}	         
	xhr.open("GET", "traitementForum.php?cle=2&nom="+escape(nom)+"&prenom="+escape(prenom)+"&pseudo="+pseudo+"&idjoueur="+idjoueur, false);
	xhr.send(null);
	alert(xhr.responseText);
}

function bbcode(bbdebut, bbfin)
{
var input = window.document.formulaire.message;
input.focus();
if(typeof document.selection != 'undefined')
{
var range = document.selection.createRange();
var insText = range.text;
range.text = bbdebut + insText + bbfin;
range = document.selection.createRange();
if (insText.length == 0)
{
range.move('character', -bbfin.length);
}
else
{
range.moveStart('character', bbdebut.length + insText.length + bbfin.length);
}
range.select();
}
else if(typeof input.selectionStart != 'undefined')
{
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + bbdebut + insText + bbfin + input.value.substr(end);
var pos;
if (insText.length == 0)
{
pos = start + bbdebut.length;
}
else
{
pos = start + bbdebut.length + insText.length + bbfin.length;
}
input.selectionStart = pos;
input.selectionEnd = pos;
}
 
else
{
var pos;
var re = new RegExp('^[0-9]{0,3}$');
while(!re.test(pos))
{
pos = prompt("insertion (0.." + input.value.length + "):", "0");
}
if(pos > input.value.length)
{
pos = input.value.length;
}
var insText = prompt("Veuillez taper le texte");
input.value = input.value.substr(0, pos) + bbdebut + insText + bbfin + input.value.substr(pos);
}
}
function smilies(img)
{
window.document.formulaire.message.value += '' + img + '';
}

function supprimerCategorie(club, categorie){
  if(confirm("Attention, si vous confirmez, tous les messages de la cat&eacute;gorie seront effac&eacute;s !")){
    window.location.href='forumclub.php?target=suppCat&club='+club+'&cat='+categorie;
  }
}

function monterCat(club, id, position){
  window.location.href='forumclub.php?target=monterCat&club='+club+'&id='+id+'&position='+position;
}

function descendreCat(club, id, position){
  window.location.href='forumclub.php?target=descendreCat&club='+club+'&id='+id+'&position='+position;
}

function recherchePseudo(champ){
  var balise = document.getElementById('pseudoValide');
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
		        
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		var repText = xhr.responseText;	
		var firstLetter = repText.charAt(0);
		if(firstLetter == '1'){
		  document.getElementById('validation').disabled = false;
		}else{
		  document.getElementById('validation').disabled = true;
		}
		balise.innerHTML = repText.substr(1);
		}
	} 
		        
	xhr.open("GET", "traitementRequete2.php?cle=59&pseudo="+champ.value, true);
	xhr.send(null);
}

function sauverNomJoueur(champ, idbut){
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
		        
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		alert(xhr.responseText);		
		}
	} 
		        
	xhr.open("GET", "traitementRequete2.php?cle=60&id="+champ.value+"&idbut="+idbut, true);
	xhr.send(null);
}

function sauverMinute(champ, idbut){
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
		        
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		alert(xhr.responseText);		
		}
	} 
		        
	xhr.open("GET", "traitementRequete2.php?cle=61&temps="+champ.value+"&idbut="+idbut, true);
	xhr.send(null);
}

function changerNote(champ,targ,idjoueur,date){
  var xhr;
	if(window.XMLHttpRequest || window.ActiveXObject) 
	{
	    if(window.XMLHttpRequest) {
	        xhr = new XMLHttpRequest();
	    } 
	    else {
	        try {
	            xhr = new ActiveXObject("Msxml2.XMLHTTP");
	        } 
				catch(e) {
	                xhr = new ActiveXObject("Microsoft.XMLHTTP");
	            }
	    }
	}
	else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return;
	}
		        
	xhr.onreadystatechange = function() 
	{
		if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {		
		}
	} 
		        
	xhr.open("GET", "traitementRequete2.php?cle=62&date="+date+"&target="+targ+"&value="+champ.value+"&idjoueur="+idjoueur, true);
	xhr.send(null);
}




























var dragged = null;
			var recize = null;
			var dX;
			var dY;
			var dX2;
			var dY2;
			var lundiX;
			var mardiX;
			var mercrediX;
			var jeudiX;
			var vendrediX;
			var samediX;
			var dimancheX;
			var lundiY;
			var tableauLigne = new Array();
			var heure;
			var minute;
			var top;
			var blocEnCoursY;
			var blocEnCoursY2;
			var heure2;
			var minute2;
			
			
			function chargerEmplois(idterrain)
			{
				var blocAgenda = document.getElementById('blocAgenda');
		
				var positionXBlocAgenda = 0;
				var positionYBlocAgenda = -154;
				
				do
				{
					positionXBlocAgenda = positionXBlocAgenda + blocAgenda.offsetLeft;
					positionYBlocAgenda = positionYBlocAgenda + blocAgenda.offsetTop;
					blocAgenda = blocAgenda.offsetParent;
					
				}while(blocAgenda && blocAgenda.style.position != "absolute");
				
				
				var xhb;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhb = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhb= new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhb = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		       	xhb.open("GET", "traitementRequete2.php?cle=2&cooX="+positionXBlocAgenda+"&cooY="+positionYBlocAgenda+"&idterrain="+idterrain, false);
				xhb.send(null);
				document.getElementById('collage').innerHTML = xhb.responseText;
				
			}

			function chargerGrille(idterrain)
			{
				
				lundiX=0;
				mardiX=0;
				mercrediX=0;
				jeudiX=0;
				vendrediX=0;
				samediX=0;
				dimancheX=0;
				lundiY=-158;
				
				var blocAgenda = document.getElementById('blocAgenda');
				var positionXBlocAgenda;
				var positionYBlocAgenda;
				
				do
					{
						positionXBlocAgenda = positionXBlocAgenda + blocAgenda.offsetLeft;
						positionYBlocAgenda = positionYBlocAgenda + blocAgenda.offsetTop;
						blocAgenda = blocAgenda.offsetParent;
						
					}while(blocAgenda && blocAgenda.style.position != "absolute");
				
				
				
				var elementLundiY=document.getElementById('lundi');
				do
				{
					lundiY = lundiY + elementLundiY.offsetTop;
					elementLundiY = elementLundiY.offsetParent;
					
				}while(elementLundiY && elementLundiY.style.position != "absolute");
				tableauLigne[0]=lundiY+3;
				var i =0;
				
				for(i=1; i<164; ++i)
				{
					tableauLigne[i]=tableauLigne[i-1]+8;
				}
				
				var elementLundi=document.getElementById('lundi');
				do
				{
					lundiX = lundiX + elementLundi.offsetLeft;
					elementLundi = elementLundi.offsetParent;
					
				}while(elementLundi && elementLundi.style.position != "absolute");
				
				var elementMardi=document.getElementById('mardi');
				do
				{
					mardiX = mardiX + elementMardi.offsetLeft;
					elementMardi = elementMardi.offsetParent;
					
				}while(elementMardi && elementMardi.style.position != "absolute");
				
				var elementMercredi=document.getElementById('mercredi');
				do
				{
					mercrediX = mercrediX + elementMercredi.offsetLeft;
					elementMercredi = elementMercredi.offsetParent;
					
				}while(elementMercredi && elementMercredi.style.position != "absolute");
				
				var elementJeudi=document.getElementById('jeudi');
				do
				{
					jeudiX = jeudiX + elementJeudi.offsetLeft;
					elementJeudi = elementJeudi.offsetParent;
					
				}while(elementJeudi && elementJeudi.style.position != "absolute");
				
				var elementVendredi=document.getElementById('vendredi');
				do
				{
					vendrediX = vendrediX + elementVendredi.offsetLeft;
					elementVendredi = elementVendredi.offsetParent;
					
				}while(elementVendredi && elementVendredi.style.position != "absolute");
				
				var elementSamedi=document.getElementById('samedi');
				do
				{
					samediX = samediX + elementSamedi.offsetLeft;
					elementSamedi = elementSamedi.offsetParent;
					
				}while(elementSamedi && elementSamedi.style.position != "absolute");
				
				var elementDimanche=document.getElementById('dimanche');
				do
				{
					dimancheX = dimancheX + elementDimanche.offsetLeft;
					elementDimanche = elementDimanche.offsetParent;
					
				}while(elementDimanche && elementDimanche.style.position != "absolute");
				chargerEmplois(idterrain);
			}
			function creerBlock()
			{
			
				var xhb;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhb = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhb= new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhb = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		        
		        	        
		        var equpe = document.getElementById('equipe').value;
				if(equpe=="tous")
				{
					equpe="Tout le monde";
					var entraineur = "Non communiqu&eacute;";
				}
				else
				{
					xhb.open("GET", "traitementRequete.php?equipe=" + equpe+"&cible=configurerEquipe", false);
					xhb.send(null);
				
		            document.getElementById('secret').innerHTML = xhb.responseText;
							//alert(xhb.responseText);		
		        
				
					var entraineur = document.getElementById('entraineur1').value;
					equpe=document.getElementById('nomEquipe').value;
				}
			//	alert("test");
				var categorie = document.getElementById('categorie').value;
				
				
				
				
				var blockGeneral = document.createElement("div");
				blockGeneral.setAttribute("id","entrain");
				blockGeneral.innerHTML = "<div id=\"entrainH\" style=\"cursor:pointer;\" onmousedown=\"demarrerBouger(this, event)\"><span id=\"mnH\">8h-10h</span><button class=\"boutonEchap\" onclick=\"fermer(this)\">x</button></div><div id=\"entrainM\"><span id=\"nomEquipe\">"+equpe+"</span><br /><span id=\"categorieEquipe\">"+categorie+"</span><br /><span id=\"entraineurEquipe\">"+entraineur+"</span></div><div id=\"entrainB\" style=\"cursor:s-resize;\" onmousedown=\"changerDimension(this, event)\"></div>";
				var parent=document.getElementById('collage');
				parent.appendChild(blockGeneral);
				blockGeneral.style.top = lundiY;
				blockGeneral.style.left = lundiX;
			}
			
			function fermer(champ)
			{
				var blockHaut = champ.parentNode;
				var blockGeneral = blockHaut.parentNode;
				var parent = blockGeneral.parentNode;
				parent.removeChild(blockGeneral);
			}
			
			function demarrerBouger(champ, event)
			{
				dragged= champ.parentNode;
				var x = event.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft);
				var y = event.clientY + (document.body.scrollTop || document.documentElement.scrollTop);
			
				var ox = dragged.offsetLeft;
				var oy = dragged.offsetTop;
				
				dX = x-ox;
				dY = y-oy;
			}
			
			
			
			function arreter(event)
			{
				dragged=null;
				recize=null;
			}
			
			function changerCurseur(champ)
			{
				champ.style.cursor="hand";
			}
			
			function changerDimension(champ, event)
			{
				recize= champ.parentNode;
				
				var y = event.clientY + (document.body.scrollTop || document.documentElement.scrollTop);

				var oy = recize.offsetTop;
				
				dY2 = y-oy;
			}
			
			
function bouger(event)
			{
				if(dragged)
				{
					var x = event.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft);
					var y = event.clientY + (document.body.scrollTop || document.documentElement.scrollTop);
					
					x=x-dX;
					y=y-dY;
					if((x-lundiX)<20 && (x-lundiX)>-20)
					{
						dragged.style.left = lundiX+"px";
					}
					else if((x-mardiX)<20 && (x-mardiX)>-20)
					{
						dragged.style.left = mardiX+"px";
					}
					else if((x-mercrediX)<20 && (x-mercrediX)>-20)
					{
						dragged.style.left = mercrediX+"px";
					}
					else if((x-jeudiX)<20 && (x-jeudiX)>-20)
					{
						dragged.style.left = jeudiX+"px";
					}
					else if((x-vendrediX)<20 && (x-vendrediX)>-20)
					{
						dragged.style.left = vendrediX+"px";
					}
					else if((x-samediX)<20 && (x-samediX)>-20)
					{
						dragged.style.left = samediX+"px";
					}
					else if((x-dimancheX)<20 && (x-dimancheX)>-20)
					{
						dragged.style.left = dimancheX+"px";
					}
					else
					{
						dragged.style.left = x+"px";
					}
					var j;
					var a=0;
					for(j=0;j<64;j++)
					{
						if((y-tableauLigne[j])<5 && (y-tableauLigne[j]>-5))
						{
							dragged.style.top = tableauLigne[j]+"px";
							var entH= dragged.firstChild;
							var entM=entH.nextSibling;
							var entB = entM.nextSibling;
							var entBB = entB;
							
							blocEnCoursY2=10
							do
							{
								blocEnCoursY2=blocEnCoursY2 + entB.offsetTop;
								entB = entB.offsetParent;
							}while(entB && entB.style.position != "absolute");
							//alert(blocEnCoursY2);
							minute = j*15;
							minute2 = (blocEnCoursY2-tableauLigne[j])/8*15+15+minute;
						//	alert(entB.id);
							
							
							
							heure2 = Math.floor((minute2/60)+3);
							minute2 = ((minute2%60)/15)*15;
							
							var mnH=entH.firstChild;
							
							heure = Math.floor(minute/60)+8;
							minute = minute%60;
							mnH.innerHTML =heure+"h"+minute;
							entBB.innerHTML = heure2+"h"+minute2;
							a=1
						}
					}
					if(a==0)
					{
						dragged.style.top = y+"px";
					}
					
				}
				else if(recize)
				{
					var y = event.clientY + (document.body.scrollTop || document.documentElement.scrollTop);
					//y=y-dY2;
					
					var elem = recize;
					blocEnCoursY =3;
					do
					{
						blocEnCoursY=blocEnCoursY + elem.offsetTop;
						elem = elem.offsetParent;
					}while(elem && elem.style.position != "absolute");
					
					
					/*recize.style.height = (y-blocEnCoursY)+"px";
					var nouveau = recize.firstChild;
					nouveau = nouveau.nextSibling;
					nouveau.style.height =((y-blocEnCoursY)-27)+"px";*/
					var j;
					
					for(j=0;j<164;j++)
					{
						if(y-(tableauLigne[j])<5 && (y-tableauLigne[j])>-5)
						{
							recize.style.height = (tableauLigne[j]-blocEnCoursY)+"px";
							var nouveau = recize.firstChild;
							nouveau = nouveau.nextSibling;
							nouveau.style.height = (tableauLigne[j]-blocEnCoursY-27)+"px";
							var entH= recize.firstChild;
							//alert(nouveau.id);
						
							var mnH=entH.nextSibling;
							mnH=mnH.nextSibling;
							minute = j*15;
							heure = Math.floor(minute/60)+3;
							minute = minute%60;
							mnH.innerHTML =heure+"h"+minute;
							
						}
	    
						
					}
					
				}
			}
    function preparerEquipe(champ)
			{
				var xhr;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhr = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhr = new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhr = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		        
		        xhr.onreadystatechange = function() {
		                if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
		                    document.getElementById('equipediv').innerHTML = xhr.responseText;
											
		                }
		        } 
		        
		        var categorie = champ.value;
		        xhr.open("GET", "traitementRequete.php?cle=8&categorie="+categorie, true);
		        xhr.send(null);
								
			}
			


function sauvegarder(idclub)
			{
				var collage = document.getElementById('collage');
				var crenoListe = collage.childNodes;
				nbCreno=crenoListe.length;
				var terrain=document.getElementById('idterrain').value;
			

				var blocAgenda = document.getElementById('blocAgenda');
				var positionXBlocAgenda = 0;
				var positionYBlocAgenda = 0;
				
				do
				{
					positionXBlocAgenda = positionXBlocAgenda + blocAgenda.offsetLeft;
					positionYBlocAgenda = positionYBlocAgenda + blocAgenda.offsetTop;
					blocAgenda = blocAgenda.offsetParent;
					
				}while(blocAgenda && blocAgenda.style.position != "absolute");
				
				
				
				
				
				var xhb;
		        if(window.XMLHttpRequest || window.ActiveXObject) 
				{
		                if(window.XMLHttpRequest) {
		                        xhb = new XMLHttpRequest();
		                } 
		                else {
		                        try {
		                                xhb= new ActiveXObject("Msxml2.XMLHTTP");
		                        } catch(e) {
		                                xhb = new ActiveXObject("Microsoft.XMLHTTP");
		                        }
		                }
		        }
		        else {
		                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		                return;
		        }
		        
		        	        
		       	xhb.open("GET", "traitementRequete.php?cible=supprimerdonnees&terrain="+terrain, false);
					xhb.send(null);
					
					
					
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				var i;
				alert("Enregistrement termin\351");
				for(i=0; i<nbCreno; ++i)
				{
				
					var element = crenoListe[i];
					if(crenoListe[i].id == "entrain")
					{
					var positionBlocX=0;
					var positionBlocY=0;
					var positionBlocBasY=10;
					
					do
					{
						positionBlocX = positionBlocX + element.offsetLeft;
						positionBlocY = positionBlocY + element.offsetTop;
						element = element.offsetParent;
						
					}while(element && element.style.position != "absolute");
					//Nous avons à présent les coordoonées du bloc principal dans positionsBlocX/Y
					
					element = crenoListe[i];
					element = element.firstChild;
					element = element.nextSibling;
					element = element.nextSibling;
					do
					{
						positionBlocBasY = positionBlocBasY + element.offsetTop;
						element = element.offsetParent;
					}while(element && element.style.position != "absolute");
					var duree = positionBlocBasY - positionBlocY;
					duree = Math.round(duree/8);
					duree = duree*15;
					
					element = crenoListe[i];
					element = element.firstChild;
					var entete = element.firstChild;
					var heureDebut = entete.innerHTML;
					
					element = element.nextSibling;
					var pied = element.nextSibling;
					
					var heureFin = pied.innerHTML;
					
					element = element.firstChild;
					var nomEquipe = element.innerHTML;
					
					element = element.nextSibling;
					element = element.nextSibling;
					var categorie = element.innerHTML;
					
					element = element.nextSibling;
					element = element.nextSibling;
					var entraineur = element.innerHTML;
					
					var xhr;
			        if(window.XMLHttpRequest || window.ActiveXObject) 
					{
			                if(window.XMLHttpRequest) {
			                        xhr = new XMLHttpRequest();
			                } 
			                else {
			                        try {
			                                xhr = new ActiveXObject("Msxml2.XMLHTTP");
			                        } catch(e) {
			                                xhr = new ActiveXObject("Microsoft.XMLHTTP");
			                        }
			                }
			        }
			        else {
			                alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			                return;
			        }
			        
			       
			                  
					positionBlocX = positionBlocX - positionXBlocAgenda;
					positionBlocY = positionBlocY - positionYBlocAgenda;
					
				//if(entraineur== "Non communiqu\351"){entraineur = "Non communiqué";}
			        xhr.open("GET", "traitementRequete.php?heuredebut="+heureDebut+"&heurefin="+heureFin+"&cible=enregistreragenda&terrain=" +terrain+ "&categorie="+categorie+"&nomEquipe=" +escape(nomEquipe)+ "&entraineur=" +escape(entraineur)+ "&duree=" +duree+ "&positiontop=" +positionBlocY+ "&positionleft=" +positionBlocX+ "&idclub="+idclub, false);
			        xhr.send(null);	
					}
				}
				
			}





function formation2(formation, formation2)
	{
				var terrain = document.getElementById("idTerrain");
				var t = new Array(0, 0);
				
				t[0] = terrain.offsetLeft;
//alert('Ceci vous montre la formation type et non la formation que l\'entraineur a choisie pour  son prochain match !');
				t[1] = terrain.offsetTop;
				while(terrain.offsetParent){
					terrain = terrain.offsetParent;
					t[0] += terrain.offsetLeft;
					t[1] += terrain.offsetTop;
				}
				var y = t[1]+15;
				var x = t[0]+30
				
				if(formation=="1")
				{	
					if(formation2=="O")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(240))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(460))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(460))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
					else if(formation2=="N")
					{
						
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
					else if(formation2=="D")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(270))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(270))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation=="2")
				{
					if(formation2=="O")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(320))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(320))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(410))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(450))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
					else if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(120))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(260))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(400))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
					}
					else if(formation2=="D")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(275))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(380))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(30))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(440))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(380))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(275))+"px";
					}
				}
				else if(formation=="3")
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(140))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(90))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(360))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(360))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(305))+"px";
					}
				}
				else if(formation==4)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(200))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(200))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(310))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(60))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(280))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(310))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(250))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation==5)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(60))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(130))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(250))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(290))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(250))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(290))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(210))+"px";
					}
				}
				else if(formation==6)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
					
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(210))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(80))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(105))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(160))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(230))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(210))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(295))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(220))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(350))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(430))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
				}
				else if(formation==7)
				{
					if(formation2=="N")
					{
						document.getElementById('strategie1').style.top=(parseInt(y)+parseInt(0))+"px";//-290
						document.getElementById('strategie1').style.left=(parseInt(x)+parseInt(155))+"px";//-350
						
						document.getElementById('strategie2').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie2').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie3').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie3').style.left=(parseInt(x)+parseInt(95))+"px";
						
						document.getElementById('strategie4').style.top=(parseInt(y)+parseInt(110))+"px";
						document.getElementById('strategie4').style.left=(parseInt(x)+parseInt(210))+"px";
						
						document.getElementById('strategie5').style.top=(parseInt(y)+parseInt(170))+"px";
						document.getElementById('strategie5').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie6').style.top=(parseInt(y)+parseInt(390))+"px";
						document.getElementById('strategie6').style.left=(parseInt(x)+parseInt(0))+"px";
						
						document.getElementById('strategie7').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie7').style.left=(parseInt(x)+parseInt(75))+"px";
						
						document.getElementById('strategie8').style.top=(parseInt(y)+parseInt(220))+"px";
						document.getElementById('strategie8').style.left=(parseInt(x)+parseInt(155))+"px";
						
						document.getElementById('strategie9').style.top=(parseInt(y)+parseInt(300))+"px";
						document.getElementById('strategie9').style.left=(parseInt(x)+parseInt(240))+"px";
						
						document.getElementById('strategie10').style.top=(parseInt(y)+parseInt(390))+"px";
						document.getElementById('strategie10').style.left=(parseInt(x)+parseInt(305))+"px";
						
						document.getElementById('strategie11').style.top=(parseInt(y)+parseInt(420))+"px";
						document.getElementById('strategie11').style.left=(parseInt(x)+parseInt(155))+"px";
					}
				}
			 }
			 

function validerNomJoueur(champ){
    window.location.replace("voirjoueur?login="+champ);

}

function changementSelection(champ, listejoueur){
    var valeur = champ.value;
    var reste = document.getElementById('reste');
    if(valeur==1){
      reste.innerHTML = "<form method='post' action='gestionbudget.php?target=licence'>"+listejoueur+" a pay\351 sa licence <input type='text' name='solde' size='5'/> euros <br /><br /><input type='submit' value='Envoyer' /></form>";
    }
    else if(valeur==2){
      reste.innerHTML = "<form method='post' action='gestionbudget.php?target=debit'>D\351bit de <input type='text' name='debit' size='7'/> euros<br />Description <input type='text' name='motif2' /><br /><br /><input type='submit' value='Envoyer' /></form>";
    }
    else if(valeur==3){
      reste.innerHTML = "<form method='post' action='gestionbudget.php?target=credit'>Cr\351dit de <input type='text' name='credit' size='7'/> euros<br />Description <input type='text' name='motif2' /><br /><br /><input type='submit' value='Envoyer' /></form>";
    }
    else{
	reste.innerHTML = "";
    }
}

function montrerListeEquipe(idclub){
  var boite = document.getElementById('selectBoxUnder');
    if(superglobaleListe==0){
	    var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
		    } 
		    else {
			try {
			    xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} 
					catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}
				
		xhr.onreadystatechange = function() 
		{
			boite.innerHTML=xhr.responseText;
			boite.style.visibility = "visible";
			superglobaleListe=1;
		} 
				
		xhr.open("GET", "traitementRequete2.php?cle=83&idclub="+idclub, true);
		xhr.send(null);
	}
	else{
		boite.style.visibility = "visible";
	}
}
function fermerLaBoite(){
      var boite = document.getElementById('selectBoxUnder');
      boite.style.visibility='hidden';
}

function montrerListeEntraineur(idclub){
  var boite = document.getElementById('selectBoxUnder');
    if(superglobaleListe==0){
	    var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
		    } 
		    else {
			try {
			    xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} 
					catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}
				
		xhr.onreadystatechange = function() 
		{
			boite.innerHTML=xhr.responseText;
			boite.style.visibility = "visible";
			superglobaleListe=1;
		} 
				
		xhr.open("GET", "traitementRequete2.php?cle=84&idclub="+idclub, true);
		xhr.send(null);
	}
	else{
		boite.style.visibility = "visible";
	}
}
function montrerListeEntrainement(idclub){
  var boite = document.getElementById('selectBoxUnder');
    if(superglobaleListe==0){
	    var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
		    } 
		    else {
			try {
			    xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} 
					catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}
				
		xhr.onreadystatechange = function() 
		{
			boite.innerHTML=xhr.responseText;
			boite.style.visibility = "visible";
			superglobaleListe=1;
		} 
				
		xhr.open("GET", "traitementRequete2.php?cle=85&idclub="+idclub, true);
		xhr.send(null);
	}
	else{
		boite.style.visibility = "visible";
	}
}
function montrerDescription(champ, id){
	var block = document.getElementById('blockDescription');
	var t = new Array(0, 0);
				
	t[0] = champ.offsetLeft;
	t[1] = champ.offsetTop;
	while(champ.offsetParent){
		champ = champ.offsetParent;
		t[0] += champ.offsetLeft;
		t[1] += champ.offsetTop;
	}
	var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
		    } 
		    else {
			try {
			    xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} 
					catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}
				
		xhr.onreadystatechange = function() 
		{
			block.innerHTML=xhr.responseText;
			var hauteur = block.style.height;
			block.style.top = (t[1]-hauteur-200)+"px";
			block.style.left = (t[0]+50)+"px";
			block.style.visibility = "visible";
		} 
				
		xhr.open("GET", "traitementRequete2.php?cle=86&id="+id, true);
		xhr.send(null);
	
}
function cacherDescription(champ, id){
	var block = document.getElementById('blockDescription');
	block.style.visibility = 'hidden';
}
function viderzone(champ){
    if(champ.innerHTML=="Entrez la description de l\'exercice ici"){
	champ.innerHTML = "";
    }
   
}
function chargerpage(lien){
    window.location.replace(lien);
}

function mettreNoteAJour(champ, id){
    var xhr;
    if(window.XMLHttpRequest || window.ActiveXObject) 
    {
	if(window.XMLHttpRequest) {
	    xhr = new XMLHttpRequest();
	} 
	else {
	    try {
		xhr = new ActiveXObject("Msxml2.XMLHTTP");
	    } 
			    catch(e) {
		    xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
    }
    else {
	    alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
	    return;
    }
		    
		    
    xhr.open("GET", "traitementRequete2.php?cle=87&id="+id+"&value="+champ.value, true);
    xhr.send(null);
}

function changerPresence(champ, id){
    var xhr;
    if(window.XMLHttpRequest || window.ActiveXObject) 
    {
	if(window.XMLHttpRequest) {
	    xhr = new XMLHttpRequest();
	} 
	else {
	    try {
		xhr = new ActiveXObject("Msxml2.XMLHTTP");
	    } 
			    catch(e) {
		    xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
    }
    else {
	    alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
	    return;
    }
		    
		    
    xhr.open("GET", "traitementRequete2.php?cle=88&id="+id+"&value="+champ.value, true);
    xhr.send(null);
}
function montrerListeMatch(){
   if(superglobaleListe2==0){
	  var boite = document.getElementById('selectBoxUnder2');
	  boite.style.visibility='visible';
	  boite.innerHTML = "<div class='selectInner'><input type='checkbox' name='passe' />Passes</div><div class='selectInner'><input type='checkbox' name='drible' />Dribles</div><div class='selectInner'><input type='checkbox' name='amorti' />Amortis</div><div class='selectInner'><input type='checkbox' name='recuperation' />R&eacute;cup&eacute;ration</div><div class='selectInner'><input type='checkbox' name='vitesse' />Vitesse</div><div class='selectInner'><input type='checkbox' name='acceleration' />Acc&eacute;l&eacute;ration</div><div class='selectInner'><input type='checkbox' name='vision' />Vision du jeu</div><div class='selectInner'><input type='checkbox' name='endurance' />Endurance</div><div class='selectInner'><input type='checkbox' name='fairplay' />Fairplay</div><div class='selectInner'><input type='checkbox' name='consigne' />Consignes</div><div class='selectInner'><input type='checkbox' name='temps' />Temps jou&eacute;</div>";
	  superglobaleListe2=1;
  }
  else{
    	  var boite = document.getElementById('selectBoxUnder2');
	  boite.style.visibility='visible';
  }
}


function montrerListeEntrainement2(idclub){
  var boite = document.getElementById('selectBoxUnder');
    if(superglobaleListe==0){
	    var xhr;
		if(window.XMLHttpRequest || window.ActiveXObject) 
		{
		    if(window.XMLHttpRequest) {
			xhr = new XMLHttpRequest();
		    } 
		    else {
			try {
			    xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} 
					catch(e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			    }
		    }
		}
		else {
			alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
			return;
		}
				
		xhr.onreadystatechange = function() 
		{
			boite.innerHTML=xhr.responseText;
			boite.style.visibility = "visible";
			superglobaleListe=1;
		} 
				
		xhr.open("GET", "traitementRequete2.php?cle=89&idclub="+idclub, true);
		xhr.send(null);
	}
	else{
		boite.style.visibility = "visible";
	}
}
 
function verificationCheckbox(champ){
    var check = document.getElementById('validation');
    if(check.checked){
	  chargerpage("paiement_paypal.php");
    }
    else{
	  alert("Vous n'avez pas valid\351 avoir pris connaissance des conditions g\351n\351rales de vente");
    }
}	 	 	 	 	 	 	 	 	 	
