//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////		OXYDATEPICKER	V 1.0	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	openDatepicker( ID du conteneur, ID du conteneur de l'affichage de la date, ID du champs hidden ( date ), ID duchamps hidden ( mode ), année , mois , jour , drag&drop, closable )
//
//	Le datepicker s'initialise de 4 manières - Voir les 4 possibilités dans la fonction
//
//	Les paramètres de la fonction :
//										Paramètre " année "			==>		année ( chaîne )
//										Paramètre " mois "  		==>		00 à 11 ( chaîne )
//										Paramètre " jour "			==>		01 à 31 ( chaîne )
//										Paramètre " drag&drop "		==>		false ou true
//										Paramètre " closable "		==>		false ou true
//	Format du champs hidden :
//										YYYYMMDD
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	Textes
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var common_010_text = new Array();
common_010_text['EN']					= "oxygenbay";
common_010_text['ES']					= "oxygenbay";
common_010_text['FR']					= "lundi";
common_010_text['DE']					= "oxygenbay";
common_010_text['IT']					= "oxygenbay";
common_010_text['PT']					= "oxygenbay";

var common_011_text = new Array();
common_011_text['EN']					= "oxygenbay";
common_011_text['ES']					= "oxygenbay";
common_011_text['FR']					= "mardi";
common_011_text['DE']					= "oxygenbay";
common_011_text['IT']					= "oxygenbay";
common_011_text['PT']					= "oxygenbay";

var common_012_text = new Array();
common_012_text['EN']					= "oxygenbay";
common_012_text['ES']					= "oxygenbay";
common_012_text['FR']					= "mercredi";
common_012_text['DE']					= "oxygenbay";
common_012_text['IT']					= "oxygenbay";
common_012_text['PT']					= "oxygenbay";

var common_013_text = new Array();
common_013_text['EN']					= "oxygenbay";
common_013_text['ES']					= "oxygenbay";
common_013_text['FR']					= "jeudi";
common_013_text['DE']					= "oxygenbay";
common_013_text['IT']					= "oxygenbay";
common_013_text['PT']					= "oxygenbay";

var common_014_text = new Array();
common_014_text['EN']					= "oxygenbay";
common_014_text['ES']					= "oxygenbay";
common_014_text['FR']					= "vendredi";
common_014_text['DE']					= "oxygenbay";
common_014_text['IT']					= "oxygenbay";
common_014_text['PT']					= "oxygenbay";

var common_015_text = new Array();
common_015_text['EN']					= "oxygenbay";
common_015_text['ES']					= "oxygenbay";
common_015_text['FR']					= "samedi";
common_015_text['DE']					= "oxygenbay";
common_015_text['IT']					= "oxygenbay";
common_015_text['PT']					= "oxygenbay";

var common_016_text = new Array();
common_016_text['EN']					= "oxygenbay";
common_016_text['ES']					= "oxygenbay";
common_016_text['FR']					= "dimanche";
common_016_text['DE']					= "oxygenbay";
common_016_text['IT']					= "oxygenbay";
common_016_text['PT']					= "oxygenbay";

var common_017_text = new Array();
common_017_text['EN']					= "oxygenbay";
common_017_text['ES']					= "oxygenbay";
common_017_text['FR']					= "janvier";
common_017_text['DE']					= "oxygenbay";
common_017_text['IT']					= "oxygenbay";
common_017_text['PT']					= "oxygenbay";

var common_018_text = new Array();
common_018_text['EN']					= "oxygenbay";
common_018_text['ES']					= "oxygenbay";
common_018_text['FR']					= "février";
common_018_text['DE']					= "oxygenbay";
common_018_text['IT']					= "oxygenbay";
common_018_text['PT']					= "oxygenbay";

var common_019_text = new Array();
common_019_text['EN']					= "oxygenbay";
common_019_text['ES']					= "oxygenbay";
common_019_text['FR']					= "mars";
common_019_text['DE']					= "oxygenbay";
common_019_text['IT']					= "oxygenbay";
common_019_text['PT']					= "oxygenbay";

var common_020_text = new Array();
common_020_text['EN']					= "oxygenbay";
common_020_text['ES']					= "oxygenbay";
common_020_text['FR']					= "avril";
common_020_text['DE']					= "oxygenbay";
common_020_text['IT']					= "oxygenbay";
common_020_text['PT']					= "oxygenbay";

var common_021_text = new Array();
common_021_text['EN']					= "oxygenbay";
common_021_text['ES']					= "oxygenbay";
common_021_text['FR']					= "mai";
common_021_text['DE']					= "oxygenbay";
common_021_text['IT']					= "oxygenbay";
common_021_text['PT']					= "oxygenbay";

var common_022_text = new Array();
common_022_text['EN']					= "oxygenbay";
common_022_text['ES']					= "oxygenbay";
common_022_text['FR']					= "juin";
common_022_text['DE']					= "oxygenbay";
common_022_text['IT']					= "oxygenbay";
common_022_text['PT']					= "oxygenbay";

var common_023_text = new Array();
common_023_text['EN']					= "oxygenbay";
common_023_text['ES']					= "oxygenbay";
common_023_text['FR']					= "juillet";
common_023_text['DE']					= "oxygenbay";
common_023_text['IT']					= "oxygenbay";
common_023_text['PT']					= "oxygenbay";

var common_024_text = new Array();
common_024_text['EN']					= "oxygenbay";
common_024_text['ES']					= "oxygenbay";
common_024_text['FR']					= "ao&ucirc;t";
common_024_text['DE']					= "oxygenbay";
common_024_text['IT']					= "oxygenbay";
common_024_text['PT']					= "oxygenbay";

var common_025_text = new Array();
common_025_text['EN']					= "oxygenbay";
common_025_text['ES']					= "oxygenbay";
common_025_text['FR']					= "septembre";
common_025_text['DE']					= "oxygenbay";
common_025_text['IT']					= "oxygenbay";
common_025_text['PT']					= "oxygenbay";

var common_026_text = new Array();
common_026_text['EN']					= "oxygenbay";
common_026_text['ES']					= "oxygenbay";
common_026_text['FR']					= "octobre";
common_026_text['DE']					= "oxygenbay";
common_026_text['IT']					= "oxygenbay";
common_026_text['PT']					= "oxygenbay";

var common_027_text = new Array();
common_027_text['EN']					= "oxygenbay";
common_027_text['ES']					= "oxygenbay";
common_027_text['FR']					= "novembre";
common_027_text['DE']					= "oxygenbay";
common_027_text['IT']					= "oxygenbay";
common_027_text['PT']					= "oxygenbay";

var common_028_text = new Array();
common_028_text['EN']					= "oxygenbay";
common_028_text['ES']					= "oxygenbay";
common_028_text['FR']					= "décembre";
common_028_text['DE']					= "oxygenbay";
common_028_text['IT']					= "oxygenbay";
common_028_text['PT']					= "oxygenbay";

var common_100_text = new Array();
common_100_text['EN']					= "oxygenbay";
common_100_text['ES']					= "oxygenbay";
common_100_text['FR']					= "Lun";
common_100_text['DE']					= "oxygenbay";
common_100_text['IT']					= "oxygenbay";
common_100_text['PT']					= "oxygenbay";

var common_101_text = new Array();
common_101_text['EN']					= "oxygenbay";
common_101_text['ES']					= "oxygenbay";
common_101_text['FR']					= "Mar";
common_101_text['DE']					= "oxygenbay";
common_101_text['IT']					= "oxygenbay";
common_101_text['PT']					= "oxygenbay";

var common_102_text = new Array();
common_102_text['EN']					= "oxygenbay";
common_102_text['ES']					= "oxygenbay";
common_102_text['FR']					= "Mer";
common_102_text['DE']					= "oxygenbay";
common_102_text['IT']					= "oxygenbay";
common_102_text['PT']					= "oxygenbay";

var common_103_text = new Array();
common_103_text['EN']					= "oxygenbay";
common_103_text['ES']					= "oxygenbay";
common_103_text['FR']					= "Jeu";
common_103_text['DE']					= "oxygenbay";
common_103_text['IT']					= "oxygenbay";
common_103_text['PT']					= "oxygenbay";

var common_104_text = new Array();
common_104_text['EN']					= "oxygenbay";
common_104_text['ES']					= "oxygenbay";
common_104_text['FR']					= "Ven";
common_104_text['DE']					= "oxygenbay";
common_104_text['IT']					= "oxygenbay";
common_104_text['PT']					= "oxygenbay";

var common_105_text = new Array();
common_105_text['EN']					= "oxygenbay";
common_105_text['ES']					= "oxygenbay";
common_105_text['FR']					= "Sam";
common_105_text['DE']					= "oxygenbay";
common_105_text['IT']					= "oxygenbay";
common_105_text['PT']					= "oxygenbay";

var common_106_text = new Array();
common_106_text['EN']					= "oxygenbay";
common_106_text['ES']					= "oxygenbay";
common_106_text['FR']					= "Dim";
common_106_text['DE']					= "oxygenbay";
common_106_text['IT']					= "oxygenbay";
common_106_text['PT']					= "oxygenbay";

var common_107_text = new Array();
common_107_text['EN']					= "oxygenbay";
common_107_text['ES']					= "oxygenbay";
common_107_text['FR']					= "semaine du";
common_107_text['DE']					= "oxygenbay";
common_107_text['IT']					= "oxygenbay";
common_107_text['PT']					= "oxygenbay";

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	Code
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var selectedTemplate = "";

/*--------------------------------------------------------------------------------------------------------------------------\
|																															|
\--------------------------------------------------------------------------------------------------------------------------*/
function writeDatepickerTexts( thisLang, theDiv )
{
	if ( theDiv == "all" )
	{
		var allDivs = document.getElementsByTagName("abbr");
		
		if ( allDivs.length > 0 )
		{
			for ( var i = 0; i < allDivs.length; i++ ) 
			{
				if ( ( typeof  allDivs[i].id != 'undefined' ) && ( allDivs[i].id != '' ) )
				{
					allDivs[i].innerHTML = eval(allDivs[i].id + "_text['" + thisLang + "']");
				}
			}
		}
	}
	else
	{
		var theDivObj = $(theDiv);
		
		if ( theDivObj != null )
		{
			var allDivs = theDivObj.getElementsByTagName("abbr");
			
			if ( allDivs.length > 0 )
			{
				for ( var i = 0; i < allDivs.length; i++ ) 
				{
					if ( ( typeof  allDivs[i].id != 'undefined' ) && ( allDivs[i].id != '' ) )
					{
						allDivs[i].innerHTML = eval(allDivs[i].id + "_text['" + thisLang + "']");
					}
				}
			}
		}
	}
}

function openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, year, month, date, thisDraggable, thisClosable )
{
	//	Date du jour
	var todayDate = new Date();
	var todayDateGetDate = todayDate.getDate();
	var todayDateGetMonth = todayDate.getMonth();
	var todayDateGetFullYear = todayDate.getFullYear();
	
	//	Date du datepicker au démarrage
	var startDate = new Date();
	
	//	Champs hidden ( date )
	var theDatepickerHidden = $( thisDatepickerHidden );
	var theDatepickerHiddenValue = theDatepickerHidden.value;
	
	if ( theDatepickerHiddenValue != "" )
	{
		var theDpHiddenValueYear = theDatepickerHiddenValue.substr(0,4);
		var theDpHiddenValueMonth = theDatepickerHiddenValue.substr(4,2);
		var theDpHiddenValueDay = theDatepickerHiddenValue.substr(6,2);
	}
	else
	{
		//	Conversion en chaînes
		todayDateGetDate = addZero( todayDateGetDate ).toString(10);
		todayDateGetMonth = addZero( todayDateGetMonth ).toString(10);
		todayDateGetFullYear = todayDateGetFullYear.toString(10);
		
		//	Ecriture de la date dans le champs hidden ( date )
		$( thisDatepickerHidden ).value = todayDateGetFullYear + todayDateGetMonth + todayDateGetDate;
	}
	
	//	Le datepicker comprend 4 modes d'initialisation :
	//	Initialisation 1		==>		Paramètres de fonction VIDES		&&		champs hidden ( date ) VIDE			==>		Initialisation avec la date du jour
	if ( ( date == "" || month == "" || year == "" ) && theDatepickerHiddenValue == "" )
	{
		if ( date != "" || month != "" || year != "" )
		{
			alert("Datepicker initialisation error"); return false;
		}
		else
		{
			startDate.setDate( todayDateGetDate );
			startDate.setMonth( todayDateGetMonth );
			startDate.setFullYear( todayDateGetFullYear );
		}
	}
	
	//	Initialisation 2		==>		Paramètres de fonction VIDES		&&		champs hidden ( date ) REMPLI		==>		Initialisation avec la date du champs hidden
	if ( ( date == "" || month == "" || year == "" ) && theDatepickerHiddenValue != "" )
	{
		if ( date != "" || month != "" || year != "" )
		{
			alert("Datepicker initialisation error"); return false;
		}
		else
		{
			startDate.setDate( theDpHiddenValueDay );
			startDate.setMonth( ( parseInt ( theDpHiddenValueMonth , 10 ) ).toString() );
			startDate.setFullYear( theDpHiddenValueYear );
		}
	}
	
	//	Initialisation 3		==>		Paramètres de fonction REMPLIS		&&		champs hidden ( date ) REMPLI		==>		Initialisation avec les paramètres de fonction
	if ( ( date != "" || month != "" || year != "" ) && theDatepickerHiddenValue != "" )
	{
		if ( date == "" || month == "" || year == "" )
		{
			alert("Datepicker initialisation error"); return false;
		}
		else
		{
			startDate.setDate( date );
			startDate.setMonth( month );
			startDate.setFullYear( year );
		}
	}
	
	//	Initialisation 4		==>		Paramètres de fonction REMPLIS		&&		champs hidden ( date ) VIDE			==>		Initialisation avec les paramètres de fonction
	if ( ( date != "" || month != "" || year != "" ) && theDatepickerHiddenValue == "" )
	{
		if ( date == "" || month == "" || year == "" )
		{
			alert("Datepicker initialisation error"); return false;
		}
		else
		{
			startDate.setDate( date );
			startDate.setMonth( month );
			startDate.setFullYear( year );
		}
	}
	
	//	Paramétrages du premier jour de la semaine
	//	var firstDayOfWeek = 1;	//	Premier jour --> Dimanche
	var firstDayOfWeek = 7;	//	Premier jour --> Lundi
		
	switch( firstDayOfWeek )
	{
		case 7 : var day_array_index = new Array( 0 , 1 , 2 , 3 , 4 , 5 , 6 ); break;			//	lundi
		case 6 : var day_array_index = new Array( 1 , 2 , 3 , 4 , 5 , 6 , 0 ); break;			//	mardi
		case 5 : var day_array_index = new Array( 2 , 3 , 4 , 5 , 6 , 0 , 1 ); break;			//	mercredi
		case 4 : var day_array_index = new Array( 3 , 4 , 5 , 6 , 0 , 1 , 2 ); break;			//	jeudi
		case 3 : var day_array_index = new Array( 4 , 5 , 6 , 0 , 1 , 2 , 3 ); break;			//	vendredi
		case 2 : var day_array_index = new Array( 5 , 6 , 0 , 1 , 2 , 3 , 4 ); break;			//	samedi
		case 1 : var day_array_index = new Array( 6 , 0 , 1 , 2 , 3 , 4 , 5 ); break;			//	dimanche
	}
	
	startDate.setDate( firstDayOfWeek );
	
	//	Affectation à des variables
	var startDateGetDay			= startDate.getDay();
	var startDateGetMonth		= startDate.getMonth();
	var startDateGetFullYear	= startDate.getFullYear();
	
	// Jours de la semaine de lundi à dimanche
	var day_array = new Array("common_100","common_101","common_102","common_103","common_104","common_105","common_106");
	// Les mois de janvier à décembre
	var month_array = new Array("common_017","common_018","common_019","common_020","common_021","common_022","common_023","common_024","common_025","common_026","common_027","common_028");
	
	//	Si aucun mode n'est sélectionné au démarrage, on utilise le mode " day " par défaut
	var theDatepickerMode = "day";
	if ( $( thisDatepickerMode ).value != "" )
	{
		theDatepickerMode = $( thisDatepickerMode ).value;
	}
	else
	{
		$( thisDatepickerMode ).value = "day";
	}
	
	switch( theDatepickerMode )
	{
		//		Datepicker classique
		case	"day" :
							var innerHTML =		'<table border="0" cellspacing="0" cellpadding="0" class="datepicker_texts">';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table id="' + thisDatepicker + '_handle" border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="30" class="hand datepicker_01" onclick="javascript:goPreviousMonth(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
					if ( thisDraggable == true ) { innerHTML +=		'<td width="31" class="move"><img src="img/datepicker_14.png" width="31" height="33"></td>'; }
							innerHTML +=							'<td class="datepicker_date">';
							innerHTML +=								'<table align="center" border="0" cellspacing="0" cellpadding="0">';
							innerHTML +=									'<tr>';
							innerHTML +=										'<td class="padL5"><abbr id="' + month_array[startDateGetMonth] + '">&nbsp;</abbr></td>';
							innerHTML +=										'<td class="padL5 padR5">' + startDateGetFullYear + '</td>';
							innerHTML +=									'</tr>';
							innerHTML +=								'</table>';
							innerHTML +=							'</td>';
					if ( thisClosable == true ) { innerHTML +=		'<td width="22" class="hand datepicker_13" onclick="$(\'' + thisDatepicker + '\').style.display=\'none\'"><img src="img/pixel.gif" width="22" height="33"></td>'; }
							innerHTML +=							'<td width="30" class="hand datepicker_03" onclick="javascript:goNextMonth(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15" class="datepicker_04"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=							'<td>';
							innerHTML +=								'<table id="' + thisDatepicker + '_cellsContainer" border="0" cellspacing="0" cellpadding="0" class="w100 borderCollapse bgFFFFFF">';
							innerHTML +=									'<tr>';
							
							for ( var i = 0; i < 7; i++ )
							{
								innerHTML +=									'<td height="15" class="datepicker_head_columns"><abbr id="' + day_array[day_array_index[i]] + '">&nbsp;</abbr></td>';
							}
							
							innerHTML +=									'</tr>';
							innerHTML +=									'<tr>';
							innerHTML +=										'<td colspan="7"><img src="img/pixel.gif" width="1" height="3"></td>';
							innerHTML +=									'</tr>';
							
							//	Calcul du nombre de jours à afficher
							maxDays = ( countMaxDays( startDateGetMonth, startDateGetFullYear ) + startDateGetDay );
							//	Calcul du nombre de lignes nécessaires pour construire le calendrier
							maxLines = ( maxDays ) / 7;
							
							for( i = 0; i < maxLines; i++ )
							{
										innerHTML +=						'<tr>';
								
								for( j = i*7; j < i*7 + 7; j++ )
								{
									//	Derniers jours du mois précédent
									if ( j < startDateGetDay )
									{
										var thePreviousDate		= new Date( startDateGetFullYear, startDateGetMonth, ( j + 1 - startDateGetDay ) );
										var previousDay			= thePreviousDate.getDate();
										var previousMonth		= thePreviousDate.getMonth() + 1;
										var previousYear		= thePreviousDate.getFullYear();
										
										// Affecte le style au jour sélectionné - DATE SÉLECTIONNÉE
										if ( theDatepickerHiddenValue != "" && addZero( previousDay ) == theDpHiddenValueDay && addZero( previousMonth - 1 ) == theDpHiddenValueMonth && previousYear == theDpHiddenValueYear )
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_1" oxyselectedstyle="datepicker_style_1_selected" class="datepicker_style_1_selected" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + previousDay + ',' + previousMonth + ',' + previousYear + ');">' + previousDay + '</td>';
										}
										else
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_1" oxyselectedstyle="datepicker_style_1_selected" class="datepicker_style_1" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + previousDay + ',' + previousMonth + ',' + previousYear + ');">' + previousDay + '</td>';
										}
									}
									//	Premiers jours du mois suivant
									else if ( j >= maxDays )
									{
										var theNextDate			= new Date( startDateGetFullYear, startDateGetMonth + 2, ( j - ( countMaxDays( startDateGetMonth, startDateGetFullYear) + startDateGetDay ) + 1 ) );
										var nextDay				= theNextDate.getDate();
										var nextMonth			= theNextDate.getMonth();
										var nextYear			= theNextDate.getFullYear();
										
										//	Patch pour interdire le mois de passer à 0 !
										if ( nextMonth == 0 )
										{
											nextMonth = 12;
											nextYear = nextYear - 1;
										}
										//	Patch fin
										
										// Affecte le style au jour sélectionné - DATE SÉLECTIONNÉE
										if ( theDatepickerHiddenValue != "" && addZero( nextDay ) == theDpHiddenValueDay && addZero( nextMonth - 1 ) == theDpHiddenValueMonth && nextYear == theDpHiddenValueYear )
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_2" oxyselectedstyle="datepicker_style_2_selected" class="datepicker_style_2_selected" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + nextDay + ',' + nextMonth + ',' + nextYear + ');">' + nextDay + '</td>';
										}
										else
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_2" oxyselectedstyle="datepicker_style_2_selected" class="datepicker_style_2" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + nextDay + ',' + nextMonth + ',' + nextYear + ');">' + nextDay + '</td>';
										}
									}
									//	Les jours du mois sélectionné
									else
									{
										// Affecte le style à la DATE DU JOUR - AUJOURD'HUI
										if ( j - startDateGetDay + 1 == todayDateGetDate && startDateGetMonth == todayDateGetMonth && startDateGetFullYear == todayDateGetFullYear )
										{
											// si DATE DU JOUR = DATE SÉLECTIONNÉE
											if ( theDatepickerHiddenValue != "" && j - startDateGetDay + 1 == theDpHiddenValueDay && startDateGetMonth == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear )
											{
												innerHTML +=					'<td align="center" oxyoriginalstyle="datepicker_style_3" oxyselectedstyle="datepicker_style_5" class="datepicker_style_5" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + ( j - startDateGetDay + 1 ) + ',' + ( startDateGetMonth + 1 ) + ',' + startDateGetFullYear + ');">' + ( j - startDateGetDay + 1 ) + '</td>';
											}
											
											// si DATE DU JOUR != DATE SÉLECTIONNÉE
											else
											{
												innerHTML +=					'<td align="center" oxyoriginalstyle="datepicker_style_3" oxyselectedstyle="datepicker_style_5" class="datepicker_style_3" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + ( j - startDateGetDay + 1 ) + ',' + ( startDateGetMonth + 1 ) + ',' + startDateGetFullYear + ');">' + ( j - startDateGetDay + 1 ) + '</td>';
											}
										}
										
										// Affecte le style à la DATE SÉLECTIONNÉE
										else if ( theDatepickerHiddenValue != "" && j - startDateGetDay + 1 == theDpHiddenValueDay && startDateGetMonth == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear && ( j - startDateGetDay + 1 != todayDateGetDate || startDateGetMonth != todayDateGetMonth || startDateGetFullYear != todayDateGetFullYear ) )
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_4" oxyselectedstyle="datepicker_style_3_selected" class="datepicker_style_3_selected" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + ( j - startDateGetDay + 1 ) + ',' + ( startDateGetMonth + 1 ) + ',' + startDateGetFullYear + ');">' + ( j - startDateGetDay + 1 ) + '</td>';
										}
										
										// Affecte le style aux autres jours
										else
										{
											innerHTML +=						'<td align="center" oxyoriginalstyle="datepicker_style_4" oxyselectedstyle="datepicker_style_4_selected" class="datepicker_style_4" onclick="javascript:paintCell(\'' + thisDatepicker + '\', this);selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + ( j - startDateGetDay + 1 ) + ',' + ( startDateGetMonth + 1 ) + ',' + startDateGetFullYear + ');">' + ( j - startDateGetDay + 1 ) + '</td>';
										}
									}
								}
								innerHTML +=								'</tr>';
							}
							innerHTML +=								'</table>';
							innerHTML +=							'<td>';
							innerHTML +=							'<td width="15" class="datepicker_05"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_06.png" width="15" height="14"></td>';
							innerHTML +=							'<td class="datepicker_07"><img src="img/pixel.gif" width="1" height="1"></td>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_08.png" width="15" height="14"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=		'</table>';
		break;
		
		//		Affichage des semaines
		case	"week" :
							//	Calcul du nombre de jours à afficher
							maxDays = ( countMaxDays( startDateGetMonth, startDateGetFullYear ) + startDateGetDay );
							//	Calcul du nombre de lignes nécessaires pour construire le calendrier
							maxLines = ( maxDays ) / 7;
							maxLinesRounded = Math.ceil( maxLines );
							
							//	Array contenant les jours " theWeekArray " - données :
							//	theWeekArray[i][j] = new Array( année , mois , date , style de la cellule , style de la cellule ( survol ) , style de la cellule ( sélectionnée ) , contient la semaine en cours ( true ou false ) , contient la semaine en cours sélectionnée ( true ou false ) );
							var theWeekArray = new Array();
							
							for( i = 0; i < maxLines; i++ )
							{
								theWeekArray[i] = new Array();
								theWeekArray[i]["containsToday"] = new Array( false );
								theWeekArray[i]["containsSelected"] = new Array( false );
								
								for( j = i*7; j < i*7 + 7; j++ )
								{
									//	Derniers jours du mois précédent
									if ( j < startDateGetDay )
									{
										//						Derniers jours du mois précédent
										var thePreviousDate		= new Date( startDateGetFullYear, startDateGetMonth, ( j + 1 - startDateGetDay ) );
										var previousDay			= thePreviousDate.getDate();
										var previousMonth		= thePreviousDate.getMonth() + 1;
										var previousYear		= thePreviousDate.getFullYear();
										
										// Affecte le style au jour sélectionné - DATE SÉLECTIONNÉE
										if ( theDatepickerHiddenValue != "" && addZero( previousDay ) == theDpHiddenValueDay && addZero( previousMonth - 1 ) == theDpHiddenValueMonth && previousYear == theDpHiddenValueYear )
										{
											theWeekArray[i][j] = new Array( previousYear , previousMonth , previousDay , "datepicker_style_1_week" , "datepicker_style_1_week_transparent" );
											theWeekArray[i]["containsSelected"][0] = true;
										}
										else
										{
											theWeekArray[i][j] = new Array( previousYear , previousMonth , previousDay , "datepicker_style_1_week" , "datepicker_style_1_week_transparent" );
										}
									}
									//	Premiers jours du mois suivant
									else if ( j >= maxDays )
									{
										//						Premiers jours du mois suivant
										var theNextDate			= new Date( startDateGetFullYear, startDateGetMonth + 2, ( j - ( countMaxDays( startDateGetMonth, startDateGetFullYear) + startDateGetDay ) + 1 ) );
										var nextDay				= theNextDate.getDate();
										var nextMonth			= theNextDate.getMonth();
										var nextYear			= theNextDate.getFullYear();
										
										theWeekArray[i][j] = new Array( nextYear , nextMonth , nextDay , "datepicker_style_2_week" , "datepicker_style_2_week_transparent" );
									}
									//	Les jours du mois sélectionné
									else
									{
										var dayToDisplay = j - startDateGetDay + 1;
										
										// Affecte le style à la DATE DU JOUR - AUJOURD'HUI
										if ( dayToDisplay == todayDateGetDate && startDateGetMonth == todayDateGetMonth && startDateGetFullYear == todayDateGetFullYear )
										{
											// si DATE DU JOUR = DATE SÉLECTIONNÉE
											if ( theDatepickerHiddenValue != "" && dayToDisplay == theDpHiddenValueDay && startDateGetMonth == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear )
											{
												theWeekArray[i][j] = new Array( startDateGetFullYear , startDateGetMonth + 1 , dayToDisplay , "datepicker_style_4_week" , "datepicker_style_4_week_transparent" );
												theWeekArray[i]["containsToday"][0] = true;
												theWeekArray[i]["containsSelected"][0] = true;
											}
											
											// si DATE DU JOUR != DATE SÉLECTIONNÉE
											else
											{
												theWeekArray[i][j] = new Array( startDateGetFullYear , startDateGetMonth + 1 , dayToDisplay , "datepicker_style_4_week" , "datepicker_style_4_week_transparent" );
												theWeekArray[i]["containsToday"][0] = true;
											}
										}
										
										// Affecte le style à la DATE SÉLECTIONNÉE
										else if ( theDatepickerHiddenValue != "" && dayToDisplay == theDpHiddenValueDay && startDateGetMonth == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear && ( j - startDateGetDay + 1 != todayDateGetDate || startDateGetMonth != todayDateGetMonth || startDateGetFullYear != todayDateGetFullYear ) )
										{
											theWeekArray[i][j] = new Array( startDateGetFullYear , startDateGetMonth + 1 , dayToDisplay , "datepicker_style_4_week" , "datepicker_style_4_week_transparent" );
											theWeekArray[i]["containsSelected"][0] = true;
										}
										
										// Affecte le style aux autres jours
										else
										{
											theWeekArray[i][j] = new Array( startDateGetFullYear , startDateGetMonth + 1 , dayToDisplay , "datepicker_style_4_week" , "datepicker_style_4_week_transparent" );
										}
									}
								}
							}
							
							var innerHTML =		'<table border="0" cellspacing="0" cellpadding="0" class="datepicker_texts">';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table id="' + thisDatepicker + '_handle" border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="30" class="hand datepicker_01" onclick="javascript:goPreviousMonth(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
					if ( thisDraggable == true ) { innerHTML +=		'<td width="31" class="move"><img src="img/datepicker_14.png" width="31" height="33"></td>'; }
							innerHTML +=							'<td class="datepicker_date">';
							innerHTML +=								'<table align="center" border="0" cellspacing="0" cellpadding="0">';
							innerHTML +=									'<tr>';
							innerHTML +=										'<td><abbr id="' + month_array[startDateGetMonth] + '">&nbsp;</abbr></td>';
							innerHTML +=										'<td class="padL5 padR5">' + startDateGetFullYear + '</td>';
							innerHTML +=									'</tr>';
							innerHTML +=								'</table>';
							innerHTML +=							'</td>';
					if ( thisClosable == true ) { innerHTML +=		'<td width="22" class="hand datepicker_13" onclick="$(\'' + thisDatepicker + '\').style.display=\'none\'"><img src="img/pixel.gif" width="22" height="33"></td>'; }
							innerHTML +=							'<td width="30" class="hand datepicker_03" onclick="javascript:goNextMonth(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15" class="datepicker_04"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=							'<td>';
							innerHTML +=								'<table id="' + thisDatepicker + '_cellsContainer" border="0" cellspacing="0" cellpadding="0" class="w100 borderCollapse bgFFFFFF">';
							innerHTML +=									'<tr>';
							
							for ( var i = 0; i < 7; i++ )
							{
								innerHTML +=									'<td height="15" class="datepicker_head_columns"><abbr id="' + day_array[day_array_index[i]] + '">&nbsp;</abbr></td>';
							}
							
							innerHTML +=									'</tr>';
							innerHTML +=									'<tr>';
							innerHTML +=										'<td colspan="7"><img src="img/pixel.gif" width="1" height="3"></td>';
							innerHTML +=									'</tr>';
							
							for( i = 0; i < maxLines; i++ )
							{
								//	Attribution du style au <TR>
								var theLineClassname = "";
								var theTdDisplay = "normal";
								var theLineStyle = "";
								//	Si le <TR> contient AUJOURD'HUI et contient JOUR SÉLECTIONNÉ				-->		BLEU	: hover BLEU
								if ( theWeekArray[i]["containsToday"][0] == true && theWeekArray[i]["containsSelected"][0] == true )
								{
									//	Style du <TR>
									theLineClassname = "datepicker_style_week_1";
									//	Style des <TD> dans le <TR> parent
									theTdDisplay = "selected";
								}
								//	Si le <TR> contient AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ			-->		VERT	: hover ORANGE
								if ( theWeekArray[i]["containsToday"][0] == true && theWeekArray[i]["containsSelected"][0] == false )
								{
									theLineClassname = "datepicker_style_week_2"; theTdDisplay = "selected";
								}
								//	Si le <TR> ne contient pas AUJOURD'HUI et contient JOUR SÉLECTIONNÉ			-->		ORANGE	: hover ORANGE
								if ( theWeekArray[i]["containsToday"][0] == false && theWeekArray[i]["containsSelected"][0] == true )
								{
									theLineClassname = "datepicker_style_week_3"; theTdDisplay = "selected";
								}
								//	Si le <TR> ne contient pas AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ	-->		NOIR	: hover ORANGE
								if ( theWeekArray[i]["containsToday"][0] == false && theWeekArray[i]["containsSelected"][0] == false )
								{
									theLineClassname = "datepicker_style_week_4"; theTdDisplay = "normal";
								}
								
								if ( browserIE ) { 	innerHTML +=						'<tr id="' + thisDatepicker + '_line_' + i + '" class="' + theLineClassname + '" oxylinemode="' + theTdDisplay + '" onmouseenter="paintLineHover(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ')" onmouseleave="paintLineOut(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ')" onclick="javascript:paintSelectedLine(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ');selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + theWeekArray[i][i*7][2] + ',' + theWeekArray[i][i*7][1] + ',' + theWeekArray[i][i*7][0] + ');">';	}
								else { 				innerHTML +=						'<tr id="' + thisDatepicker + '_line_' + i + '" class="' + theLineClassname + '" oxylinemode="' + theTdDisplay + '" onmouseover="paintLineHover(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ')" onmouseout="paintLineOut(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ')" onclick="javascript:paintSelectedLine(\'' + thisDatepicker + '\',' + i + ',' + maxLinesRounded + ');selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', ' + theWeekArray[i][i*7][2] + ',' + theWeekArray[i][i*7][1] + ',' + theWeekArray[i][i*7][0] + ');">';	}
								
								for( j = i*7; j < i*7 + 7; j++ )
								{
									if ( theTdDisplay == "normal" ) { var theLineStyle = theWeekArray[i][j][3]; } else { theLineStyle = theWeekArray[i][j][4]; }
									innerHTML +=						'<td align="center" class="' + theLineStyle + '" oxyoriginalstyle="' + theWeekArray[i][j][3] + '" oxyselectedstyle="' + theWeekArray[i][j][4] + '">' + theWeekArray[i][j][2] + '</td>';
								}
								
								innerHTML +=								'</tr>';
							}
							innerHTML +=								'</table>';
							innerHTML +=							'<td>';
							innerHTML +=							'<td width="15" class="datepicker_05"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_06.png" width="15" height="14"></td>';
							innerHTML +=							'<td class="datepicker_07"><img src="img/pixel.gif" width="1" height="1"></td>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_08.png" width="15" height="14"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=		'</table>';
		break;
		
		//		Affichage des mois
		case	"month" :
							//	Array contenant les mois de l'année " theMonthsArray " - données :
							//	theMonthsArray[i][j] = new Array( mois en cours ( true ou false ) , mois sélectionné ( true ou false ) );
							var theMonthsArray = new Array();
							
							for ( var i = 0; i < 12; i++ )
							{
								theMonthsArray[i] = new Array();
								theMonthsArray[i]["containsActualMonth"] = new Array( false );
								theMonthsArray[i]["containsSelectedMonth"] = new Array( false );
								
								// Affecte le style au MOIS EN COURS
								if ( i == todayDateGetMonth && startDateGetFullYear == todayDateGetFullYear )
								{
									// si MOIS EN COURS = MOIS SÉLECTIONNÉ
									if ( theDatepickerHiddenValue != "" && i == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear )
									{
										theMonthsArray[i]["containsActualMonth"][0] = true;
										theMonthsArray[i]["containsSelectedMonth"][0] = true;
									}
									
									// si MOIS EN COURS != MOIS SÉLECTIONNÉ
									else
									{
										theMonthsArray[i]["containsActualMonth"][0] = true;
									}
								}
								
								// Affecte le style au MOIS SÉLECTIONNÉ
								else if ( theDatepickerHiddenValue != "" && i == theDpHiddenValueMonth && startDateGetFullYear == theDpHiddenValueYear )
								{
									theMonthsArray[i]["containsSelectedMonth"][0] = true;
								}
							}
							
							var innerHTML =		'<table border="0" cellspacing="0" cellpadding="0" class="datepicker_texts">';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table id="' + thisDatepicker + '_handle" border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="30" class="hand datepicker_01" onclick="javascript:goPreviousYear(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
					if ( thisDraggable == true ) { innerHTML +=		'<td width="31" class="move"><img src="img/datepicker_14.png" width="31" height="33"></td>'; }
							innerHTML +=							'<td class="datepicker_date" align="center">' + startDateGetFullYear + '</td>';
					if ( thisClosable == true ) { innerHTML +=		'<td width="22" class="hand datepicker_13" onclick="$(\'' + thisDatepicker + '\').style.display=\'none\'"><img src="img/pixel.gif" width="22" height="33"></td>'; }
							innerHTML +=							'<td width="30" class="hand datepicker_03" onclick="javascript:goNextYear(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15" class="datepicker_04"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=							'<td>';
							innerHTML +=								'<table id="' + thisDatepicker + '_cellsContainer" border="0" cellspacing="0" cellpadding="0" class="w100 borderCollapse bgFFFFFF">';
							
							innerHTML +=									'<tr>';
							innerHTML +=										'<td><img src="img/pixel.gif" width="1" height="3"></td>';
							innerHTML +=									'</tr>';
							
							for ( var i = 0; i < 12; i++ )
							{
								//	Attribution du style au <TR>
								var theLineClassname = "";
								
								//	Si le <TD> contient LE MOIS EN COURS et contient LE MOIS SÉLECTIONNÉ				-->		VERT	: hover BLEU
								if ( theMonthsArray[i]["containsActualMonth"][0] == true && theMonthsArray[i]["containsSelectedMonth"][0] == true )
								{
									theLineClassname = "datepicker_style_month_1";
								}
								//	Si le <TD> contient LE MOIS EN COURS et ne contient pas LE MOIS SÉLECTIONNÉ			-->		VERT	: hover ORANGE
								if ( theMonthsArray[i]["containsActualMonth"][0] == true && theMonthsArray[i]["containsSelectedMonth"][0] == false )
								{
									theLineClassname = "datepicker_style_month_2";
								}
								//	Si le <TD> ne contient pas LE MOIS EN COURS et contient LE MOIS SÉLECTIONNÉ			-->		ORANGE	: hover ORANGE
								if ( theMonthsArray[i]["containsActualMonth"][0] == false && theMonthsArray[i]["containsSelectedMonth"][0] == true )
								{
									theLineClassname = "datepicker_style_month_3";
								}
								//	Si le <TD> ne contient pas LE MOIS EN COURS et ne contient pas LE MOIS SÉLECTIONNÉ	-->		NOIR	: hover ORANGE
								if ( theMonthsArray[i]["containsActualMonth"][0] == false && theMonthsArray[i]["containsSelectedMonth"][0] == false )
								{
									theLineClassname = "datepicker_style_month_4";
								}
								
								innerHTML +=							'<tr>';
								innerHTML +=								'<td width="160" align="center" id="' + thisDatepicker + '_line_' + i + '" class="' + theLineClassname + '" onclick="javascript:paintSelectedMonth(\'' + thisDatepicker + '\',' + i + ');selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\',01,' + addZero( i + 1 ) + ',' + startDateGetFullYear + ');">' + eval( month_array[i] + "_text")[lg] + '</td>';
								innerHTML +=							'</tr>';
							}
							
							innerHTML +=								'</table>';
							innerHTML +=							'<td>';
							innerHTML +=							'<td width="15" class="datepicker_05"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_06.png" width="15" height="14"></td>';
							innerHTML +=							'<td class="datepicker_07"><img src="img/pixel.gif" width="1" height="1"></td>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_08.png" width="15" height="14"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=		'</table>';
		break;
		
		//		Affichage des années
		case	"year" :
							var theYearsArray = new Array();
							
							for ( var i = 11; i > 0; i-- )
							{
								theYearsArray[i] = new Array();
								theYearsArray[i]["containsActualYear"] = new Array( false );
								theYearsArray[i]["containsSelectedYear"] = new Array( false );
								
								// Affecte le style à L'ANNÉE EN COURS
								if ( ( startDateGetFullYear + 6 - i ) == todayDateGetFullYear )
								{
									// si L'ANNÉE EN COURS = ANNÉE SÉLECTIONNÉE
									if ( theDatepickerHiddenValue != "" && ( startDateGetFullYear + 6 - i ) == theDpHiddenValueYear )
									{
										theYearsArray[i]["containsActualYear"][0] = true;
										theYearsArray[i]["containsSelectedYear"][0] = true;
									}
									
									// si L'ANNÉE EN COURS != ANNÉE SÉLECTIONNÉE
									else
									{
										theYearsArray[i]["containsActualYear"][0] = true;
									}
								}
								
								// Affecte le style à l'ANNÉE SÉLECTIONNÉE
								else if ( theDatepickerHiddenValue != "" && ( startDateGetFullYear + 6 - i ) == theDpHiddenValueYear )
								{
									theYearsArray[i]["containsSelectedYear"][0] = true;
								}
							}
							
							var innerHTML =		'<table border="0" cellspacing="0" cellpadding="0" class="datepicker_texts">';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table id="' + thisDatepicker + '_handle" border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="30" class="hand datepicker_01" onclick="javascript:goPreviousYear(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
					if ( thisDraggable == true ) { innerHTML +=		'<td width="31" class="move"><img src="img/datepicker_14.png" width="31" height="33"></td>'; }
							innerHTML +=							'<td class="datepicker_date" align="center">' + startDateGetFullYear + '</td>';
					if ( thisClosable == true ) { innerHTML +=		'<td width="22" class="hand datepicker_13" onclick="$(\'' + thisDatepicker + '\').style.display=\'none\'"><img src="img/pixel.gif" width="22" height="33"></td>'; }
							innerHTML +=							'<td width="30" class="hand datepicker_03" onclick="javascript:goNextYear(\'' + thisDatepicker + '\', \'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\', \'' + startDateGetMonth + '\', \'' + startDateGetFullYear + '\', ' + thisDraggable + ', ' + thisClosable + ');"><img src="img/pixel.gif" width="30" height="33"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15" class="datepicker_04"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=							'<td>';
							innerHTML +=								'<table id="' + thisDatepicker + '_cellsContainer" border="0" cellspacing="0" cellpadding="0" class="w100 borderCollapse bgFFFFFF">';
							
							innerHTML +=									'<tr>';
							innerHTML +=										'<td><img src="img/pixel.gif" width="1" height="3"></td>';
							innerHTML +=									'</tr>';
							
							for ( var i = 11; i > 0; i-- )
							{
								//	Attribution du style au <TR>
								var theLineClassname = "";
								
								//	Si le <TD> contient L'ANNÉE EN COURS et contient L'ANNÉE SÉLECTIONNÉE					-->		VERT	: hover BLEU
								if ( theYearsArray[i]["containsActualYear"][0] == true && theYearsArray[i]["containsSelectedYear"][0] == true )
								{
									theLineClassname = "datepicker_style_year_1";
								}
								//	Si le <TD> contient L'ANNÉE EN COURS et ne contient pas L'ANNÉE SÉLECTIONNÉE			-->		VERT	: hover ORANGE
								if ( theYearsArray[i]["containsActualYear"][0] == true && theYearsArray[i]["containsSelectedYear"][0] == false )
								{
									theLineClassname = "datepicker_style_year_2";
								}
								//	Si le <TD> ne contient pas L'ANNÉE EN COURS et contient L'ANNÉE SÉLECTIONNÉE			-->		ORANGE	: hover ORANGE
								if ( theYearsArray[i]["containsActualYear"][0] == false && theYearsArray[i]["containsSelectedYear"][0] == true )
								{
									theLineClassname = "datepicker_style_year_3";
								}
								//	Si le <TD> ne contient pas L'ANNÉE EN COURS et ne contient pas L'ANNÉE SÉLECTIONNÉE		-->		NOIR	: hover ORANGE
								if ( theYearsArray[i]["containsActualYear"][0] == false && theYearsArray[i]["containsSelectedYear"][0] == false )
								{
									theLineClassname = "datepicker_style_year_4";
								}
								
								innerHTML +=							'<tr>';
								innerHTML +=								'<td width="160" align="center" id="' + thisDatepicker + '_line_' + i + '" class="' + theLineClassname + '" onclick="javascript:paintSelectedYear(\'' + thisDatepicker + '\',' + i + ');selectDate(\'' + thisDatepickerDisplay + '\', \'' + thisDatepickerHidden + '\', \'' + thisDatepickerMode + '\',01,01,' + ( startDateGetFullYear + 6 - i ) + ');">' + ( startDateGetFullYear + 6 - i ) + '</td>';
								innerHTML +=							'</tr>';
							}
							
							innerHTML +=								'</table>';
							innerHTML +=							'<td>';
							innerHTML +=							'<td width="15" class="datepicker_05"><img src="img/pixel.gif" width="15" height="1"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=			'<tr>';
							innerHTML +=				'<td>';
							innerHTML +=					'<table border="0" cellspacing="0" cellpadding="0" class="w100">';
							innerHTML +=						'<tr>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_06.png" width="15" height="14"></td>';
							innerHTML +=							'<td class="datepicker_07"><img src="img/pixel.gif" width="1" height="1"></td>';
							innerHTML +=							'<td width="15"><img src="' + selectedTemplate + 'datepicker_08.png" width="15" height="14"></td>';
							innerHTML +=						'</tr>';
							innerHTML +=					'</table>';
							innerHTML +=				'<td>';
							innerHTML +=			'</tr>';
							innerHTML +=		'</table>';
		break;
	}
	
	var actualDatepicker = $(thisDatepicker);
	actualDatepicker.innerHTML = innerHTML;
	
	//	Affiche la date dans le champs de texte si celui-ci est vide
	//if ( $(thisDatepickerDisplay).innerHTML == "&nbsp;" || $(thisDatepickerDisplay).innerHTML == "" )
	//{
		displayDate( thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode );
	//}
	
	writeDatepickerTexts(lg, thisDatepicker);	//	Ecrit les textes dans la langue choisie
		
	//	Initialisation du drag & drop du datepicker
	if ( typeof YAHOO != 'undefined' )
	{
		if ( thisDraggable == true )
		{
			YAHOO.example.oxydatepickerDD = function() 
			{
				var datepickerDD;
				return {
					startDD: function()
					{
						datepickerDD = new YAHOO.util.DD( thisDatepicker );
						datepickerDD.setHandleElId( thisDatepicker + "_handle" );
					},
					unregDD: function()
					{
						datepickerDD.unreg();
						if ( thisDraggable == true && $(thisDatepicker + "_position") )
						{
							actualDatepicker.style.top = $(thisDatepicker + "_position").offsetTop + "px";
							actualDatepicker.style.left = $(thisDatepicker + "_position").offsetLeft + "px";
						}
					}
				};
			} ();
			
			YAHOO.example.oxydatepickerDD.startDD();
		}
		else if ( YAHOO.example.oxydatepickerDD )
		{
			YAHOO.example.oxydatepickerDD.unregDD();
		}
	}
	
	actualDatepicker.style.display = "block";
}

//	Compte le nombre de jours à afficher
function countMaxDays( month, year )
{
	var thisDate = new Date( year, month + 1, 0 );
	return thisDate.getDate();
}
//	Utilisé dans le mode : case "day" - Change le style de la cellule sur l'évènement onclick
function paintCell( thisDatepicker, thisCell )
{
	var theCellsContainer = $( thisDatepicker + "_cellsContainer" );
	var allCells = theCellsContainer.getElementsByTagName("td");
	
	var attrib = "";
	
	for ( var i = 0; i < allCells.length; i++ )
	{
		attrib = allCells[i].getAttribute("oxyoriginalstyle");
		if ( attrib )
		{
			//	On se sert de la propriété << oxyoriginalstyle >> de la cellule
			allCells[i].className = allCells[i].attributes["oxyoriginalstyle"].value;
		}
	}
	thisCell.className = thisCell.attributes["oxyselectedstyle"].value;
}
//	Utilisé dans le mode : case "month" - Change le style de la ligne au survol
function paintLineHover( thisDatepicker, thisLine , maxLines )
{
	var selectedLine = $( thisDatepicker + "_line_" + thisLine );
	
	for ( var i = 0; i < maxLines; i++ )
	{
		if ( selectedLine.attributes["oxylinemode"].value == "normal" )
		{
			var allCells = selectedLine.getElementsByTagName("td");
			for ( var i = 0; i < 7; i++ )
			{
				allCells[i].className = allCells[i].attributes["oxyselectedstyle"].value;
			}
		}
	}
}
//	Utilisé dans le mode : case "month" - Change le style de la ligne au survol
function paintLineOut( thisDatepicker, thisLine , maxLines )
{
	var selectedLine = $( thisDatepicker + "_line_" + thisLine );
	
	for ( var i = 0; i < maxLines; i++ )
	{
		if ( selectedLine.attributes["oxylinemode"].value == "normal" )
		{
			var allCells = selectedLine.getElementsByTagName("td");
			for ( var i = 0; i < 7; i++ )
			{
				allCells[i].className = allCells[i].attributes["oxyoriginalstyle"].value;
			}
		}
	}
}
//	Utilisé dans le mode : case "week" - Change le style de la ligne au onclick
function paintSelectedLine( thisDatepicker, thisLine , maxLines )
{
	var selectedLine = $( thisDatepicker + "_line_" + thisLine );
	var selectedLineClassName = selectedLine.className;
	
	for ( var i = 0; i < maxLines; i++ )
	{
		//	Cas de la ligne sélectionnée
		if ( thisLine == i )
		{
			switch( selectedLineClassName )
			{
				//case "datepicker_style_week_1" :	//	Si le <TR> contient : AUJOURD'HUI et contient JOUR SÉLECTIONNÉ	->	rien ne change
				//break;
				case "datepicker_style_week_2" :	//	Si le <TR> contient : AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ
													selectedLine.className = "datepicker_style_week_1";
				break;
				//case "datepicker_style_week_3" :	//	Si le <TR> ne contient pas : AUJOURD'HUI et contient JOUR SÉLECTIONNÉ	->	rien ne change
				//break;
				case "datepicker_style_week_4" :	//	Si le <TR> ne contient pas : AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ
													selectedLine.className = "datepicker_style_week_3";
				break;
			}
			selectedLine.attributes["oxylinemode"].value = "selected";
		}
		else	//	Cas des autres lignes
		{
			switch( $( thisDatepicker + "_line_" + i ).className )
			{
				case "datepicker_style_week_1" :	//	Si le <TR> contient : AUJOURD'HUI et contient JOUR SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_week_2";
													$( thisDatepicker + "_line_" + i ).attributes["oxylinemode"].value = "selected";
				break;
				case "datepicker_style_week_2" :	//	Si le <TR> contient : AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_week_2";
													$( thisDatepicker + "_line_" + i ).attributes["oxylinemode"].value = "selected";
				break;
				case "datepicker_style_week_3" :	//	Si le <TR> ne contient pas : AUJOURD'HUI et contient JOUR SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_week_4";
													$( thisDatepicker + "_line_" + i ).attributes["oxylinemode"].value = "normal";
													//	Réattribution des styles originaux aux cellules de la ligne
													var allCells = $( thisDatepicker + "_line_" + i ).getElementsByTagName("td");
													for ( var j = 0; j < 7; j++ )
													{
														allCells[j].className = allCells[j].attributes["oxyoriginalstyle"].value;
													}
				break;
				case "datepicker_style_week_4" :	//	Si le <TR> ne contient pas : AUJOURD'HUI et ne contient pas JOUR SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_week_4";
													$( thisDatepicker + "_line_" + i ).attributes["oxylinemode"].value = "normal";
				break;
			}
		}
	}
}

//	Utilisé dans le mode : case "month" - Change le style de la ligne au onclick
function paintSelectedMonth( thisDatepicker, thisLine )
{
	var selectedLine = $( thisDatepicker + "_line_" + thisLine );
	var selectedLineClassName = selectedLine.className;
	
	for ( var i = 0; i < 12; i++ )
	{
		//	Cas de la ligne sélectionnée
		if ( thisLine == i )
		{
			switch( selectedLineClassName )
			{
				//case "datepicker_style_week_1" :	//	Si le <TR> contient le MOIS EN COURS et contient le MOIS SÉLECTIONNÉ	->	rien ne change
				//break;
				case "datepicker_style_month_2" :	//	Si le <TR> contient le MOIS EN COURS et ne contient pas le MOIS SÉLECTIONNÉ
													selectedLine.className = "datepicker_style_month_1";
				break;
				//case "datepicker_style_week_3" :	//	Si le <TR> ne contient pas le MOIS EN COURS et contient le MOIS SÉLECTIONNÉ	->	rien ne change
				//break;
				case "datepicker_style_month_4" :	//	Si le <TR> ne contient pas le MOIS EN COURS et ne contient pas le MOIS SÉLECTIONNÉ
													selectedLine.className = "datepicker_style_month_3";
				break;
			}
			//selectedLine.attributes["oxylinemode"].value = "selected";
		}
		else	//	Cas des autres lignes
		{
			switch( $( thisDatepicker + "_line_" + i ).className )
			{
				case "datepicker_style_month_1" :	//	Si le <TR> contient le MOIS EN COURS et contient le MOIS SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_month_2";
				break;
				case "datepicker_style_month_2" :	//	Si le <TR> contient le MOIS EN COURS et ne contient pas le MOIS SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_month_2";
				break;
				case "datepicker_style_month_3" :	//	Si le <TR> ne contient pas le MOIS EN COURS et contient le MOIS SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_month_4";
				break;
				case "datepicker_style_month_4" :	//	Si le <TR> ne contient pas le MOIS EN COURS et ne contient pas le MOIS SÉLECTIONNÉ
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_month_4";
				break;
			}
		}
	}
}

//	Utilisé dans le mode : case "year" - Change le style de la ligne au onclick
function paintSelectedYear( thisDatepicker, thisLine )
{
	var selectedLine = $( thisDatepicker + "_line_" + thisLine );
	var selectedLineClassName = selectedLine.className;
	
	for ( var i = 11; i > 0; i-- )
	{
		//	Cas de la ligne sélectionnée
		if ( thisLine == i )
		{
			switch( selectedLineClassName )
			{
				//case "datepicker_style_week_1" :	//	Si le <TR> contient l'ANNÉE EN COURS et contient l'ANNÉE SÉLECTIONNÉE	->	rien ne change
				//break;
				case "datepicker_style_year_2" :	//	Si le <TR> contient l'ANNÉE EN COURS et ne contient pas l'ANNÉE SÉLECTIONNÉE
													selectedLine.className = "datepicker_style_year_1";
				break;
				//case "datepicker_style_week_3" :	//	Si le <TR> ne contient pas l'ANNÉE EN COURS et contient l'ANNÉE SÉLECTIONNÉE	->	rien ne change
				//break;
				case "datepicker_style_year_4" :	//	Si le <TR> ne contient pas l'ANNÉE EN COURS et ne contient pas l'ANNÉE SÉLECTIONNÉE
													selectedLine.className = "datepicker_style_year_3";
				break;
			}
		}
		else	//	Cas des autres lignes
		{
			switch( $( thisDatepicker + "_line_" + i ).className )
			{
				case "datepicker_style_year_1" :	//	Si le <TR> contient l'ANNÉE EN COURS et contient l'ANNÉE SÉLECTIONNÉE
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_year_2";
				break;
				case "datepicker_style_year_2" :	//	Si le <TR> contient l'ANNÉE EN COURS et ne contient pas l'ANNÉE SÉLECTIONNÉE
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_year_2";
				break;
				case "datepicker_style_year_3" :	//	Si le <TR> ne contient pas l'ANNÉE EN COURS et contient l'ANNÉE SÉLECTIONNÉE
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_year_4";
				break;
				case "datepicker_style_year_4" :	//	Si le <TR> ne contient pas l'ANNÉE EN COURS et ne contient pas l'ANNÉE SÉLECTIONNÉE
													$( thisDatepicker + "_line_" + i ).className = "datepicker_style_year_4";
				break;
			}
		}
	}
}

function goNextMonth( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, thisMonth, thisYear, thisDraggable, thisClosable )
{
	theMonth = parseInt( thisMonth , 10 );
	theYear = parseInt( thisYear , 10 );
	
	if ( thisMonth == "11" )
	{
		openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear + 1 , '0' , '1' , thisDraggable, thisClosable );
	}
	else
	{
		theMonth = ( theMonth + 1 ).toString(10);
		openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear, theMonth, '1' , thisDraggable, thisClosable );
	}
}

function goPreviousMonth( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, thisMonth, thisYear, thisDraggable, thisClosable )
{
	theMonth = parseInt( thisMonth , 10 );
	theYear = parseInt( thisYear , 10 );
	
	if ( theMonth == 0 )
	{
		openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear - 1, '11', '1' , thisDraggable, thisClosable );
	}
	else
	{
		theMonth = ( theMonth - 1 ).toString(10);
		openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear, theMonth, '1' , thisDraggable, thisClosable );
	}
}

function goNextYear( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, thisMonth, thisYear, thisDraggable, thisClosable )
{
	theYear = parseInt( thisYear , 10 );
	openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear + 1 , '0' , '1' , thisDraggable, thisClosable );
}

function goPreviousYear( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, thisMonth, thisYear, thisDraggable, thisClosable )
{
	theYear = parseInt( thisYear , 10 );
	openDatepicker( thisDatepicker, thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, theYear - 1, '0', '1' , thisDraggable, thisClosable );
}

//	Fonction de fermeture du datepicker lorsque l'on clique en dehors de celui-ci
var datepickerMouseover = false;
function hideDatepickers()
{
	var allDatepickers = document.getElementsByTagName("div");
	
	var attrib = "";
	
	for ( var i = 0; i < allDatepickers.length; i++ )
	{
		attrib = allDatepickers[i].getAttribute("oxydatepicker");
		if ( attrib && datepickerMouseover == false )
		{
			//	On se sert de la propriété << oxydatepicker >> du calque
			allDatepickers[i].style.display = 'none';
		}
	}
}
// Fonction de formatage la date sélectionnée
function selectDate( thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode, date, month, year )
{
	//	Mise au format du mois
	month = month - 1;
	
	//	Conversion en chaînes
	date = addZero( date ).toString(10);
	month = addZero( month ).toString(10);
	year = year.toString(10);
	
	//	Ecriture de la date dans le champs hidden ( date )
	$( thisDatepickerHidden ).value = year + month + date;
	//	Ecriture de la date dans le champs littéral
	displayDate( thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode );
}

//	Formatage
function addZero( theNumber )
{
	if ( theNumber < 10 ) { theNumber = "0" + theNumber; }
	return theNumber;
}

//	Affichage de la date dans le champs
function displayDate( thisDatepickerDisplay, thisDatepickerHidden, thisDatepickerMode )
{
	if(typeof displayDateCallBack == 'function')
	{ 
		displayDateCallBack(); 
	}
	
	
	var theDatepickerHidden = $( thisDatepickerHidden );
	var theDatepickerHiddenValue = theDatepickerHidden.value;
	
	if ( theDatepickerHidden.value != "" )
	{
		date = theDatepickerHiddenValue.substr(6,2);
		month = theDatepickerHiddenValue.substr(4,2);
		year = theDatepickerHiddenValue.substr(0,4);
		
		var dateToFind = new Date( year, month, date );
		var currentDayName = dateToFind.getDay();	
		
		theDatepickerMode = $( thisDatepickerMode ).value;
		
		var dayName = "";
		switch( currentDayName )
		{
			case 1 : dayName = common_010_text[lg]; break;			//	lundi
			case 2 : dayName = common_011_text[lg]; break;
			case 3 : dayName = common_012_text[lg]; break;
			case 4 : dayName = common_013_text[lg]; break;
			case 5 : dayName = common_014_text[lg]; break;
			case 6 : dayName = common_015_text[lg]; break;
			case 0 : dayName = common_016_text[lg]; break;			//	dimanche
		}
		
		var monthName = "";
		switch( month )
		{
			case "00" : monthName = common_017_text[lg]; break;		//	janvier
			case "01" : monthName = common_018_text[lg]; break;
			case "02" : monthName = common_019_text[lg]; break;
			case "03" : monthName = common_020_text[lg]; break;
			case "04" : monthName = common_021_text[lg]; break;
			case "05" : monthName = common_022_text[lg]; break;
			case "06" : monthName = common_023_text[lg]; break;
			case "07" : monthName = common_024_text[lg]; break;
			case "08" : monthName = common_025_text[lg]; break;
			case "09" : monthName = common_026_text[lg]; break;
			case "10" : monthName = common_027_text[lg]; break;
			case "11" : monthName = common_028_text[lg]; break;		//	décembre
		}
		
		var theContainer = $( thisDatepickerDisplay );
		
		date = parseInt( date , 10 );
		
		var theSuffix = "";
		switch( lg )
		{
			case "EN" :
						switch( date )
						{
							case 1 : theSuffix = "st"; break;
							case 2 : theSuffix = "nd"; break;
							case 3 : theSuffix = "rd"; break;
						}
						switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + year + " " + monthName + " " + date + theSuffix; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
						
			case "ES" : switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + date + " " + monthName + " " + year; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
			
			case "FR" :
						switch( date )
						{
							case 1 : theSuffix = "er"; break;
						}
						switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
						
			case "DE" : switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + date + " " + monthName + " " + year; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
			
			case "IT" : switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + date + " " + monthName + " " + year; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
			
			case "PT" : switch( theDatepickerMode )
						{
							case "day" : theContainer.innerHTML = dayName + " " + date + " " + monthName + " " + year; break;
							case "week" : theContainer.innerHTML = common_107_text[lg] + " " + dayName + " " + date + theSuffix + " " + monthName + " " + year; break;
							case "month" : theContainer.innerHTML = monthName + " " + year; break;
							case "year" : theContainer.innerHTML = year; break;
						}
			break;
		}
		//var callBack = theContainer.getAttribute('callback');
		//if ( callBack ) eval(callBack);
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////	OXYDATEPICKER	////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////












