function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { 
  			window.open(theURL,winName,features);
}

function ouvrirAide() {
	MM_openBrWindow('/aide/aide.htm', 'Aide', 'width=400,height=500,scrollbars=yes');
}
function ouvrirContact() {
	MM_openBrWindow('/aide/contact.htm', 'Aide', 'width=400,height=328,scrollbars=yes');
}
function ouvrirMentionsLegales() {
	MM_openBrWindow('/aide/mentionsLegales.htm', 'Aide', 'width=400,height=500,scrollbars=yes');
}

function changerLigue(baliseId) 
{
  
  if (baliseId == 1) baliseAutre = 2;
  if (baliseId == 2) baliseAutre = 1;
  
  if (document.getElementById && document.getElementById(baliseId) != null) 
    {
    document.getElementById(baliseId).style.visibility='visible';
    document.getElementById(baliseId).style.display='block';
    }
	
   if (document.getElementById && document.getElementById(baliseAutre) != null) 
    {
    document.getElementById(baliseAutre).style.visibility='hidden';
    document.getElementById(baliseAutre).style.display='none';
    }
 }

var oldCol;
function CBG(tr, mode) {
	if (mode == 0) {
	oldCol = tr.className;
	tr.className = 'trOver';
	} else {
	tr.className = oldCol;
	}
}



var oldCol;
function CBGClub(tr, mode) {
	if (mode == 0) {
	oldCol = tr.className;
	tr.className = 'trOverClub';
	} else {
	tr.className = oldCol;
	}
}
var oldCol;
function CBGStat(tr, mode) {
	if (mode == 0) {
	oldCol = tr.className;
	tr.className = 'trOverStat';
	} else {
	tr.className = oldCol;
	}
}

var oldCol;
function CBGResClub(tr, mode) {
	if (mode == 0) {
	oldCol = tr.className;
	tr.className = 'trOverResClub';
	} else {
	tr.className = oldCol;
	}
}


var oldCol;
function CBGProg(tr, mode) {
	if (mode == 0) {
	oldCol = tr.className;
	tr.className = 'trOverProg';
	} else {
	tr.className = oldCol;
	}
}


function lireArticle(url, target) {
	if (target != '') {
		
	}
	else
	{
		location.href=url;
	}
	
}

function ouvrirMagazine(fichier)
{
	var fenetre = window.open(fichier, 'FootProMag', 'width=521,height=400,,,,scrollbars=yes,resizable=yes,status=yes,toolbar=yes');
	
	if (window.focus) fenetre.focus();
}

function sendMail(idArticle)
{
	var fenetre = window.open('/sendMail/sendMail.asp?idArticle=' + idArticle, 'Photo', 'width=400,height=222,,,,scrollbars=yes,resizable=yes,status=yes,toolbar=yes');
	
	if (window.focus) fenetre.focus();
}

function printArticle(idArticle)
{
	var fenetre = window.open('/print/printArticle.asp?idArticle=' + idArticle, 'Photo', 'width=600,height=700,,,,scrollbars=yes,resizable=yes,status=yes,toolbar=yes');
	
	if (window.focus) fenetre.focus();
}

function validerInscriptionClub() {
	
	if (document.register.nom.value.length==0) {
			alert("Veuillez saisir votre nom");
			document.register.nom.focus();
			return false;
	}
	
	if (document.register.prenom.value.length==0) {
			alert("Veuillez saisir votre prénom");
			document.register.prenom.focus();
			return false;
	}
	
	if (document.register.adresse.value.length==0) {
			alert("Veuillez saisir votre adresse postale");
			document.register.adresse.focus();
			return false;
	}
	
	if (document.register.adresse.value.length > 600) {
			alert("La taille de l'adresse indiquée est trop grande");
			document.register.adresse.focus();
			return false;
	}
	
	if (document.register.codePostal.value.length == 0) {
			alert("Veuillez saisir votre code postal");
			document.register.codePostal.focus();
			return false;
	}
	
	if (document.register.ville.value.length == 0) {
			alert("Veuillez saisir votre ville");
			document.register.ville.focus();
			return false;
	}
	
	if (document.register.email.value.length == 0) {
			alert("Veuillez saisir votre email");
			document.register.email.focus();
			return false;
	}
	
	if (checkEmail(document.register.email.value) == false) {
			alert("L'adresse email que vous avez saisi n'est pas valide");
			document.register.email.focus();
			return false;
	}
	
	if (document.register.password1.value.length == 0) {
			alert("Veuillez saisir un mot de passe");
			document.register.password1.focus();
			return false;
	}
	
	if (document.register.password1.value.length < 7) {
			alert("Veuillez saisir un mot de passe d'au moins 7 caractères");
			document.register.password1.focus();
			return false;
	}
	
	if (document.register.password2.value.length == 0) {
			alert("Veuillez resaisir de nouveau votre mot de passe");
			document.register.password2.focus();
			return false;
	}
	
	if (document.register.password1.value.length != document.register.password2.value.length ) {
			alert("Le mot de passe resaisi n'est pas le même");
			document.register.password2.focus();
			return false;
	}
	
	
	return true;
}

function checkField() {
	
	if (validerInscriptionClub() ) {
			document.register.submit();
	}
}

function checkFieldUpdate() {
	
	if (document.updateInfos.nom.value.length==0) {
			alert("Veuillez saisir votre nom");
			document.updateInfos.nom.focus();
			return false;
	}
	
	if (document.updateInfos.prenom.value.length==0) {
			alert("Veuillez saisir votre prénom");
			document.updateInfos.prenom.focus();
			return false;
	}
	
	if (document.updateInfos.adresse.value.length==0) {
			alert("Veuillez saisir votre adresse postale");
			document.updateInfos.adresse.focus();
			return false;
	}
	
	if (document.updateInfos.adresse.value.length > 600) {
			alert("La taille de l'adresse indiquée est trop grande");
			document.updateInfos.adresse.focus();
			return false;
	}
	
	if (document.updateInfos.codePostal.value.length == 0) {
			alert("Veuillez saisir votre code postal");
			document.updateInfos.codePostal.focus();
			return false;
	}
	
	if (document.updateInfos.ville.value.length == 0) {
			alert("Veuillez saisir votre ville");
			document.updateInfos.ville.focus();
			return false;
	}
	return true;
}


function checkPasswordUpdate() {

	if (document.updateInfos.password1.value.length == 0) {
			alert("Veuillez saisir un mot de passe");
			document.updateInfos.password1.focus();
			return false;
	}
	
	if (document.updateInfos.password1.value.length < 7) {
			alert("Veuillez saisir un mot de passe d'au moins 7 caractères");
			document.updateInfos.password1.focus();
			return false;
	}
	
	if (document.updateInfos.password2.value.length == 0) {
			alert("Veuillez resaisir de nouveau votre mot de passe");
			document.updateInfos.password2.focus();
			return false;
	}
	
	if (document.updateInfos.password1.value.length != document.updateInfos.password2.value.length ) {
			alert("Le mot de passe resaisi n'est pas le même");
			document.updateInfos.password2.focus();
			return false;
	}
	
	
	return true;
}


function checkEmail (emailStr) {

	var myEMailIsValid = true;
	var myAtSymbolAt = emailStr.indexOf('@');
	var myLastDotAt = emailStr.lastIndexOf('.');
	var mySpaceAt = emailStr.indexOf(' ');
	var myLength = emailStr.length;
	
	if (myAtSymbolAt < 1 ) {
		myEMailIsValid = false;
	}
	
	if (myLastDotAt < myAtSymbolAt) {
		myEMailIsValid = false;
	}
	 
	if (myLength - myLastDotAt <= 2) {
		myEMailIsValid = false;
	}
	
	if (mySpaceAt != -1) {
		myEMailIsValid = false
	}
		
	if (myEMailIsValid == true) {
		return true;
	}
	else {
		return false;
	}

}

function JeuCdlFdj(id) {
	
	var url;
	if (id == 1) url = "http://prof.estat.com/cgi-bin/ft/293093195763?class=Jeu_FDJ&page=FDJ_bandeau_363_80&type=50&g=293093195763&estat_url=http%3A%2F%2Fcoupedelaligue.fdjeux.com%2F%3F";
	
	if (id == 2) url = "http://prof.estat.com/cgi-bin/ft/293093195763?class=Jeu_FDJ&page=FDJ_bandeau_145_130&type=50&g=293093195763&estat_url=http%3A%2F%2Fcoupedelaligue.fdjeux.com%2F%3F";
	
	if (id == 3) url = "http://prof.estat.com/cgi-bin/ft/293093195763?class=Jeu_FDJ&page=FDJ_bandeau_252_76&type=50&g=293093195763&estat_url=http%3A%2F%2Fcoupedelaligue.fdjeux.com%2F%3F";
	
	if (id == 4) url = "http://prof.estat.com/cgi-bin/ft/293093195763?class=Jeu_FDJ&page=FDJ_bandeau_120_600&type=50&g=293093195763&estat_url=http%3A%2F%2Fcoupedelaligue.fdjeux.com%2F%3F";
	
	
	var fenetre = window.open(url, 'FDJ', 'width=780,height=580,,,,scrollbars=no,resizable=no,status=yes,toolbar=yes');
		
	if (window.focus) fenetre.focus();

}
		
function albumPhotoFinaleCDL() {
	var fenetre = window.open('/CoupeLigue/finale2006/albumPhoto.asp', 'PHOTOS_CDL', 'width=773,height=582,,,,scrollbars=no,resizable=no,status=yes,toolbar=yes');
		
	if (window.focus) fenetre.focus();
}

function ouvrirHitPhotos() {
	var fenetre = window.open('/hitPhotos/albumPhoto.asp', 'HIT_PHOTOS', 'width=773,height=635,,,,scrollbars=no,resizable=yes,status=yes,toolbar=yes');
		
	if (window.focus) fenetre.focus();
}

function ouvrirAlbumValenciennes() {
	var fenetre = window.open('/ligue2/albumValenciennes/albumPhoto.asp', 'VALENCIENNES', 'width=773,height=635,,,,scrollbars=no,resizable=yes,status=yes,toolbar=yes');
		
	if (window.focus) fenetre.focus();
}

function ouvrirAlbumLyon() {
	var fenetre = window.open('/ligue1/albumLyon/albumPhoto.asp', 'LYON', 'width=773,height=635,,,,scrollbars=no,resizable=yes,status=yes,toolbar=yes');
		
	if (window.focus) fenetre.focus();
}
	
	


MM_preloadImages('/images/accueil/logosclub/ligue1/ligue1.gif');
MM_preloadImages('/images/accueil/logosclub/ligue2/ligue2.gif');

MM_preloadImages('/images/accueil/logosclub/ligue2/ligue2.gif');

MM_preloadImages('/images/accueil/menu/off/ligue1_home.gif');
MM_preloadImages('/images/accueil/menu/off/ligue2_home.gif');
MM_preloadImages('/images/accueil/menu/off/coupe_ligue_home.gif');

