    function showcalendar(iddiv) {
	//** on affiche les 2 calendriers
	document.getElementById("combo_deb").style.visibility="hidden";
	calendar("calendar1");
	document.getElementById("combo_fin").style.visibility="hidden";
	calendar("calendar2");
    }

    function SelectDay(iddiv,an,mois,jour) {
	//** si calendrier 1 on modifie les 2 pour date unique
	if (iddiv == 'calendar1') {
	  document.forms["FormName"].elements["deb_day"].selectedIndex = jour-1;
	  document.forms["FormName"].elements["deb_month"].selectedIndex = mois-1;
	  document.forms["FormName"].elements["deb_year"].selectedIndex = an-2010;
	  calendar("calendar1",an,mois,jour);
	}
	//** sinon que le 2
	document.forms["FormName"].elements["fin_day"].selectedIndex = jour-1;
	document.forms["FormName"].elements["fin_month"].selectedIndex = mois-1;
	document.forms["FormName"].elements["fin_year"].selectedIndex = an-2010;
	calendar("calendar2",an,mois,jour);
    }

    function calendar(iddiv,an,mois,jour) {
	var today = new Date();
	var monthNames = ["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];
	var monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	var DayNames = ["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"];
	var thisDay;
        var MonthLinkDec = "";
        var MonthLinkInc = "";
	var mycode = "";

	//* si an passé en paramètre (1 si vide), on affecte et date() se débrouille
	if (an || 0) {
	  today = new Date(an,mois-1,jour);
	};
	//** date() à corrigé la date on la re-injecte pour lien vers mois plus propre
	an = today.getFullYear();
	mois = today.getMonth()+1;
	jour = today.getDate();

	year = today.getYear();
	if (year <= 200) {
	    year += 1900;
	}
	thisDay = today.getDate();
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
	    monthDays[1] = 29;
	}
	nDays = monthDays[today.getMonth()];
	firstDay = today;
	firstDay.setDate(1);
	testMe = firstDay.getDate();
	if (testMe == 2) {
	    firstDay.setDate(0);
	}
	startDay = firstDay.getDay()-1;
	if (startDay == -1) {
	    startDay = 6;
	}

	MonthLinkDec = '<A HREF="javascript:SelectDay(\''+iddiv+'\','+an+','+(mois-1)+','+jour+');">'
	MonthLinkInc = '<A HREF="javascript:SelectDay(\''+iddiv+'\','+an+','+(mois+1)+','+jour+');">'


	mycode += "<TABLE BORDER='1'>";
	mycode += "<TR>"
	mycode += "<TD CLASS='TD_MONTH' ALIGN='CENTER' VALIGN='MIDDLE'>"+MonthLinkDec+"<<"+"</A>";
	mycode += "<TD CLASS='TD_MONTH' COLSPAN=5 ALIGN='CENTER' VALIGN='MIDDLE'>"+" "+monthNames[today.getMonth()]+" "+year+" ";
	mycode += "<TD CLASS='TD_MONTH' ALIGN='CENTER' VALIGN='MIDDLE'>"+MonthLinkInc+">>"+"</A>";


	mycode += "<TR>";
	for (i = 0; i < 7; i++) {
	mycode += "<TD CLASS='TD_DAYNAME' ALIGN='CENTER' VALIGN='MIDDLE'>"+DayNames[i];
	}
	mycode += "<TR>";

	column = 0;
	for (i = 0; i < startDay; i++) {
	    mycode += "<TD CLASS='TD_DAYNONE' ALIGN='CENTER' VALIGN='MIDDLE'>";
	    column++;
	}
	for (i = 1; i <= nDays; i++) {
	    if (i == thisDay) {
	      mycode += "<TD CLASS='TD_DAYSELECT' ALIGN='CENTER' VALIGN='MIDDLE'>";
	    } else {
	      mycode += "<TD CLASS='TD_DAYNOSELECT' ALIGN='CENTER' VALIGN='MIDDLE'>";
	    }
	    mycode += '<A HREF="javascript:SelectDay(\''+iddiv+'\','+an+','+mois+','+i+');">'+i+'</A>';
	    column++;
	    if (column == 7) {
		mycode += "<TR>";
		column = 0;
	    }
	}
	mycode += "</TABLE>";
	document.getElementById(iddiv).innerHTML = mycode;
    }

