	function ouv()
	{			
		strWinAtt = "fullscreen=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left=400,top=230,width=800,height=600";	
		open("visite.php","", strWinAtt);				
	}
	
	function ouvBan()
	{			
		strWinAtt = "fullscreen=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=400,top=230,width=800,height=600";	
		open("bannieres_jeu_gratuit_pirate.php","", strWinAtt);				
	}
	
	function ouvRegles()
	{			
		strWinAtt = "fullscreen=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=400,top=230,width=800,height=600";	
		open("regles-jeu-en-ligne_gratuit.php","", strWinAtt);				
	}
	
	function valu()
	{
		var nomail = document["form1"].elements["txtmail"].value;
		var nomi='';
			if(nomail == '')
			{
				alert('Merci de renseigner votre adresse email pour que nous vous renvoyons votre mot de passe.');
				document["form1"].elements["txtmail"].focus();
			}
			else
				window.location="receivepass.php?pse="+nomi+"&amp;mel="+nomail;
	}
	
	function chxpirate()
	{
		var piActu = document.getElementById("hidimgPi").value;
		piActu = parseInt(piActu) + 1;
		if(piActu == 16)
			piActu = 1;
		if(document.getElementById("hidSex").value == '0') // si c un homme
		{
			document.getElementById("imgPi").src='img/pirates/220/m'+piActu+'.gif';	
			document.getElementById("hidimgPi").value = piActu;
		}
		else // si c une femme
		{
			document.getElementById("imgPi").src='img/pirates/220/f'+piActu+'.gif';	
			document.getElementById("hidimgPi").value = piActu;
		}
	}
	

	function valida()
	{
		document.forms["form1"].submit();
	}
	function validaIns()
	{
		document.forms["formIns"].submit();
	}

	function effaInscr()
	{
		document.getElementById("divInscr").style.visibility = 'hidden';
	}
	
	function chgSex(i)
	{
		if(i == 0)
		{
			document.getElementById("imgpi1").src = "img/0hom.gif";
			document.getElementById("imgpi2").src = "img/1fem.gif";
			document.getElementById("hidSex").value = 0;
			document.getElementById("hidimgPi").value = 1;
			document.getElementById("imgPi").src = 'img/pirates/220/m1.gif';
			
		}
		else
		{
			document.getElementById("imgpi1").src = "img/1hom.gif";
			document.getElementById("imgpi2").src = "img/0fem.gif";
			document.getElementById("hidSex").value = 1;
			document.getElementById("hidimgPi").value = 1;
			document.getElementById("imgPi").src = 'img/pirates/220/f1.gif';
		}
	}
	
	function valiFlash()
	{
		if(document.getElementById("txtpse").value == "" || document.getElementById("txtPassw").value == "" || document.getElementById("txtmail").value == "")
		{
			if(document.getElementById("txtpse").value == "")
			{
				document.getElementById("txtpse").style.backgroundColor = 'red';
				document.getElementById("txtpse").style.color = 'white';
			} 
			
			if(document.getElementById("txtPassw").value == "")
			{
				document.getElementById("txtPassw").style.backgroundColor = 'red';
				document.getElementById("txtPassw").style.color = 'white';
			}
			
			if(document.getElementById("txtmail").value == "")
			{
				document.getElementById("txtmail").style.backgroundColor = 'red';
				document.getElementById("txtmail").style.color = 'white';
			}
		}
		else
		{
			if(confirm("Voulez-vous vous inscrire et accepter le règlement (consultable en bas de page) ?"))
			{
				//if(confirm("Acceptez-vous que nous vous envoyions par mail des bons plans (pas plus d'une fois par mois) ?"))
				//{
					document.getElementById("hidmailing").value = '1';
					document.forms["formIns"].submit();
				//}
				//else
				//{
				//	document.getElementById("hidmailing").value = '0';
				//	document.forms["formIns"].submit();
				//}
			}
		}
	}
