function TCalendar(id,position,x,y) {
//Attribut
	this.AId = id;
	this.AFixedX = (x==undefined)?-1:x;			// x position (-1 if to appear below control)
	this.AFixedY = (y==undefined)?-1:y;			// y position (-1 if to appear below control)
	this.APosition = (position==undefined)?"absolute":position;
	this.AStartAt = 1;			// 0 - sunday ; 1 - monday
	this.AShowWeekNumber = 1;	// 0 - don't show; 1 - show
	this.AShowToday = 1;		// 0 - don't show; 1 - show
	this.AShowComment = 1;		// 0 - don't show; 1 - show
	this.AShowLegend = 1;		// 0 - don't show; 1 - show
	this.AStyleToday = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
	this.AStyleCalendar = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;text-align:left;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
	this.AStyleEntete = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;text-align:left;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
	this.AStyleComment = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
	this.AStyleLegend = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
	this.AStyleComposantOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;font-size:9pt;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleComposantOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleCadrePopUp = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;padding:1px;z-index:99";
	this.AStyleButtonPopUpOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonPopUpOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";

	this.AStyleCadreDay = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;padding:1px;z-index:99";
	this.AStyleButtonDayOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#006EA9;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDayOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDayHoliday = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#ACC14E;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDayWeek = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#E8F5FC;font-size:9pt;text-align:center;color:#006EA9;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDaySelected = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#7951AE;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDayOld = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#51AE8D;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleButtonDayUnselected = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#73091F;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
	this.AStyleNumberWeek = "background-color:#E8F5FC;font-size:9pt;text-align:center;color:#006EA9;font-family: Arial Verdana;padding:1px";
	this.AStyleNameDay = "background-color:#E8F5FC;font-size:9pt;font-weight:bold;text-align:center;color:#006EA9;font-family: Arial Verdana;padding:1px";

  	this.ADaySpacing = 0;
	this.ATypeAnim = 1;
	this.AVitesseAnim = 7;
	this.AImgDir = "scripts/IncClient/images/";			// directory for images ... e.g. this.AImgDir="/img/"
	this.ADayCloses = new Array([0]);

	this.AGotoString = "Mois courant";
	this.ATodayString = "Aujourd hui :";
	this.AWeekString = "n°";

	this.AScrollLeftMessage = "Cliquer pour passer au mois pr&eacute;c&eacute;dent. Maintenir le bouton de la souris enfonc&eacute; pour le d&eacute;filement automatique.";
	this.AScrollRightMessage = "Cliquer pour passer au mois suivant. Maintenir le bouton de la souris enfonc&eacute; pour le d&eacute;filement automatique.";
	this.AScrollLeftMessageYear = "Cliquer pour passer &agrave; l ann&eacute;e pr&eacute;c&eacute;dente. Maintenir le bouton de la souris enfonc&eacute; pour le d&eacute;filement automatique.";
	this.AScrollRightMessageYear = "Cliquer pour passer &agrave; l ann&eacute;e suivante. Maintenir le bouton de la souris enfonc&eacute; pour le d&eacute;filement automatique.";
	this.ASelectMonthMessage = "Cliquer pour s&eacute;lectionner un mois.";
	this.ASelectYearMessage = "Cliquer pour s&eacute;lectionner ann&eacute;e.";
	this.ASelectDateMessage = "Choisir la date [date]."; // do not replace [date], it will be replaced by date.

	this.AMonthSelected = "";
	this.AYearSelected = "";
	this.ADateSelected = "";
	this.AOmonthSelected = "";
	this.AOyearSelected = "";
	this.AOdateSelected = "";
	this.AMonthConstructed = false;
	this.AYearConstructed = false;
	this.AIntervalID1 = "";
	this.AIntervalID2 = "";
	this.ATimeoutID1 = "";
	this.ATimeoutID2 = "";
	this.ACtlToPlaceValue = null;
	this.ACtlNow = null;
	this.ADateFormat = "jj/mm/yyyy";
	this.ANStartingYear = "";
	this.ADayWeek = false;
	this.ADayHoliday = false;
 	this.ABorne = null;

	this.AToday =	new	Date();
	this.ADateNow	 = this.AToday.getDate();
	this.AMonthNow = this.AToday.getMonth();
	this.AYearNow	 = this.AToday.getYear();
	if (!MS) this.AYearNow += 1900;

	this.ABShow = false;
	this.ABPageLoaded=false;

	this.AStrEaster = "P&acirc;ques";
	this.AStrEasterMonday = "Lundi de P&acirc;ques";
	this.AStrAscension = "Ascension";
	this.AStrPentecostMonday = "Lundi de Pentec&ocirc;te";
	this.AStrPentecost = "Pentec&ocirc;te";

	this.AMonthName =	new	Array ("Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet","Ao&ucirc;t","Septembre","Octobre","Novembre","D&eacute;cembre");
	this.ADayName = (this.AStartAt==0)?new Array ("Dim","Lun","Mar","Mer","Jeu","Ven","Sam"):new Array ("Lun","Mar","Mer","Jeu","Ven","Sam","Dim");
	
	//M&eacute;thodes:	
	this.MInit = TMInit;
	this.MPopUpCalendar = TMPopUpCalendar;
	this.MFormatDate = TMFormatDate;
	this.MConstructCalendar = TMConstructCalendar;
	this.MConstructDate = TMConstructDate;
	this.MWeekNbr = TMWeekNbr;
	this.MHideCalendar = TMHideCalendar;
	this.MDecMonth = TMDecMonth;
	this.MIncMonth = TMIncMonth;
	this.MShowComment = TMShowComment;
 	this.MShowLegend = TMShowLegend;
	this.MStartDecMonth = TMStartDecMonth;
	this.MStartIncMonth = TMStartIncMonth;
	this.MCloseCalendar = TMCloseCalendar;
	this.MPopUpMonth = TMPopUpMonth;
	this.MConstructMonth = TMConstructMonth;
	this.MPopDownYear = TMPopDownYear;
	this.MPopDownMonth = TMPopDownMonth;
	this.MPopUpYear = TMPopUpYear;
	this.MConstructYear = TMConstructYear;
	this.MIncYear = TMIncYear;
	this.MDecYear = TMDecYear;
	this.MIncYearAuto = TMIncYearAuto;
	this.MDecYearAuto = TMDecYearAuto;
	this.MStartDecYear = TMStartDecYear;
	this.MStartIncYear = TMStartIncYear;
	this.MSelectYear = TMSelectYear;
	this.MShowDefault = TMShowDefault;
	this.MShowScroll = TMShowScroll;
	this.MShowOpacity = TMShowOpacity;
	this.MSetXY = TMSetXY;
  	this.MInitWeekDays = TMInitWeekDays;
	this.MJourFerie = TMJourFerie;
	this.MGetPaques = TMGetPaques;

	// Initialisation  
  	this.MInit();
}

function TMInitWeekDays () {
  var i = 0;
  this.ADayCloses.clear(); 
	while(arguments[i] != null)  
    this.ADayCloses.push(arguments[i++]);
}

function TMInit()	{
	var htmlText = "";
  var attStyle = "";
	
	htmlText += "<div id='"+this.AId+"' width="+((this.AShowWeekNumber==1)?250:220)+">";
	htmlText += "<table	border=0 cellpadding=0 cellspacing=0 width="+((this.AShowWeekNumber==1)?250:220)+">";
	htmlText += "<tr><td>";
	htmlText += "	<table id='"+this.AId+"_entete' width='100%'>";
	htmlText += "	<tr><td >";
	htmlText += "		<div id='"+this.AId+"_caption'>";
	htmlText += "			<table border=0 cellpadding=0 cellspacing=0><tr>";
	htmlText += "				<td id='"+this.AId+"_spanLeft' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.AScrollLeftMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");clearInterval("+this.AId+".AIntervalID1);"+this.AId+".MShowComment(\"\");' onmousedown='clearTimeout("+this.AId+".ATimeoutID1);"+this.AId+".ATimeoutID1=setTimeout(\""+this.AId+".MStartDecMonth()\",100)'	onmouseup='clearTimeout("+this.AId+".ATimeoutID1);clearInterval("+this.AId+".AIntervalID1)' onclick='javascript:"+this.AId+".MDecMonth();'><IMG id='"+this.AId+"_changeLeft' SRC='"+this.AImgDir+"FlecheGauche.gif' width=15 height=15 BORDER=0></td>";
	htmlText += "				<td id='"+this.AId+"_spanRight' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.AScrollRightMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:clearInterval("+this.AId+".AIntervalID1);"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");' onmousedown='clearTimeout("+this.AId+".ATimeoutID1);"+this.AId+".ATimeoutID1=setTimeout(\""+this.AId+".MStartIncMonth()\",100)'	onmouseup='clearTimeout("+this.AId+".ATimeoutID1);clearInterval("+this.AId+".AIntervalID1)' onclick='javascript:"+this.AId+".MIncMonth();'><IMG id='"+this.AId+"_changeRight' SRC='"+this.AImgDir+"FlecheDroite.gif'	width=15 height=15 BORDER=0></td>";
	htmlText += "				<td id='"+this.AId+"_spanMonth' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.ASelectMonthMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");set_style_div(\"id\",\""+this.AId+"_spanMonthBas\",null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");set_style_div(\"id\",\""+this.AId+"_spanMonthBas\",null,\""+this.AStyleComposantOut+"\");' onclick='javascript:"+this.AId+".MPopUpMonth();'></td>";
	htmlText += "				<td id='"+this.AId+"_spanMonthBas' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.ASelectMonthMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");set_style_div(\"id\",\""+this.AId+"_spanMonth\",null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");set_style_div(\"id\",\""+this.AId+"_spanMonth\",null,\""+this.AStyleComposantOut+"\");' onclick='javascript:"+this.AId+".MPopUpMonth();'><IMG id='"+this.IAd+"_changeMonth' SRC='"+this.AImgDir+"FlecheBas.gif' WIDTH='15' HEIGHT='15' BORDER=0></td>";
	htmlText += "				<td>&nbsp;&nbsp;</td>";
	htmlText += "				<td id='"+this.AId+"_spanLeftYear' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.AScrollLeftMessageYear+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:clearInterval("+this.AId+".AIntervalID1);"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");' onmousedown='clearTimeout("+this.AId+".ATimeoutID1);"+this.AId+".ATimeoutID1=setTimeout(\""+this.AId+".MStartDecYear()\",100)'	onmouseup='clearTimeout("+this.AId+".ATimeoutID1);clearInterval("+this.AId+".AIntervalID1)' onclick='javascript:"+this.AId+".MDecYearAuto();'><IMG id='"+this.AId+"_changeLeft' SRC='"+this.AImgDir+"FlecheGauche.gif' width=15 height=15 BORDER=0></td>";
	htmlText += "				<td id='"+this.AId+"_spanRightYear' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.AScrollRightMessageYear+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");' onmouseout='javascript:clearInterval("+this.AId+".AIntervalID1);set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");"+this.AId+".MShowComment(\"\");' onmousedown='clearTimeout("+this.AId+".ATimeoutID1);"+this.AId+".ATimeoutID1=setTimeout(\""+this.AId+".MStartIncYear()\",100)'	onmouseup='clearTimeout("+this.AId+".ATimeoutID1);clearInterval("+this.AId+".AIntervalID1)' onclick='javascript:"+this.AId+".MIncYearAuto();'><IMG id='"+this.AId+"_changeRight' SRC='"+this.AImgDir+"FlecheDroite.gif'	width=15 height=15 BORDER=0></td>";
	htmlText += "				<td id='"+this.AId+"_spanYear' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.ASelectYearMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");set_style_div(\"id\",\""+this.AId+"_spanYearBas\",null,\""+this.AStyleComposantOver+"\");'	onmouseout='javascript:"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");set_style_div(\"id\",\""+this.AId+"_spanYearBas\",null,\""+this.AStyleComposantOut+"\");'	onclick='javascript:"+this.AId+".MPopUpYear()'></td>";
	htmlText += "				<td id='"+this.AId+"_spanYearBas' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\""+this.ASelectYearMessage+"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");set_style_div(\"id\",\""+this.AId+"_spanYear\",null,\""+this.AStyleComposantOver+"\");'	onmouseout='javascript:"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");set_style_div(\"id\",\""+this.AId+"_spanYear\",null,\""+this.AStyleComposantOut+"\");'	onclick='javascript:"+this.AId+".MPopUpYear()'><IMG id='"+this.IAd+"_changeYear' SRC='"+this.AImgDir+"FlecheBas.gif' WIDTH='15' HEIGHT='15' BORDER=0></td>";	
	if (this.AShowLegend == 1) {
  		htmlText += "				<td>&nbsp;&nbsp;</td>";
  		htmlText += "				<td id='"+this.AId+"_spanLegend' valign='middle' onmouseover='javascript:"+this.AId+".MShowComment(\"Afficher ou cacher les l&eacute;gendes\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOver+"\");'	onmouseout='javascript:"+this.AId+".MShowComment(\"\");set_style_div(\"id\",this.id,null,\""+this.AStyleComposantOut+"\");'	onclick='javascript:"+this.AId+".MShowLegend()'><b>&nbsp;?&nbsp;</b></td>";	
  	}  
	htmlText += "			</tr></table>";
	htmlText += "		</div>";
	htmlText += "	</td><td valign='middle' style='cursor:pointer'>";
	htmlText += "		<IMG SRC='"+this.AImgDir+"close.gif' WIDTH='15' HEIGHT='13' BORDER='0' ALT='Fermer le calendrier' onclick='javascript:"+this.AId+".MHideCalendar();'>";
	htmlText += "	</td></tr>";
	htmlText += "	</table>";
	htmlText += "</td></tr>";
	htmlText += "<tr><td align=center>";
	htmlText += "	<div id='"+this.AId+"_content'></div>";
	htmlText += "</td></tr>";
		
	if (this.AShowToday==1) {
		htmlText += "<tr><td align=center>";
		htmlText += "	<div id='"+this.AId+"_lblToday'>";
		htmlText += 		this.ATodayString;
		htmlText += "		<a onmousemove='javascript:"+this.AId+".MShowComment(\""+this.AGotoString+"\");' onmouseout='javascript:"+this.AId+".MShowComment(\"\");' title='"+this.AGotoString+"' href='javascript:"+this.AId+".AMonthSelected="+this.AId+".AMonthNow;"+this.AId+".AYearSelected="+this.AId+".AYearNow;"+this.AId+".MConstructCalendar();'>";
		htmlText += 		"<span style='color:white;'>"+this.ADayName[(this.AToday.getDay()-this.AStartAt==-1)?6:(this.AToday.getDay()-this.AStartAt)]+", " + this.ADateNow + " " + this.AMonthName[this.AMonthNow]	+ "	" +	this.AYearNow	+ "</span></a>";
		htmlText += "	</div>";
		htmlText += "</td></tr>";
	}
	if (this.AShowLegend == 1) {
		htmlText += "<tr><td align=center>";
		htmlText += "	<div id='"+this.AId+"_legend'>";
		htmlText += "	<table width=100% border=0 cellpadding=0 cellspacing=2>";
    		attStyle = (this.AStyleButtonDayHoliday.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayHoliday+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayHoliday+"\">Jours f&eacute;riers</td>";
		htmlText += "	</tr>";
    		attStyle = (this.AStyleButtonDayWeek.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayWeek+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayWeek+"\">Jours ferm&eacute;s dans une semaine</td>";
		htmlText += "	</tr>";
    		attStyle = (this.AStyleButtonDaySelected.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDaySelected+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDaySelected+"\">Aujourd'hui</td>";
		htmlText += "	</tr>";
    		attStyle = (this.AStyleButtonDayOld.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayOld+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayOld+"\">Jour s&eacute;lectionn&eacute;</td>";
		htmlText += "	</tr>";
    		attStyle = (this.AStyleButtonDayUnselected.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayUnselected+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayUnselected+"\">Jours non s&eacute;lectionnables</td>";
		htmlText += "	</tr>";
    		attStyle = (this.AStyleButtonDayOut.is_style())?"style":"class";
		htmlText += "	<tr>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayOut+"\" width=15 height=10>&nbsp;</td>";
		htmlText += "	<td "+attStyle+"=\""+this.AStyleButtonDayOut+"\">Jours normaux</td>";
		htmlText += "	</tr>";
		htmlText += "	</table>";
		htmlText += "	</div>";
		htmlText += "</td></tr>";
	}	
	if (this.AShowComment == 1) {
		htmlText += "<tr><td align=center>";
		htmlText += "	<div id='"+this.AId+"_comment'>";
		htmlText += "	</div>";
		htmlText += "</td></tr>";
	}	

	htmlText += "</table></div>";
	htmlText += "<div id='"+this.AId+"_selectMonth' style='z-index:+999;position:absolute;'></div>";
	htmlText += "<div id='"+this.AId+"_selectYear' style='z-index:+999;position:absolute;'></div>";

	document.write (htmlText);

	set_style_div("id",this.AId,null,this.AStyleCalendar);
	set_position_div("id",this.AId,null,this.APosition);
	set_style_div("id",this.AId+"_entete",null,this.AStyleEntete);
	if (this.AShowToday==1) set_style_div("id",this.AId+"_lblToday",null,this.AStyleToday);
	if (this.AShowComment==1) {
    	set_style_div("id",this.AId+"_comment",null,this.AStyleComment);
    	getElem("id",this.AId+"_comment").style.display = "none";
  }  
	if (this.AShowLegend==1) {
    set_style_div("id",this.AId+"_legend",null,this.AStyleLegend);
    getElem("id",this.AId+"_legend").style.display = "none";
  	set_style_div("id",this.AId+"_spanLegend",null,this.AStyleComposantOut);
  }  
	set_style_div("id",this.AId+"_spanLeft",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanRight",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanLeftYear",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanRightYear",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanMonth",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanYear",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanYearBas",null,this.AStyleComposantOut);
	set_style_div("id",this.AId+"_spanMonthBas",null,this.AStyleComposantOut);
	
	this.AMonthConstructed=false;
	this.AYearConstructed=false;

	this.ABPageLoaded=true;
	this.MHideCalendar();
}

function TMShowLegend () {
    if (getElem("id",this.AId+"_legend").style.display == "none") 
      getElem("id",this.AId+"_legend").style.display = "block";
    else  
      getElem("id",this.AId+"_legend").style.display = "none";
}

function TMConstructCalendar () {
	var aNumDays = Array (31,0,31,30,31,30,31,31,30,31,30,31);
	var dateMessage;
	var	startDate =	new	Date (this.AYearSelected,this.AMonthSelected,1);
	var endDate;
	var numDaysInMonth;
	var datePointer = 0;
	var sHTML = "";
	var sHint = "";
	var sStyle = "";
	var attStyle = "style";
	var datetype = null;
  var jourferier = "";

	if (this.AMonthSelected==1)	{
		endDate	= new Date (this.AYearSelected,this.AMonthSelected+1,1);
		endDate	= new Date (endDate	- (24*60*60*1000));
		numDaysInMonth = endDate.getDate();
	}
	else numDaysInMonth = aNumDays[this.AMonthSelected];

	dayPointer = startDate.getDay() - this.AStartAt;
		
	if (dayPointer<0) dayPointer = 6;

	sHTML +=	"<table	 id='"+this.AId+"_cadrejour' border=0 cellpadding=0 cellspacing=" + this.ADaySpacing + " width=100% ><tr>";

	if (this.AShowWeekNumber==1) {
		if (this.AStyleNumberWeek.is_style()) attStyle = "style";
		else attStyle = "class";  
    sHTML += "<td width=27 "+attStyle+"='"+this.AStyleNumberWeek+"'><b>" + this.AWeekString + "</b></td>";
    sHTML += "<td width=1 align=center rowspan=7 style='padding-left:2px;padding-right:2px'><img src='"+this.AImgDir+"divider.gif' width=1 height=100%></td>";
  }  

	if (this.AStyleNameDay.is_style()) attStyle = "style";
	else attStyle = "class";  
	for	(i=0; i<7; i++)	{
    sHTML += "<td width='27' "+attStyle+"='"+this.AStyleNameDay+"'>"+this.ADayName[i]+"</td>";
  }

	sHTML +="</tr><tr>";

	if (this.AShowWeekNumber==1) {
		if (this.AStyleNumberWeek.is_style()) attStyle = "style";
		else attStyle = "class";
    sHTML += "<td align=center "+attStyle+"='"+this.AStyleNumberWeek+"'>" + this.MWeekNbr(startDate) + "&nbsp;</td>";
  }  

	for	( var i=1; i<=dayPointer;i++ ) {sHTML += "<td>&nbsp;</td>";}
	
	for	( datePointer=1; datePointer<=numDaysInMonth; datePointer++ ) {
		dayPointer++;
		sHint = "";

		sStyle = this.AStyleButtonDayOut;

    	jourferier = this.MJourFerie(String(datePointer).fillPrevChar("0",2)+"/"+String(parseInt(this.AMonthSelected)+1).fillPrevChar("0",2)+"/"+this.AYearSelected);

		if ((datePointer==this.ADateNow)&&(this.AMonthSelected==this.AMonthNow)&&(this.AYearSelected==this.AYearNow))
			sStyle = this.AStyleButtonDaySelected; 

		if ((datePointer==this.AOdateSelected) && (this.AMonthSelected==this.AOmonthSelected) && (this.AYearSelected==this.AOyearSelected))
			sStyle=this.AStyleButtonDayOld; 

		if (jourferier != "") {
			sStyle=this.AStyleButtonDayHoliday;
			sHint+=sHint==""?jourferier:"\n"+jourferier;
    	}    

		if	(this.ADayCloses.is_in(dayPointer%7)) 
			sStyle = this.AStyleButtonDayWeek; 

    	if (this.ABorne) {
      			datetype = String(this.AYearSelected)+String(this.AMonthSelected+1).fillPrevChar("0",2)+String(datePointer).fillPrevChar("0",2);
      			if (!this.ABorne.in_born(datetype))
				sStyle=this.AStyleButtonDayUnselected;
    	}  
    
		var regexp= /\"/g;
		sHint=sHint.replace(regexp,"&quot;");

		dateMessage = "onmouseover='javascript:set_style_div(\"id\",this.id,null,\""+this.AStyleButtonDayOver+"\");"+this.AId+".MShowComment(\""+this.ASelectDateMessage.replace("[date]",this.MConstructDate(datePointer,this.AMonthSelected,this.AYearSelected))+"\");' onmouseout='javascript:set_style_div(\"id\",this.id,null,\""+sStyle+"\");"+this.AId+".MShowComment(\"\");' onclick='javascript:"+this.AId+".ADateSelected="+datePointer + ";"+this.AId+".MCloseCalendar();'";

		if ((sStyle == this.AStyleButtonDayUnselected) ||
			(sStyle == this.AStyleButtonDayHoliday && this.ADayHoliday) ||
			(sStyle == this.AStyleButtonDayWeek && this.ADayWeek))
			dateMessage = "onmouseover='javascript:"+this.AId+".MShowComment(\"Date non s&eacute;lectionnable\");' onmouseout='javascript:"+this.AId+".MShowComment(\"\");' ";

		if (sStyle.is_style()) attStyle = "style";
		else attStyle = "class";  

		sHTML += "<td id='day_"+datePointer+"' "+dateMessage+" title=\"" + sHint + "\" "+attStyle+"='"+sStyle+"' >" + padZero(datePointer) + "</div>";
		sHTML += "</td>";

		sHTML += "";

		if ((dayPointer+this.AStartAt) % 7 == this.AStartAt) { 
			sHTML += "</tr><tr>" ;
			if ((this.AShowWeekNumber==1)&&(datePointer<numDaysInMonth)) {
    		if (this.AStyleNumberWeek.is_style()) attStyle = "style";
		    else attStyle = "class";  
    		sHTML += "<td align=center "+attStyle+"='"+this.AStyleNumberWeek+"'>" + (this.MWeekNbr(new Date(this.AYearSelected,this.AMonthSelected,datePointer+1))) + "&nbsp;</td>";
			}
		}
	}

	setCont("id",this.AId+"_content",null,sHTML);
	setCont("id",this.AId+"_spanMonth",null,"&nbsp;"+this.AMonthName[this.AMonthSelected]+"&nbsp;"); 
	setCont("id",this.AId+"_spanYear",null,"&nbsp;"+this.AYearSelected+"&nbsp;");
	set_style_div("id",this.AId+"_cadrejour",null,this.AStyleCadreDay);
}
	
function TMShowComment(message) {
	if (this.AShowComment == 1) {
    if (message != "") {
      getElem("id",this.AId+"_comment").style.display = "block";
      setCont("id",this.AId+"_comment",null,message);
    }
    else getElem("id",this.AId+"_comment").style.display = "none";  
  }  
}

function TMFormatDate(format) {
	return (this.ADateFormat.split(format).length < 3)?"":format;
}	

function TMPopUpCalendar(ctl,ctl2,format,borne,jourfermer,jourferier) {
	var	leftpos=-200;
	var	toppos=0;
	var formatChar = " ";
	var aFormat;
	var tokensChanged = 0;
	var aDate;
	
  this.ABorne = (borne == undefined || borne == null)?null:borne;
	this.ADayWeek   = (jourfermer == undefined || jourfermer == null)?false:jourfermer;
	this.ADayHoliday   = (jourferier == undefined || jourferier == null)?false:jourferier;

	if (this.ABPageLoaded)
	{
		if (!is_visible_div("id",this.AId)) {
			this.ACtlToPlaceValue	= ctl2;
			this.ADateFormat = format;
			
			formatChar = 	this.MFormatDate(" ") +
							this.MFormatDate("/") +
							this.MFormatDate(".") +
							this.MFormatDate("-");

			tokensChanged =	0;

			if ( formatChar	!= "" ) {
				aFormat = this.ADateFormat.split(formatChar);
				aData =	this.ACtlToPlaceValue.value.split(formatChar);
				for	(i=0;i<3;i++) {
					
					if ((aFormat[i].toLowerCase()=="d") || (aFormat[i].toLowerCase()=="dd")) {
						this.ADateSelected = parseInt(aData[i], 10);
						tokensChanged ++;
					}
					else if	((aFormat[i].toLowerCase()=="m") || (aFormat[i].toLowerCase()=="mm")) {
						this.AMonthSelected =	parseInt(aData[i], 10) - 1;
						tokensChanged ++;
					}
					else if	(aFormat[i].toLowerCase()=="mmm")	{
						this.AMonthSelected= parseInt((aData[i])?aData[i].getNumMonth():null)-1;
						tokensChanged ++;
					}
					else if	(aFormat[i].toLowerCase()=="yyyy") {
						this.AYearSelected = parseInt(aData[i], 10);							
						tokensChanged ++;
					}
				}
			}
			if ((tokensChanged!=3)||isNaN(this.ADateSelected)||isNaN(this.AMonthSelected)||isNaN(this.AYearSelected)) {
				this.ADateSelected = this.ADateNow;
				this.AMonthSelected = this.AMonthNow;
				this.AYearSelected = this.AYearNow;
			}
			this.AOdateSelected = this.ADateSelected;
			this.AOmonthSelected = this.AMonthSelected;
			this.AOyearSelected = this.AYearSelected;


			this.MConstructCalendar ();
			this.ABShow = true;
			
			this.MSetXY();
      
			switch(this.ATypeAnim) {
				case 0: this.MShowDefault();break;
				case 1 : this.MShowScroll("right");break;
				case 2: this.MShowScroll("left");break;
				case 3: this.MShowScroll("top");break;
				case 4: this.MShowScroll("bottom");break;
				case 5: this.MShowOpacity();break;
				default: this.MShowDefault();break;
			}	
		}
		else {
			if (this.ACtlNow != ctl) {
        hide_div("id",this.AId);
        this.MPopUpCalendar(ctl,ctl2,format,borne,jourfermer,jourferier);
      }
      else this.MHideCalendar();
		}
		this.ACtlNow = ctl;
	}
}

function TMSetXY() {
	var x = get_x_obj(this.ACtlToPlaceValue);
	var y = get_y_obj(this.ACtlToPlaceValue)+this.ACtlToPlaceValue.offsetHeight+2;
	var l = get_l_div("id",this.AId);
	var h = get_h_div("id",this.AId);
	if ((x+l) >= (left_fenetre()+largeur_fenetre())) 
		x = left_fenetre()+largeur_fenetre()-l-(MS?33:0);
	if ((y+h) >= (top_fenetre()+hauteur_fenetre())) 
		y = top_fenetre()+hauteur_fenetre()-h;
	set_x_div("id",this.AId,null,(this.AFixedX==-1)?x:this.AFixedX);
	set_y_div("id",this.AId,null,(this.AFixedY==-1)?y:this.AFixedY);
}

function TMShowDefault() {
	show_div("id",this.AId);
}

function TMShowScroll(direction) {
  move_clip_open("id",this.AId,null,direction,this.AVitesseAnim,3,0,"");
}

function TMShowOpacity() {
	show_div("id",this.AId);
	if (!OP) opacity_open_div("id",this.AId,null,0.15,this.AVitesseAnim,"");
}

function TMHideCalendar()	{
	if (getElem("id",this.AId+"_selectMonth")) hide_div("id",this.AId+"_selectMonth");
	if (getElem("id",this.AId+"_selectYear")) hide_div("id",this.AId+"_selectYear");
  
	switch(this.ATypeAnim) {
		case 0: hide_div("id",this.AId);break;
		case 1: move_clip_close("id",this.AId,null,"left",this.AVitesseAnim,3,0,"");break;
		case 2: move_clip_close("id",this.AId,null,"right",this.AVitesseAnim,3,0,"");break;
		case 3: move_clip_close("id",this.AId,null,"bottom",this.AVitesseAnim,3,0,"");break;
		case 4: move_clip_close("id",this.AId,null,"top",this.AVitesseAnim,3,0,"");break;
		case 5: if (!OP) opacity_close_div("id",this.AId,null,0.15,this.AVitesseAnim,"hide_div(\"id\",\""+this.AId+"\");");break;
	}	
}

function padZero(num) {
	return (num	< 10)? '0' + num : num ;
}

function TMConstructDate(d,m,y)
{
	sTmp = this.ADateFormat;
	sTmp = sTmp.replace	("dd","<e>");
	sTmp = sTmp.replace	("d","<d>");
	sTmp = sTmp.replace	("<e>",padZero(d));
	sTmp = sTmp.replace	("<d>",d);
	sTmp = sTmp.replace	("mmm","<o>");
	sTmp = sTmp.replace	("mm","<n>");
	sTmp = sTmp.replace	("m","<m>");
	sTmp = sTmp.replace	("<m>",m+1);
	sTmp = sTmp.replace	("<n>",padZero(m+1));
	sTmp = sTmp.replace	("<o>",this.AMonthName[m]);
	return sTmp.replace ("yyyy",y);
}

function TMCloseCalendar() {
	this.MHideCalendar();
	this.ACtlToPlaceValue.value = this.MConstructDate(this.ADateSelected,this.AMonthSelected,this.AYearSelected);
}

function TMStartDecMonth() {this.AIntervalID1 = setInterval(this.AId+".MDecMonth()",80);}

function TMStartIncMonth() {this.AIntervalID1 = setInterval(this.AId+".MIncMonth()",80);}

function TMStartDecYear() {this.AIntervalID1 = setInterval(this.AId+".MDecYearAuto()",80);}

function TMStartIncYear() {this.AIntervalID1 = setInterval(this.AId+".MIncYearAuto()",80);}

function TMIncMonth () {
	this.AMonthSelected++;
	if (this.AMonthSelected>11) {
		this.AMonthSelected=0;
		this.AYearSelected++;
	}
	this.MConstructCalendar();
}

function TMDecMonth () {
	this.AMonthSelected--;
	if (this.AMonthSelected<0) {
		this.AMonthSelected=11;
		this.AYearSelected--;
	}
	this.MConstructCalendar();
}

function TMIncYearAuto () {
	this.AYearSelected++;
	this.MConstructCalendar();
}

function TMDecYearAuto () {
	this.AYearSelected--;
	this.MConstructCalendar();
}

function TMConstructMonth() {
	var sHTML = "";
	var sName = "";
	
	this.MPopDownYear();
	if (!this.AMonthConstructed) {
		sHTML =	"";
		for	(i=0; i<12;	i++) {
			sName =	this.AMonthName[i];
			if (i==this.AMonthSelected){
				sName =	"<B>" +	sName +	"</B>";
			}
			sHTML += "<tr><td id='"+this.AId+"_m" + i + "' onmouseover='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOver+"\");' onmouseout='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOut+"\");' onclick='"+this.AId+".AMonthConstructed=false;"+this.AId+".AMonthSelected=" + i + ";"+this.AId+".MConstructCalendar();"+this.AId+".MPopDownMonth();event.cancelBubble=true'>&nbsp;" + sName + "&nbsp;</td></tr>";
		}

		setCont("id",this.AId+"_selectMonth",null,"<table id='"+this.AId+"_cadrepopupmonth' width=70 cellspacing=0 onmouseover='clearTimeout("+this.AId+".ATimeoutID1)'	onmouseout='clearTimeout("+this.AId+".ATimeoutID1);"+this.AId+".ATimeoutID1=setTimeout(\""+this.AId+".MPopDownMonth()\",100);event.cancelBubble=true'>" +	sHTML +	"</table>");
		set_style_div("id",this.AId+"_cadrepopupmonth",null,this.AStyleCadrePopUp);
		for	(i=0; i<12;	i++) 
			set_style_div("id",this.AId+"_m" + i,null,this.AStyleButtonPopUpOut);

		this.AMonthConstructed=true;
	}
}

function TMPopUpMonth() {
	this.MConstructMonth();
	set_x_div("id",this.AId+"_selectMonth",null,get_x_div("id",this.AId+"_spanMonth"));
	set_y_div("id",this.AId+"_selectMonth",null,get_y_div("id",this.AId+"_spanMonth")+get_h_div("id",this.AId+"_spanMonth"));
	show_div("id",this.AId+"_selectMonth");
}

function TMPopDownMonth()	{hide_div("id",this.AId+"_selectMonth");}

function TMIncYear() {
	var newYear = "";
	var txtYear = "";

	for	(i=0; i<7; i++){
		newYear	= (i+this.ANStartingYear)+1;
		if (newYear==this.AYearSelected) txtYear = "&nbsp;<B>" + newYear + "</B>&nbsp;";
		else txtYear = "&nbsp;" + newYear + "&nbsp;";
		setCont("id",this.AId+"_y"+i,null,txtYear);
	}
	this.ANStartingYear ++;
	this.ABShow=true;
}

function TMDecYear() {
	var newYear = "";
	var txtYear = "";
	
	for	(i=0; i<7; i++){
		newYear	= (i+this.ANStartingYear)-1;
		if (newYear==this.AYearSelected) txtYear = "&nbsp;<B>" + newYear + "</B>&nbsp;";
		else txtYear = "&nbsp;" + newYear + "&nbsp;"; 
		setCont("id",this.AId+"_y"+i,null,txtYear);
	}
	this.ANStartingYear --;
	this.ABShow=true;
}

function TMSelectYear(nYear) {
	this.AYearSelected=parseInt(nYear+this.ANStartingYear);
	this.AYearConstructed=false;
	this.MConstructCalendar();
	this.MPopDownYear();
}

function TMConstructYear() {
	var sHTML =	"";
	var sName = "";
	var j = 0;
	
	this.MPopDownMonth();
	
	if (!this.AYearConstructed) {
		sHTML =	"<tr><td id='"+this.AId+"_moins' onmouseover='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOver+"\");' onmouseout='clearInterval("+this.AId+".AIntervalID1);set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOut+"\");' onmousedown='clearInterval("+this.AId+".AIntervalID1);"+this.AId+".AIntervalID1=setInterval(\""+this.AId+".MDecYear()\",30)' onmouseup='clearInterval("+this.AId+".AIntervalID1)'>-</td></tr>";
		j =	0;
		this.ANStartingYear =	this.AYearSelected-3;
		for	(i=(this.AYearSelected-3); i<=(this.AYearSelected+3); i++) {
			sName =	i;
			if (i==this.AYearSelected){
				sName =	"<B>" +	sName +	"</B>";
			}
			sHTML += "<tr><td id='"+this.AId+"_y" + j + "' onmouseover='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOver+"\");' onmouseout='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOut+"\");' onclick='"+this.AId+".MSelectYear("+j+");event.cancelBubble=true'>" + sName + "</td></tr>";
			j ++;
		}

		sHTML += "<tr><td id='"+this.AId+"_plus' onmouseover='set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOver+"\");' onmouseout='clearInterval("+this.AId+".AIntervalID2);set_style_div(\"id\",this.id,null,\""+this.AStyleButtonPopUpOut+"\");' onmousedown='clearInterval("+this.AId+".AIntervalID2);"+this.AId+".AIntervalID2=setInterval(\""+this.AId+".MIncYear()\",30)'	onmouseup='clearInterval("+this.AId+".AIntervalID2)'>+</td></tr>";

		setCont("id",this.AId+"_selectYear",null,"<table id='"+this.AId+"_cadrepopupyear' width=44 	onmouseover='clearTimeout("+this.AId+".ATimeoutID2)' onmouseout='clearTimeout("+this.AId+".ATimeoutID2);"+this.AId+".ATimeoutID2=setTimeout(\""+this.AId+".MPopDownYear()\",100)' cellspacing=0>"	+ sHTML	+ "</table>");
		set_style_div("id",this.AId+"_cadrepopupyear",null,this.AStyleCadrePopUp);
		set_style_div("id",this.AId+"_moins",null,this.AStyleButtonPopUpOut);
		set_style_div("id",this.AId+"_plus",null,this.AStyleButtonPopUpOut);
		j=0;
		for	(i=(this.AYearSelected-3); i<=(this.AYearSelected+3); i++) 
			set_style_div("id",this.AId+"_y" + (j++),null,this.AStyleButtonPopUpOut);

		this.AYearConstructed	= true;
	}
}

function TMPopDownYear() {
	clearInterval(this.AIntervalID1);
	clearTimeout(this.ATimeoutID1);
	clearInterval(this.AIntervalID2);
	clearTimeout(this.ATimeoutID2);
	hide_div("id",this.AId+"_selectYear");
}

function TMPopUpYear() {
	this.MConstructYear();
	set_x_div("id",this.AId+"_selectYear",null,get_x_div("id",this.AId+"_spanYear"));
	set_y_div("id",this.AId+"_selectYear",null,get_y_div("id",this.AId+"_spanYear")+get_h_div("id",this.AId+"_spanYear"));
	show_div("id",this.AId+"_selectYear");
}

	/*** calendar ***/
function TMWeekNbr(n) {
		var year = n.getFullYear();
		var month = n.getMonth() + 1;
		var day = (this.AStartAt == 0)?n.getDate() + 1:n.getDate();
		
		var a = Math.floor((14-month) / 12);
		var y = year + 4800 - a;
		var m = month + 12 * a - 3;
		var b = Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400);
		var J = day + Math.floor((153 * m + 2) / 5) + 365 * y + b - 32045;
		var d4 = (((J + 31741 - (J % 7)) % 146097) % 36524) % 1461;
		var L = Math.floor(d4 / 1460);
		var d1 = ((d4 - L) % 365) + L;
		var week = Math.floor(d1/7) + 1;
		
		return week;
}

/*----------------------------------------------------------------------------*/
// Teste si une date est un jour f&eacute;ri&eacute;
/*----------------------------------------------------------------------------*/
function TMJourFerie(DtDate) {
    var Y = DtDate.substr(6);
    var desc = "";
    var dtpaques = this.MGetPaques(parseInt(Y));

  // F&ecirc;tes mobiles
    var DtPaques = dtpaques.JJMMAAAA("/");
    var DtLundiPaques = dtpaques.addDay(1).JJMMAAAA("/");
    var DtAscension  = dtpaques.addDay(39).JJMMAAAA("/");
    var DtPentecote  = dtpaques.addDay(49).JJMMAAAA("/");
    var DtLundiPentecote = dtpaques.addDay(50).JJMMAAAA("/");

  // F&ecirc;tes fixes
    var DtNoel       = "25/12/" + Y;
    var DtAn         = "01/01/" + Y;
    var DtTravail    = "01/05/" + Y;
    var DtArm2g      = "08/05/" + Y;
    var DtFNat       = "14/07/" + Y;
    var DtAssomption = "15/08/" + Y;
    var DtToussaint  = "01/11/" + Y;
    var DtArm1G      = "11/11/" + Y;

  // Informe l'utilisateur d'un &eacute;ventuel jour f&eacute;ri&eacute;
  if (DtDate == DtPaques) desc = "P&acirc;cques";
  if (DtDate == DtLundiPaques) desc = "Lundi de P&acirc;cques";
  else if (DtDate == DtAscension) desc = "Ascencion";
  else if (DtDate == DtPentecote) desc = "Pentec&ocirc;te";
  else if (DtDate == DtLundiPentecote) desc = "Lundi de Pentec&ocirc;te";
  else if (DtDate == DtNoel) desc = "No&euml;l";
  else if (DtDate == DtAn) desc = "Jour de l'An";
  else if (DtDate == DtTravail) desc = "F&ecirc;te du travail";
  else if (DtDate == DtArm2g) desc = "Armistice 1945";
  else if (DtDate == DtFNat) desc = "F&ecirc;te Nationale";
  else if (DtDate == DtAssomption) desc = "Assomption";
  else if (DtDate == DtToussaint) desc = "Toussaint";
  else if (DtDate == DtArm1G) desc = "Armistice 1918";
  
  return desc;
} //fin JourFerie

function TMGetPaques(year) {
  var A = year%19;
  var B = Math.floor(year/100);
  var C = year%100;
  var D = Math.floor(B/4);
  var E = B%4;
  var F = Math.floor((B+8)/25);
  var G = Math.floor((B-F+1)/3);
  var H = (19*A+B-D-G+15)%30;
  var I = Math.floor(C/4);
  var K = C%4;
  var L = (32+2*E+2*I-H-K)%7;
  var M = Math.floor((A+11*H+22*L)/451); 
  var month = Math.floor((H+L-7*M+114)/31);
  var day = (H+L-7*M+114)%31;
  var dt = new Date(year,month-1,day+1);
  return dt;
}
