function OpenReglement()
{
	window.open('J07_reglement.asp','Reglement','width=300,height=400,scrollbars=yes')
}
function amsiswap(Obj)
{
	src = Obj.src;
	oldsrc = src.substring(0,(src.length-5));
	srcend = src.substring((src.length-5),src.length);

	if(srcend == "0.gif")
	{
		Obj.src = oldsrc+"1.gif";
	}
	else
	{
		Obj.src = oldsrc+"0.gif";
	}
}
function checkMail(mail)
{
	if(mail == null)
	{
		return null;
	}
	if(mail.match(/^.+@.+\..+$/))
	{
		return mail;
	} 
	else 
	{
	return null;
	}
}

function is_all_num(chaine)
{
	var i;
	for(i=0;i<chaine.length;i++)
		{
		if(isNaN(parseInt(chaine.substring(i,i+1))))
			return false;}
	return true;
}

function isValidTel(param) 
	{ 
    telPattern = new RegExp("^[0-9 \\.]+$"); 
    return(telPattern.test(param)); 
	}

function checkForm()
{
	
	if (document.Pronostic.PRENOM.value == "")
	{
		alert("Veuillez entrer votre prénom svp !");
		document.Pronostic.PRENOM.focus();
		return;
	}
	if (document.Pronostic.NOM.value=="")
	{
		alert("Veuillez entrer votre nom svp !");
		document.Pronostic.NOM.focus();
		return;
	}
	if (document.Pronostic.ADRESSE.value=="")
	{
		alert("Veuillez entrer votre adresse svp !");
		document.Pronostic.ADRESSE.focus();
		return;
	}
	if (document.Pronostic.VILLE.value=="")
	{
		alert("Veuillez entrer votre ville svp !");
		document.Pronostic.VILLE.focus();
		return;
	}
	if (isNaN(document.Pronostic.CODEPOSTAL.value) || document.Pronostic.CODEPOSTAL.value=="")
	{
		alert("Votre format de code postal n'est pas numerique !");
		document.Pronostic.CODEPOSTAL.focus();
		return;
	}
	
	if (!isValidTel(document.Pronostic.TELEPHONE.value) || document.Pronostic.TELEPHONE.value=="")
	{
		alert("Votre format de téléphone n'est pas numerique !");
		document.Pronostic.TELEPHONE.focus();
		return;
	}
	
	if (document.Pronostic.EMAIL.value=="" || !checkMail(document.Pronostic.EMAIL.value))
	{
		alert("Veuillez entrer un E-mail valide svp !");
		document.Pronostic.EMAIL.focus();
		return;
	}
	nbr = eval(document.Pronostic.NBR_MATCH.value)
	for (i=1;i<nbr+1;i++)
	{
		checkRadio1 = eval("document.Pronostic.match"+i+"[0].checked")
		checkRadio2 = eval("document.Pronostic.match"+i+"[1].checked")
		checkRadio3 = eval("document.Pronostic.match"+i+"[2].checked")
		if ((checkRadio1 == false) && (checkRadio2 == false) && (checkRadio3 == false))
		{
			alert("Veuillez donner votre pronostic pour le match N°"+i);
			return;
		}
	}
	document.Pronostic.submit();
}
function checkEcard()
{
	if (document.ecard.email1.value=="")
	{
		alert("Veuillez remplir au moins la première adresse e-mail !");
		return;
	}
	else
	{
		document.ecard.submit();
	}
}

function checkEvenement(){
	if (top.frames){
		if (top.frames.up){
			if (top.frames.up.finUp){
				if (top.frames.up.finUp==1){
					top.frames.up.showHideEvnmt(1);
					return;
				}
			}
		}
	}
	setTimeout('checkEvenement()',500);
	return;
}
checkEvenement();