/******************************************************************************
Operation sur les dates
	
DateDDfrench retourne le nom du jour de la smeaine.
DateMMfrench retourne le nom du mois.
AddDay ajoute ou retranche un nombre de jour a un objet date

*******************************************************************************/
function DateToStr (MyDate , format )
{
	iMonth = new Number (MyDate.getMonth() +1 ) ;
	ToDayStr = MyDate.getFullYear() ;
	ToDayStr = ToDayStr + '-' + iMonth ;
	ToDayStr =  ToDayStr + '-' + MyDate.getDate() ;
	return ToDayStr ;
}


function	AddDay(MyDate, Day)
{
	laDate  = new Date(MyDate.getFullYear(),MyDate.getMonth(),MyDate.getDate()+Day);
	return	laDate;
}
/*
function AddDay( MyDate , Day )
{
	YYYY = MyDate.getFullYear() ;
	MM = MyDate.getMonth() + 1 ; 
	DD = MyDate.getDate() ;
	buffer = Date.parse(YYYY + '/' + MM + '/' + DD) ;

	//alert("Avant : " + buffer);
	laDate	= new Date(MyDate.getFullYear(),MyDate.getMonth(),MyDate.getDate()+Day);
	alert(laDate);
	buffer = buffer + 60*60*24*1000*(Day) ;
	//alert("Après : " + buffer);
	MyNewDate = new Date(buffer);
	return MyNewDate ;
}
*/
function DateDDfrench( MyDate, shortname)
{
	var MyDay = '';
	FrenchDay = new Array();

	FrenchDay[0] = 'Dimanche' ;		
	FrenchDay[1] = 'Lundi' ;		
	FrenchDay[2] = 'Mardi' ;		
	FrenchDay[3] = 'Mercredi' ;		
	FrenchDay[4] = 'Jeudi' ;		
	FrenchDay[5] = 'Vendredi' ;		
	FrenchDay[6] = 'Samedi' ;

	MyDay = FrenchDay[MyDate.getDay()] ;

	if ( shortname > 0 )
		MyDay = MyDay.substr(0,shortname ) ;
	
	return MyDay ;
}

function DateMMfrench( MyDate, shortname)
{
	var MyMonth = '';
	FrenchMonth = new Array();

	FrenchMonth[0] = 'Janvier' ;		
	FrenchMonth[1] = 'Février' ;		
	FrenchMonth[2] = 'Mars' ;		
	FrenchMonth[3] = 'Avril' ;		
	FrenchMonth[4] = 'Mai' ;		
	FrenchMonth[5] = 'Juin' ;		
	FrenchMonth[6] = 'Juillet' ;		
	FrenchMonth[7] = 'Août' ;		
	FrenchMonth[8] = 'Septembre' ;		
	FrenchMonth[9] = 'Octobre' ;		
	FrenchMonth[10] = 'Novembre' ;		
	FrenchMonth[11] = 'Décembre' ;	
	
	MyMonth = FrenchMonth[MyDate.getMonth()];

	if ( shortname > 0 )
		MyMonth = MyMonth.substr(0,shortname );
	
	return MyMonth ;
}

