<!--
var win=thewin=null;

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_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_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];}
}

/**** Open window ****/
function openwindow(theurl,winname,theWidth,theHeight,theScroll ) {
if (thewin && !thewin.closed) {
	thewin.document.close();var thewin = null;
}
if (theScroll) {
	theWidth=eval(theWidth+16);
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,menubar=0,location=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0,directories=0";
thewin = window.open(theurl,winname,winfeatures);
if( thewin ) {
	thewin.focus();
}
}

function openwindowext(theurl,winname,theWidth,theHeight,theScroll,theX,theY){
if (thewin && !thewin.closed) {thewin.document.close();var thewin = null;}
if (theScroll) {
	theWidth=eval(theWidth+16);
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,menubar=0,location=0,scrollbars="+theScroll+",top="+theY+",left="+theX+",screenX="+theX+",screenY="+theY+",resizable=0,directories=0";
thewin = window.open(theurl,winname,winfeatures);
if( thewin ) {
	thewin.focus();
}
}

function openwindowcenter(theurl,winname,theWidth,theHeight,theScroll ) {
	theX = (screen.availWidth-theWidth)/2;
	theY = (screen.availHeight-theHeight)/2;
	return openwindowext(theurl,winname,theWidth,theHeight,theScroll,theX,theY);
}

function windowresize( theWidth, theHeight ) {
if (document.all) {
	window.resizeTo(theWidth,theHeight);
} else  {
	window.outerHeight	= theHeight;
	window.outerWidth	= theWidth;
	window.resizeTo(theWidth,theHeight);
}
}

function makeHome( my_url ) {
	if (document.all) {
		myHomePage.setHomePage(my_url);
	} else {
		alert("Cette fonctionnalité n'est pas disponible avec ce logiciel de navigation.");
	}
}

function check_mail(field_email) {
	src = field_email;
	s = src.value;

	lg=s.length;
	at=s.indexOf('@');
	pt=s.lastIndexOf('.');
	e=(s.length < 10 | s.length >80 | at==-1 | pt==-1 | pt<at | (lg-pt>4) | (lg-pt<=2) | at<3 | (pt-at<3)) ?true:false;

	return (e) ? false : true;
}

function etat_choix_fiscal(etat) {
	document.en_ligne.elements["data[Donateur][do_recu_fiscal]"][0].disabled = etat;
	document.en_ligne.elements["data[Donateur][do_recu_fiscal]"][1].disabled = etat;
}

function change_montant() {
	if( document.en_ligne.elements["data[Donateur][somme]"].value != '' ) {
		document.en_ligne.elements["data[Donateur][do_montant]"][3].checked = true;
	}
}

function ValidJeuConcours() {
 if ( document.jeu_concours.elements["data[jeu_concour][nom]"].value == '' ) {
	alert('Veuillez indiquer votre nom');
	document.jeu_concours.elements["data[jeu_concour][nom]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][prenom]"].value == '' ) {
	alert('Veuillez indiquer votre prénom');
	document.jeu_concours.elements["data[jeu_concour][prenom]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][rue]"].value == '' ) {
	alert('Veuillez indiquer votre rue');
	document.jeu_concours.elements["data[jeu_concour][rue]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][zip]"].value == '' ) {
	alert('Veuillez indiquer votre code postal');
	document.jeu_concours.elements["data[jeu_concour][zip]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][ville]"].value == '' ) {
	alert('Veuillez indiquer votre ville');
	document.jeu_concours.elements["data[jeu_concour][ville]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][email]"].value == '' || !check_mail(document.jeu_concours.elements["data[jeu_concour][email]"]) ) {
	alert('Veuillez indiquer une adresse email valide');
	document.jeu_concours.elements["data[jeu_concour][email]"].focus();
 } else if ( document.jeu_concours.elements["data[jeu_concour][email]"].value != document.jeu_concours.elements["data[jeu_concour][email2]"].value ) {
	alert('Veuillez confirmer votre adresse email');
	document.jeu_concours.elements["data[jeu_concour][email2]"].focus();
 } else {
	 document.jeu_concours.submit();
 }
}

function ValidInformationDon() {
 if( document.en_ligne.elements["data[Donateur][do_montant]"][3].checked == true
 && document.en_ligne.elements["data[Donateur][somme]"].value == '' ) {
	alert('Veuillez indiquer le montant de votre don');
 } else if ( document.en_ligne.elements["data[Donateur][do_nom]"].value == '' ) {
	alert('Veuillez indiquer votre nom');
	document.en_ligne.elements["data[Donateur][do_nom]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_prenom]"].value == '' ) {
	alert('Veuillez indiquer votre prénom');
	document.en_ligne.elements["data[Donateur][do_prenom]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_email]"].value == '' || !check_mail(document.en_ligne.elements["data[Donateur][do_email]"]) ) {
	alert('Veuillez indiquer une adresse email valide');
	document.en_ligne.elements["data[Donateur][do_email]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_adresse]"].value == '' ) {
	alert('Veuillez indiquer votre adresse');
	document.en_ligne.elements["data[Donateur][do_adresse]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_zip]"].value.length != 5 ) {
	alert('Veuillez indiquer votre code postal');
	document.en_ligne.elements["data[Donateur][do_zip]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_ville]"].value == '' ) {
	alert('Veuillez indiquer votre ville');
	document.en_ligne.elements["data[Donateur][do_ville]"].focus();
 } else if ( document.en_ligne.elements["data[Donateur][do_pays]"].value == '' ) {
	alert('Veuillez indiquer votre pays');
	document.en_ligne.elements["data[Donateur][do_pays]"].focus();
 } else {
	 document.en_ligne.submit();
 }
}

function ValidConfirmationInscription() {
if ( document.confirmation_inscription.elements["data[Contact][co_adresse]"].value == '' ) {
	alert('Veuillez indiquer votre adresse');
	document.confirmation_inscription.elements["data[Contact][co_adresse]"].focus();
 } else if ( document.confirmation_inscription.elements["data[Contact][co_ville]"].value == '' ) {
	alert('Veuillez indiquer votre ville');
	document.confirmation_inscription.elements["data[Contact][do_ville]"].focus();
 } else {
	 document.confirmation_inscription.submit();
 }
}

function ValidNewsletterContact() {
	/*if ( document.newsletter.elements["data[Contact][co_newsletter]"].checked == false
	&& document.newsletter.elements["data[Contact][co_rss]"].checked == false ) {
		alert("Veuillez sélectionner un abonnement (Newsletter et/ou Fil d'info)");
 	} else */if ( document.newsletter.elements["data[Contact][co_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.newsletter.elements["data[Contact][co_nom]"].focus();
 	} else if ( document.newsletter.elements["data[Contact][co_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.newsletter.elements["data[Contact][co_prenom]"].focus();
 	} else if ( document.newsletter.elements["data[Contact][co_email]"].value == '' || !check_mail(document.newsletter.elements["data[Contact][co_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide');
		document.newsletter.elements["data[Contact][co_email]"].focus();
	} else if ( document.newsletter.elements["data[Contact][co_departement]"].value == '' || isNaN(document.newsletter.elements["data[Contact][co_departement]"].value) ) {
		alert('Veuillez indiquer un departement valide');
		document.newsletter.elements["data[Contact][co_departement]"].focus();
	} else {
		document.newsletter.submit();
	}
}


function ValiddpepContact() {
	if ( document.newsletter.elements["data[Contact][co_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.newsletter.elements["data[Contact][co_nom]"].focus();
 	} else if ( document.newsletter.elements["data[Contact][co_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.newsletter.elements["data[Contact][co_prenom]"].focus();
	} else if( document.newsletter.elements["data[Contact][co_adresse]"].value == '' ) {
		alert('Veuillez indiquer votre adresse');
		document.newsletter.elements["data[Contact][co_adresse]"].focus();
	 } else if ( document.newsletter.elements["data[Contact][co_zip]"].value == '' ) {
		alert('Veuillez indiquer votre code postal');
		document.newsletter.elements["data[Contact][co_zip]"].focus();
	 } else if ( document.newsletter.elements["data[Contact][co_ville]"].value == '' ) {
		alert('Veuillez indiquer votre ville');
		document.newsletter.elements["data[Contact][co_ville]"].focus();
	 } else if ( document.newsletter.elements["data[Contact][co_pays]"].value == '' ) {
		alert('Veuillez indiquer votre pays');
		document.newsletter.elements["data[Contact][co_pays]"].focus();
	 } else {
		document.newsletter.submit();
	}
}

function ValidNewsletterContactFriend() {
	if ( document.register_friend.elements["data[Contact][co_parrain_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.register_friend.elements["data[Contact][co_parrain_nom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_parrain_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.register_friend.elements["data[Contact][co_parrain_prenom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_nom]"].value == '' ) {
		alert('Veuillez indiquer le nom de votre ami');
		document.register_friend.elements["data[Contact][co_nom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_prenom]"].value == '' ) {
		alert('Veuillez indiquer le prénom de votre ami');
		document.register_friend.elements["data[Contact][co_prenom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_email]"].value == '' || !check_mail(document.register_friend.elements["data[Contact][co_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide pour votre ami');
		document.register_friend.elements["data[Contact][co_email]"].focus();
	} else if ( document.register_friend.elements["data[Contact][co_departement]"].value == '' || isNaN(document.register_friend.elements["data[Contact][co_departement]"].value) ) {
		alert('Veuillez indiquer un departement valide pour votre ami');
		document.register_friend.elements["data[Contact][co_departement]"].focus();
	} else {
		document.register_friend.submit();
	}
}

function ValidNewsletterContactFriend() {
	if ( document.register_friend.elements["data[Contact][co_parrain_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.register_friend.elements["data[Contact][co_parrain_nom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_parrain_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.register_friend.elements["data[Contact][co_parrain_prenom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_nom]"].value == '' ) {
		alert('Veuillez indiquer le nom de votre ami');
		document.register_friend.elements["data[Contact][co_nom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_prenom]"].value == '' ) {
		alert('Veuillez indiquer le prénom de votre ami');
		document.register_friend.elements["data[Contact][co_prenom]"].focus();
 	} else if ( document.register_friend.elements["data[Contact][co_email]"].value == '' || !check_mail(document.register_friend.elements["data[Contact][co_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide pour votre ami');
		document.register_friend.elements["data[Contact][co_email]"].focus();
	} else if ( document.register_friend.elements["data[Contact][co_departement]"].value == '' || isNaN(document.register_friend.elements["data[Contact][co_departement]"].value) ) {
		alert('Veuillez indiquer un departement valide pour votre ami');
		document.register_friend.elements["data[Contact][co_departement]"].focus();
	} else {
		document.register_friend.submit();
	}
}

function ValidFaireUnDon() {
	if (document.FaireUnDon.elements["data[Donateur][moyen_paiement]"][1].checked == true) {
		document.FaireUnDon.action = "/faire_un_don/choix_paiement_cheque";
	}
	if ( document.FaireUnDon.elements["data[Donateur][moyen_paiement]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][moyen_paiement]"][1].checked == false ) {
		alert('Veuillez indiquer votre moyen de paiement');
		
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_amount]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][1].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][2].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][3].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][4].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][5].checked == false ) {
		alert('Veuillez indiquer votre montant');
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_amount]"][5].checked  == true && (isNaN(document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].value) || document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].value == '') ) {
 		alert('Veuillez indiquer votre montant');
		document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].focus();
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_civilite]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_civilite]"][1].checked == false && document.FaireUnDon.elements["data[Donateur][do_civilite]"][2].checked == false ) {
		alert('Veuillez indiquer votre civilite');
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.FaireUnDon.elements["data[Donateur][do_nom]"].focus();
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.FaireUnDon.elements["data[Donateur][do_prenom]"].focus();
	} else if ( document.FaireUnDon.elements["data[Donateur][do_email]"].value == '' || !check_mail(document.FaireUnDon.elements["data[Donateur][do_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide');
		document.FaireUnDon.elements["data[Donateur][do_email]"].focus();
	} else if ( document.FaireUnDon.elements["data[Donateur][do_email]"].value != document.FaireUnDon.elements["data[Donateur][do_email2]"].value ) {
		alert('Votre adresse de confirmation est incorecte');
		document.FaireUnDon.elements["data[Donateur][do_email2]"].focus();
	} else if( document.FaireUnDon.elements["data[Donateur][do_adresse]"].value == '' ) {
		alert('Veuillez indiquer votre adresse');
		document.FaireUnDon.elements["data[Donateur][do_adresse]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_zip]"].value == '' || isNaN(document.FaireUnDon.elements["data[Donateur][do_zip]"].value) ) {
		alert('Veuillez indiquer un code postal correct');
		document.FaireUnDon.elements["data[Donateur][do_zip]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_ville]"].value == '' ) {
		alert('Veuillez indiquer votre ville');
		document.FaireUnDon.elements["data[Donateur][do_ville]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_pays]"].value == '' ) {
		alert('Veuillez indiquer votre pays');
		document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"][1].checked == false ) {
		alert('Veuillez indiquer si vous souhaiter recevoir un recu fical');
	 } else if( document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value != '' || document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value != '' || document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value != ''){
	 	if( document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value == '' || document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value == '' || document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value == ''){
			alert('Veuillez indiquer une date de naissance correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_jour]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value)){
			alert('Veuillez indiquer une date de jour correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_jour]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value)){
			alert('Veuillez indiquer un mois correct');
			document.FaireUnDon.elements["data[Donateur][do_date_mois]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value)){
			alert('Veuillez indiquer une annee correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_annee]"].focus();
	 	}else {
			document.FaireUnDon.submit();
		}
	 }else {
		document.FaireUnDon.submit();
	}
}


function ValidVivreAbonnement() {
	if ( document.VivreInscription.elements["data[vivre_abonnement][vi_civilite]"][0].checked == false && document.VivreInscription.elements["data[vivre_abonnement][vi_civilite]"][1].checked == false && document.VivreInscription.elements["data[vivre_abonnement][vi_civilite]"][2].checked == false ) {
		alert('Veuillez indiquer votre civilite');
 	} else if ( document.VivreInscription.elements["data[vivre_abonnement][vi_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.VivreInscription.elements["data[vivre_abonnement][vi_nom]"].focus();
 	} else if ( document.VivreInscription.elements["data[vivre_abonnement][vi_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.VivreInscription.elements["data[vivre_abonnement][vi_prenom]"].focus();
	} else 
	/*
	if ( document.VivreInscription.elements["data[vivre_abonnement][vi_email]"].value == '' || !check_mail(document.VivreInscription.elements["data[vivre_abonnement][vi_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide');
		document.VivreInscription.elements["data[vivre_abonnement][vi_email]"].focus();
	} else if ( document.VivreInscription.elements["data[vivre_abonnement][vi_email]"].value != document.VivreInscription.elements["data[vivre_abonnement][vi_email2]"].value ) {
		alert('Votre adresse de confirmation est incorecte');
		document.VivreInscription.elements["data[vivre_abonnement][vi_email2]"].focus();
	} else 
	*/if( document.VivreInscription.elements["data[vivre_abonnement][vi_adresse]"].value == '' ) {
		alert('Veuillez indiquer votre adresse');
		document.VivreInscription.elements["data[vivre_abonnement][vi_adresse]"].focus();
	 } else if ( document.VivreInscription.elements["data[vivre_abonnement][vi_zip]"].value == '' || isNaN(document.VivreInscription.elements["data[vivre_abonnement][vi_zip]"].value) ) {
		alert('Veuillez indiquer un code postal correct');
		document.VivreInscription.elements["data[vivre_abonnement][vi_zip]"].focus();
	 } else if ( document.VivreInscription.elements["data[vivre_abonnement][vi_ville]"].value == '' ) {
		alert('Veuillez indiquer votre ville');
		document.VivreInscription.elements["data[vivre_abonnement][vi_ville]"].focus();
	 } else {
		document.VivreInscription.submit();
	}
}

function ValidFaireUnDonRegulier() {
	if ( document.FaireUnDon.elements["data[Donateur][do_amount]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][1].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][2].checked == false && document.FaireUnDon.elements["data[Donateur][do_amount]"][3].checked == false ) {
		alert('Veuillez indiquer votre montant');
 	} else if ( document.FaireUnDon.elements["data[Donateur][moyen_paiement]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][moyen_paiement]"][1].checked == false ) {
		alert('Veuillez indiquer votre fréquence de don');
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_amount]"][3].checked  == true && (isNaN(document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].value) || document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].value == '') ) {
 		alert('Veuillez indiquer votre montant');
		document.FaireUnDon.elements["data[Donateur][do_amountAutre]"].focus();
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_civilite]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_civilite]"][1].checked == false && document.FaireUnDon.elements["data[Donateur][do_civilite]"][2].checked == false ) {
		alert('Veuillez indiquer votre civilite');
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_nom]"].value == '' ) {
		alert('Veuillez indiquer votre nom');
		document.FaireUnDon.elements["data[Donateur][do_nom]"].focus();
 	} else if ( document.FaireUnDon.elements["data[Donateur][do_prenom]"].value == '' ) {
		alert('Veuillez indiquer votre prénom');
		document.FaireUnDon.elements["data[Donateur][do_prenom]"].focus();
	} else if ( document.FaireUnDon.elements["data[Donateur][do_email]"].value == '' || !check_mail(document.FaireUnDon.elements["data[Donateur][do_email]"]) ) {
		alert('Veuillez indiquer une adresse email valide');
		document.FaireUnDon.elements["data[Donateur][do_email]"].focus();
	} else if ( document.FaireUnDon.elements["data[Donateur][do_email]"].value != document.FaireUnDon.elements["data[Donateur][do_email2]"].value ) {
		alert('Votre adresse de confirmation est incorecte');
		document.FaireUnDon.elements["data[Donateur][do_email2]"].focus();
	} else if( document.FaireUnDon.elements["data[Donateur][do_adresse]"].value == '' ) {
		alert('Veuillez indiquer votre adresse');
		document.FaireUnDon.elements["data[Donateur][do_adresse]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_zip]"].value == '' || isNaN(document.FaireUnDon.elements["data[Donateur][do_zip]"].value) ) {
		alert('Veuillez indiquer un code postal correct');
		document.FaireUnDon.elements["data[Donateur][do_zip]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_ville]"].value == '' ) {
		alert('Veuillez indiquer votre ville');
		document.FaireUnDon.elements["data[Donateur][do_ville]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_pays]"].value == '' ) {
		alert('Veuillez indiquer votre pays');
		document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"][0].checked == false && document.FaireUnDon.elements["data[Donateur][do_recu_fiscal]"][1].checked == false ) {
		alert('Veuillez indiquer si vous souhaiter recevoir un recu fical');
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_banque]"].value == '' ) {
		alert('Veuillez indiquer votre numero de banque');
		document.FaireUnDon.elements["data[Donateur][do_banque]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_guichet]"].value == '' ) {
		alert('Veuillez indiquer votre numero de guichet');
		document.FaireUnDon.elements["data[Donateur][do_guichet]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_compte]"].value == '' ) {
		alert('Veuillez indiquer votre numero de compte');
		document.FaireUnDon.elements["data[Donateur][do_compte]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_cle_rib]"].value == '' ) {
		alert('Veuillez indiquer votre cle rib');
		document.FaireUnDon.elements["data[Donateur][do_cle_rib]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_banque_nom]"].value == '' ) {
		alert('Veuillez indiquer le nom de votre banque');
		document.FaireUnDon.elements["data[Donateur][do_banque_nom]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_banque_rue]"].value == '' ) {
		alert('Veuillez indiquer la rue de votre banque');
		document.FaireUnDon.elements["data[Donateur][do_banque_rue]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_banque_ville]"].value == '' ) {
		alert('Veuillez indiquer le ville de votre banque');
		document.FaireUnDon.elements["data[Donateur][do_banque_ville]"].focus();
	 } else if ( document.FaireUnDon.elements["data[Donateur][do_banque_zip]"].value == '' ) {
		alert('Veuillez indiquer le code postal de votre banque');
		document.FaireUnDon.elements["data[Donateur][do_banque_zip]"].focus();
	 } else if( document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value != '' || document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value != '' || document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value != ''){
	 	if( document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value == '' || document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value == '' || document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value == ''){
			alert('Veuillez indiquer une date de naissance correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_jour]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_jour]"].value)){
			alert('Veuillez indiquer une date de jour correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_jour]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_mois]"].value)){
			alert('Veuillez indiquer un mois correct');
			document.FaireUnDon.elements["data[Donateur][do_date_mois]"].focus();
	 	}else if (isNaN(document.FaireUnDon.elements["data[Donateur][do_date_annee]"].value)){
			alert('Veuillez indiquer une annee correcte');
			document.FaireUnDon.elements["data[Donateur][do_date_annee]"].focus();
	 	}else {
			document.FaireUnDon.submit();
		}
	 }else {
		document.FaireUnDon.submit();
	}
}

function ValidAbonnementContact() {
	if ( document.abonnement_contact.elements["data[Contact][co_newsletter]"].checked == false
	&& document.abonnement_contact.elements["data[Contact][co_rss]"].checked == false
	&& document.abonnement_contact.elements["data[Contact][co_partenaires]"].checked == false ) {
		alert('Veuillez préciser un abonnement avant de valider');
	} else {
		document.abonnement_contact.submit();
	}
}

function ValidPaiementDon() {
	 document.paiement_don.submit();
}

function ValidRecuFiscal() {
if( document.recu_fiscal.elements["data[Donateur][do_adresse]"].value == '' ) {
	alert('Veuillez indiquer votre adresse');
	document.recu_fiscal.elements["data[Donateur][do_adresse]"].focus();
 } else if ( document.recu_fiscal.elements["data[Donateur][do_zip]"].value == '' ) {
	alert('Veuillez indiquer votre code postal');
	document.recu_fiscal.elements["data[Donateur][do_zip]"].focus();
 } else if ( document.recu_fiscal.elements["data[Donateur][do_ville]"].value == '' ) {
	alert('Veuillez indiquer votre ville');
	document.recu_fiscal.elements["data[Donateur][do_ville]"].focus();
 } else if ( document.recu_fiscal.elements["data[Donateur][do_pays]"].value == '' ) {
	alert('Veuillez indiquer votre pays');
	document.recu_fiscal.elements["data[Donateur][do_pays]"].focus();
 } else {
	 document.recu_fiscal.submit();
 }
}

function ValidJournalLogin() {
if( document.journal_login.elements["data[User][username]"].value == '' ) {
	alert('Veuillez indiquer votre identifiant');
	document.journal_login.elements["data[User][username]"].focus();
 } else if ( document.journal_login.elements["data[User][passwd]"].value == '' ) {
	alert('Veuillez indiquer votre mot de passe');
	document.journal_login.elements["data[User][passwd]"].focus();
 } else {
	 document.journal_login.submit();
 }
}

function ValidCommandeTeeShirt() {

 if ( document.commande_tee_shirts.elements["data[Commande][cm_nom]"].value == '' ) {
	alert('Veuillez indiquer votre nom');
	document.commande_tee_shirts.elements["data[Commande][cm_nom]"].focus();
 } else if ( document.commande_tee_shirts.elements["data[Commande][cm_prenom]"].value == '' ) {
	alert('Veuillez indiquer votre prénom');
	document.commande_tee_shirts.elements["data[Commande][cm_prenom]"].focus();
 } else if ( document.commande_tee_shirts.elements["data[Commande][cm_email]"].value == '' || !check_mail(document.commande_tee_shirts.elements["data[Commande][cm_email]"]) ) {
	alert('Veuillez indiquer une adresse email valide');
	document.commande_tee_shirts.elements["data[Commande][cm_email]"].focus();
 } else if( document.commande_tee_shirts.elements["data[Commande][cm_adresse]"].value == '' ) {
	alert('Veuillez indiquer votre adresse');
	document.commande_tee_shirts.elements["data[Commande][cm_adresse]"].focus();
 } else if ( document.commande_tee_shirts.elements["data[Commande][cm_zip]"].value == '' ) {
	alert('Veuillez indiquer votre code postal');
	document.commande_tee_shirts.elements["data[Commande][cm_zip]"].focus();
 } else if ( document.commande_tee_shirts.elements["data[Commande][cm_ville]"].value == '' ) {
	alert('Veuillez indiquer votre ville');
	document.commande_tee_shirts.elements["data[Commande][cm_ville]"].focus();
 } else if ( document.commande_tee_shirts.elements["data[Commande][cm_pays]"].value == '' ) {
	alert('Veuillez indiquer votre pays');
	document.commande_tee_shirts.elements["data[Commande][cm_pays]"].focus();
 } else {
	 document.commande_tee_shirts.submit();
 }
}

function update_tee_shirt_total( nb ) {
	var total = 0;
	for(i=1;i <= nb;i++) {
		if( document.tee_shirts.elements["quantite"+i] != null ) {
			if( document.tee_shirts.elements["prix"+i] != null ) {
				if( document.tee_shirts.elements["quantite"+i].value ) {
					total += document.tee_shirts.elements["quantite"+i].value*document.tee_shirts.elements["prix"+i].value;
				}
			}
		}
	}
	if( document.tee_shirts.elements["total_ht"] != null ) {
		document.tee_shirts.elements["total_ht"].value = total.toFixed(2);
		if( document.tee_shirts.elements["tva"] != null ) {
			var tva = total*0.196;
			document.tee_shirts.elements["tva"].value = tva.toFixed(2);
			if( document.tee_shirts.elements["total"] != null ) {
				t = total+tva;
				document.tee_shirts.elements["total"].value = t.toFixed(2);
			}
		}
	}
}

function ValidTeeShirt( nb ) {
	var okey=false;
	for(i=1;i <= nb;i++) {
		if( document.tee_shirts.elements["quantite"+i] != null && document.tee_shirts.elements["quantite"+i].value > 0 ) {
			okey=true;
		}
	}

	if(!okey) {
		alert('Veuillez sélectionner au moins un article');
	 } else {
		document.tee_shirts.submit();
	}
}

function update_calendrier_total( nb ) {
	var total = 0;
	for(i=1;i <= nb;i++) {
		if( document.calendrier.elements["quantite"+i] != null ) {
			if( document.calendrier.elements["prix"+i] != null ) {
				if( document.calendrier.elements["quantite"+i].value ) {
					total += document.calendrier.elements["quantite"+i].value*document.calendrier.elements["prix"+i].value;
				}
			}
		}
	}
	
		var prix = document.calendrier.elements["quantite1"].value * 7;
		var totalTTC = Math.round(prix*10);
		totalTTC /= 10;
		document.calendrier.elements["total"].value = totalTTC.toFixed(2);
		var totalHT = totalTTC - (totalTTC * 0.196)
		document.calendrier.elements["total_ht"].value = totalHT.toFixed(2);

		var montantTVA = totalTTC - totalHT;
		document.calendrier.elements["tva"].value = montantTVA.toFixed(2);

//	if( document.calendrier.elements["total_ht"] != null ) {
//		document.calendrier.elements["total_ht"].value = total.toFixed(2);;
//		if( document.calendrier.elements["tva"] != null )
//		{
//			var montantTVA = 0;
//			if( document.calendrier.elements["total"] != null )
//			 {
//			 	//total=>total ht
//			 		var prix = document.calendrier.elements["quantite1"].value * 7;
//			 		var totalHT = totalTTC - (totalTTC * 0.196)
//			 		document.calendrier.elements["total_ht"].value = totalHT.toFixed(2);
//					montantTVA = totalTTC - totalHT;
//					var totalTTC = Math.round(prix*10);
//					totalTTC /= 10;
//					//var prix = total+tva;
//					//resultat = Math.round((prix*10));
//					//resultat /= 10;
//
//					document.calendrier.elements["total"].value = totalTTC.toFixed(2);
//				}
//				//var tva = total*0.196;
//				document.calendrier.elements["tva"].value = montantTVA.toFixed(2);
//
//		}
//	}
}

function ValidCalendrier( nb ) {
	var okey=false;
	for(i=1;i <= nb;i++) {
		if( document.calendrier.elements["quantite"+i] != null && document.calendrier.elements["quantite"+i].value > 0 ) {
			okey=true;
		}
	}

	if(!okey) {
		alert('Veuillez sélectionner au moins un article');
	 } else {
		document.calendrier.submit();
	}
}

function ValidAbonnementPresse() {
 if ( document.page_form.elements["data[Presse][nom]"].value == '' ) {
	alert('Veuillez indiquer votre nom');
	document.page_form.elements["data[Presse][nom]"].focus();
 } else if ( document.page_form.elements["data[Presse][prenom]"].value == '' ) {
	alert('Veuillez indiquer votre prénom');
	document.page_form.elements["data[Presse][prenom]"].focus();
 } else if ( document.page_form.elements["data[Presse][titre_presse]"].value == '' ) {
	alert('Veuillez indiquer votre titre de presse');
	document.page_form.elements["data[Presse][titre_presse]"].focus();
 } else if ( document.page_form.elements["data[Presse][email]"].value == '' || !check_mail(document.page_form.elements["data[Presse][email]"]) ) {
	alert('Veuillez indiquer une adresse email valide');
	document.page_form.elements["data[Presse][email]"].focus();
 } else {
	 document.page_form.submit();
 }
}

function ValidSendFriend( type ) {
 if ( document.page_form.elements["data[Infos][senderName]"].value == '' ) {
	alert('Veuillez indiquer votre nom');
	document.page_form.elements["data[Infos][senderName]"].focus();
 } else if ( document.page_form.elements["data[Infos][senderFirstname]"].value == '' ) {
	alert('Veuillez indiquer votre prénom');
	document.page_form.elements["data[Infos][senderFirstname]"].focus();
 } else if ( document.page_form.elements["data[Infos][senderMail]"].value == '' || !check_mail(document.page_form.elements["data[Infos][senderMail]"]) ) {
	alert('Veuillez indiquer votre email');
	document.page_form.elements["data[Infos][senderMail]"].focus();
 } else if ( document.page_form.elements["data[Infos][email]"].value == '' || !check_mail(document.page_form.elements["data[Infos][email]"]) ) {
	alert("Veuillez indiquer l'email de votre ami(e)");
	document.page_form.elements["data[Infos][email]"].focus();
 } else {
 	if( type == 2 ) {
 		document.page_form.action='/article/send_friend_lien_article';
 	} else {
		document.page_form.action='/contact/send_friend';
 	}
	document.page_form.submit();
 }
}

function change_style(object, etatSouris, name_class) {
	if (etatSouris=='over' ) {
		object.className = name_class+'_over';
	}
	else if (etatSouris =='out' ) {
		object.className = name_class;
	}
}

// Fonctions permettant de préparer la nouvelle page, aprés rechargement
function submitEtat(new_etat) {
	document.page_form.elements['data[Infos][etat]'].value = new_etat;
	document.page_form.submit();
}

function submitPage(new_page) {
	document.page_form.elements['data[Infos][page]'].value = new_page;
	document.page_form.submit();
}

function submitEtatId(new_etat, new_id) {
	document.page_form.elements['data[Infos][etat]'].value = new_etat;
	document.page_form.elements['data[Infos][id]'].value = new_id;
	document.page_form.submit();
}

function submitEtatPage(new_etat, new_page) {
	document.page_form.elements['data[Infos][etat]'].value = new_etat;
	document.page_form.elements['data[Infos][page]'].value = new_page;
	document.page_form.submit();
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  }
}

function aide_open_popup( ancre ) {
	if( ancre != null && ancre != '') {
		url = '/aide.php#' + ancre;
	} else{
		url = '/aide.php';
	}
	openwindowcenter(url, 'aide', 400, 550, 1);
}

var tab_bloc_thematique = new Array();
function show_hide_bloc_thematique( couche ) {
	alterner_couche(tab_bloc_thematique, 'bloc_thematique', (couche == 1 ? 1 : 2) );
	alterner_couche(tab_bloc_thematique, 'bloc_thematique', (couche == 1 ? 2 : 1) );
	//if( couche==2 ) { initScrollLayer( 2, true ); }
	init_dw_Scroll_id(couche);

	param_bloc_thematique( couche );
}
function param_bloc_thematique( couche ) {
	date=new Date;
	date.setMonth(date.getMonth()+1);
	EcrireCookie("lncc_thematique", couche, date, "/");
}

var tab_bloc_glossaire = new Array();
function show_hide_bloc_glossaire( couche ) {
	alterner_couche(tab_bloc_glossaire, 'bloc_glossaire', (couche == 1 ? 1 : 2) );
	alterner_couche(tab_bloc_glossaire, 'bloc_glossaire', (couche == 1 ? 2 : 1) );
	//if( couche==2 ) { initScrollLayer( 4, true ); }
	init_dw_Scroll_id(couche);
	
	param_bloc_glossaire( couche );
}
function param_bloc_glossaire( couche ) {
	date=new Date;
	date.setMonth(date.getMonth()+1);
	EcrireCookie("lncc_glossaire", couche, date, "/");
}

var tab_bloc_historique = new Array();
function show_hide_bloc_historique( couche ) {
	alterner_couche(tab_bloc_historique, 'bloc_historique', (couche == 1 ? 1 : 2) );
	alterner_couche(tab_bloc_historique, 'bloc_historique', (couche == 1 ? 2 : 1) );
	if( couche==2 ) { initScrollLayer( 3, true ); }

	param_bloc_historique( couche );
}
function param_bloc_historique( couche ) {
	date=new Date;
	date.setMonth(date.getMonth()+1);
	EcrireCookie("lncc_historique", couche, date, "/");
}

var tab_bloc_voir_aussi = new Array();
function show_hide_bloc_voir_aussi( couche ) {
	alterner_couche(tab_bloc_voir_aussi, 'bloc_voir_aussi', (couche == 1 ? 1 : 2) );
	alterner_couche(tab_bloc_voir_aussi, 'bloc_voir_aussi', (couche == 1 ? 2 : 1) );
	if( couche==2 ) { initScrollLayer( 6, true ); }

	param_bloc_voir_aussi( couche );
}
function param_bloc_voir_aussi( couche ) {
	date=new Date;
	date.setMonth(date.getMonth()+1);
	EcrireCookie("lncc_voir_aussi", couche, date, "/");
}

function alterner_couche(tab, name, couche ) {
	if (!(layer = MM_findObj(name + couche))) {
		return;
	}
	if (tab[couche] == 'hide'){
		layer.style.display = 'block';
		tab[couche] = 'show';
	} else {
		layer.style.display = 'none';
		tab[couche] = 'hide';
	}
}

function EcrireCookie(nom, valeur) {
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}

function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom) {
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
	var j=i+alen;
	if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
	i=document.cookie.indexOf(" ",i)+1;
	if (i==0) break;

	}
	return null;
}

function hideinterstitiel() {
	var lyr = document.getElementById( 'interstitiel' );
	lyr.style.visibility = "hidden";
}
//-->