function OnSauteA(Url) {
location.href=Url;
};

debut = new Date();
imgLoaded = 0;
CountAffichImg = new Array;
PathImg = new Array;
PassVerif = 0;
ImgRecord = new Array;
a1 = new Image;
a2 = new Image;
a2.src = 'jeu-brad-pitt-fond.jpg';
function loadImg()
	{
	a1.src = "jeu-brad-pitt-1.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-2.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-3.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-4.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-5.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-6.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-7.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-8.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-9.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-0.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-10.jpg";
	CountImg();
	a1.src = "jeu-brad-pitt-11.jpg";
	CountImg();
	RandomMem('i11',11);
	RandomMem('i12',12);
	RandomMem('i13',13);
	RandomMem('i14',14);
	RandomMem('i15',15);
	RandomMem('i16',16);
	RandomMem('i21',21);
	RandomMem('i22',22);
	RandomMem('i23',23);
	RandomMem('i24',24);
	RandomMem('i25',25);
	RandomMem('i26',26);
	RandomMem('i31',31);
	RandomMem('i32',32);
	RandomMem('i33',33);
	RandomMem('i34',34);
	RandomMem('i35',35);
	RandomMem('i36',36);
	RandomMem('i41',41);
	RandomMem('i42',42);
	RandomMem('i43',43);
	RandomMem('i44',44);
	RandomMem('i45',45);
	RandomMem('i46',46);
	//document.messMem.mess.value = "Maintenant, retrouvez les paires...";
	}
function CountImg()
{
PathImg[imgLoaded] = a1.src;
CountAffichImg[imgLoaded] = 0;
CountAffichImg[imgLoaded+12] = 0;
imgLoaded++;
return(true)
}
function RandomMem(imgName,ImgNb)
	{
	ImgTemp = Math.round(Math.random() * 11);
	while (CountAffichImg[ImgTemp]>=2)
		{
		ImgTemp = Math.round(Math.random() * 11);
		}
	ImgRecord[ImgNb] = PathImg[ImgTemp];
	CountAffichImg[ImgTemp]++;
	return(true);
	}
count = 0;
gagne=0;
function AddClic(ImgNb,ImgName)
{
if (PassVerif == 0)
	{
	if (ImgName.src != a2.src)
		{
		
		}
	else
		{
		ImgName.src = ImgRecord[ImgNb];
		count++;
		ImgNamey = ImgName;
		if (count == 1)
			{
			ImgNb1=ImgNb;
			ImgNamex=ImgNamey;
			ImgURL1=ImgRecord[ImgNb];
			}
		else
			{
			PassVerif=1;
			if (ImgRecord[ImgNb] == ImgURL1)
				{
				gagne++;
				if (gagne > 1) s="s";
				else s="";
				document.all.Temps.innerText = gagne + ' paire' + s + ' trouvée' + s + " sur 12.";
				PassVerif = 0;
				tempoMem2 = setTimeout("ImgNamey.src='blank.jpg';ImgNamex.src='blank.jpg';PassVerif = 0;", 200);
				count=0;
					if (gagne==12)
					{
					fin = new Date;
					duree = Math.round((fin - debut) / 1000);
					minutes = Math.floor(duree / 60);
					secondes = duree % 60;
					if (secondes<10) {secondes = "0" + secondes;};
                              		alert('Bravo ' + document.pourleclassement.TonPrenom.value + ' ! Tu as gagné en ' + minutes + ' mn et ' + secondes + ' s');
					Classem.location.href = 'http://www.jeux-gratuits-enfants.com/classement.php?Jeu=00011&Rajout=1&Cartes=24&TitreClasst=Jeu avec Brad Pitt&Prenom=' + document.pourleclassement.TonPrenom.value + '&Temps=' + minutes + ':' + secondes;
					}
				}
			else
				{
				tempoMem2 = setTimeout("ImgNamey.src='jeu-brad-pitt-fond.jpg';ImgNamex.src='jeu-brad-pitt-fond.jpg';PassVerif = 0;", 1200);
				count=0;
				}
			}
	}
}
}
ThisPage = location.href;

