function VerifDateJour(MyJour, MyAnnee)
{
	today = new Date();
	if ((document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value < today.getMonth()+1) || (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value == today.getMonth()+1 && MyJour < today.getDate()))
		MyAnnee = MyAnnee+1;
	bi = ((parseInt(MyAnnee) % 4) == 0);
	switch(MyJour)
	{
	case "29" :
		if ((!bi) && (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="2")){
			window.alert('Date Incorrecte');
			document.form1.selection_jour.selectedIndex=today.getDate()-1;
			document.form1.selection_mois.selectedIndex=today.getMonth();			
			//document.form1.selection_jour.value=today.getDate();
			//document.form1.selection_mois.value=today.getMonth()+1;			
		}
		break;
	case "30" :
		if (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="2"){
			window.alert('Date Incorrecte');
			document.form1.selection_jour.selectedIndex=today.getDate()-1;
			document.form1.selection_mois.selectedIndex=today.getMonth();
			//document.form1.selection_jour.value=today.getDate();
			//document.form1.selection_mois.value=today.getMonth()+1;
		}
		break;
	case "31" :
		if ((document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="2") || (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="4") || (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="6") || (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="9") || (document.form1.selection_mois.options[document.form1.selection_mois.selectedIndex].value=="11")) {
			window.alert('Date Incorrecte');
			document.form1.selection_jour.selectedIndex=today.getDate()-1;
			document.form1.selection_mois.selectedIndex=today.getMonth();
			//document.form1.selection_jour.value=today.getDate();
			//document.form1.selection_mois.value=today.getMonth()+1;
		}
		break;
	default :
	}
}

function VerifDateMois(MyMois,MyAnnee)
{
	today = new Date();
	if ((MyMois < today.getMonth()+1) || (MyMois == today.getMonth()+1 && document.form1.selection_jour.options[document.form1.selection_jour.selectedIndex].value < today.getDate()))
		MyAnnee = MyAnnee+1;
	bi = ((parseInt(MyAnnee) % 4) == 0);
	switch(MyMois)
	{
	case "2" :
		if (((!bi) && (document.form1.selection_jour.options[document.form1.selection_jour.selectedIndex].value=="29")) || (document.form1.selection_jour.options[document.form1.selection_jour.selectedIndex].value=="30") || (document.form1.selection_jour.options[document.form1.selection_jour.selectedIndex].value=="31")) {
			window.alert('Date Incorrecte');
			document.form1.selection_jour.selectedIndex=today.getDate()-1;
			document.form1.selection_mois.selectedIndex=today.getMonth();
			//document.form1.selection_jour.value=today.getDate();
			//document.form1.selection_mois.value=today.getMonth()+1;
		}
		break;
	case "4" :
	case "6" :
	case "9" :
	case "11" :
		if (document.form1.selection_jour.options[document.form1.selection_jour.selectedIndex].value=="31") {
			window.alert('Date Incorrecte');
			document.form1.selection_jour.selectedIndex=today.getDate()-1;
			document.form1.selection_mois.selectedIndex=today.getMonth();
			//document.form1.selection_jour.value=today.getDate();
			//document.form1.selection_mois.value=today.getMonth()+1;
		}
		break;
	default :
	}
}

function annee(an) {
  if ((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) >= 4.06))
     an = eval(an + 1900);
  return an;
}


function VerifDateAnterieure(MyJour,MyMois)
{
	today = new Date();
	if ((MyMois < today.getMonth()+1) || (MyMois == today.getMonth()+1 && MyJour < today.getDate())) {
//		window.alert('Les dates antérieures à la date du jour ne sont pas gérées');
//		document.form1.selection_jour.selectedIndex=today.getDate()-1;
//		document.form1.selection_mois.selectedIndex=today.getMonth();
		document.form1.selection_annee.value=annee(today.getYear())+1;
	}
	else
		document.form1.selection_annee.value=annee(today.getYear());
}
