	var carte = new Array(2) ;
		carte[0] = new Array("http://colmard.fr/NFA054/images/D01.png", "http://colmard.fr/NFA054/images/D07.png", "http://colmard.fr/NFA054/images/D08.png", "http://colmard.fr/NFA054/images/D09.png", "http://colmard.fr/NFA054/images/D10.png", "http://colmard.fr/NFA054/images/D11.png", "http://colmard.fr/NFA054/images/D12.png", "http://colmard.fr/NFA054/images/D13.png", 
//		"http://colmard.fr/NFA054/images/P01.png", "http://colmard.fr/NFA054/images/P07.png", "http://colmard.fr/NFA054/images/P09.png", "http://colmard.fr/NFA054/images/P09.png", "http://colmard.fr/NFA054/images/P10.png", "http://colmard.fr/NFA054/images/P11.png", "http://colmard.fr/NFA054/images/P12.png", "http://colmard.fr/NFA054/images/P13.png", 
//		"http://colmard.fr/NFA054/images/H01.png", "http://colmard.fr/NFA054/images/H07.png", "http://colmard.fr/NFA054/images/H08.png", "http://colmard.fr/NFA054/images/H09.png", "http://colmard.fr/NFA054/images/H10.png", "http://colmard.fr/NFA054/images/H11.png", "http://colmard.fr/NFA054/images/H12.png", "http://colmard.fr/NFA054/images/H12.png", 
		"http://colmard.fr/NFA054/images/T01.png", "http://colmard.fr/NFA054/images/T07.png", "http://colmard.fr/NFA054/images/T08.png", "http://colmard.fr/NFA054/images/T09.png", "http://colmard.fr/NFA054/images/T10.png", "http://colmard.fr/NFA054/images/T11.png", "http://colmard.fr/NFA054/images/T12.png", "http://colmard.fr/NFA054/images/T13.png" );
		
		
		carte[1]= new Array
			("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", 
			"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" );
		var tablo = new Array(2);
		tablo[0] = new Array(32);		//	nom de l'image
		tablo[1] = new Array(32);		//	numero de l'image dans carte
		dertiree = 0, gel = 0; ;
		premcarte = "" ;
		cartedeux = "";
		nomimage = "" ;
		ancienne = "" ;
		
		nbimages = 16, nbcoups=0;
		
		function distribue()	{
			for ( i=0 ; i<32 ; i++ )	{
				do	{
					nbre = Math.floor(Math.random()*16);
					if ( carte[1][nbre]<2 )	{
						carte[1][nbre]++ ;
						tablo[0][i]=carte[0][nbre];
						tablo[1][i]=nbre;
						break;
					}
				}while (true);
			}
		}
		function examinercartes(idcliquee)	{
			// ne pas traiter les cartes déjà éliminées
			lavue = document.getElementById(idcliquee).name;
			if (lavue == "bleu")	{
	//			alert (lavue);
				return;
			}
			// empêche de cliquer pendant le temps d'examiner les 2 cartes
			if (gel == 1)	{
				return;
				}
			// enpêcher de cliquer sur la même
			if (idcliquee == ancienne)	{
				return
				}
			nomimage = tablo[0][idcliquee];
			document.getElementById(idcliquee).src = nomimage;
			
			if (dertiree==0)	{
				// on vient de cliquer sur la 1ère
				premcarte = nomimage; 
				dertiree = 1;		
				nbcoups++;	
				ancienne = idcliquee;
				}
			else	{
				//  on montre la 2ème carte et on bloque le jeu 1 seconde1s
				gel = 1 ;
				cartedeux = idcliquee;
				b = setTimeout("traiterseconde()", 1000);
				}
			}
			
		function traiterseconde()	{
			gel = 0;
			if (premcarte==nomimage)	{
				document.getElementById(cartedeux).src = "images/dos-bleu.png";
				document.getElementById(ancienne).src = "images/dos-bleu.png";
				document.getElementById(cartedeux).name = "bleu";
				document.getElementById(ancienne).name = "bleu";
				nbimages--;
				if (nbimages==0)
					alert ("vous avez réussi en " + nbcoups + " coups")
					}
				else	{
					document.getElementById(cartedeux).src = "images/dos-exca.png";
					document.getElementById(ancienne).src = "images/dos-exca.png";
					}
				dertiree = 0;
				ancienne = 99;
			}		
