var le_cal;
var la_date;
var le_champ;
function initCal() 
{
 today = new Date();
 var thisMonth = today.getMonth();
 var thisDay = today.getDate();
 var thisYear = today.getFullYear(); 
 YAHOO.widget.Calendar_Core.IMG_ROOT = 'Images/Icone/';
 le_cal = new YAHOO.widget.Calendar2up("le_cal","calContainer",(thisMonth+1)+"/"+thisYear,(thisMonth+1)+"/"+thisDay+"/"+thisYear);
 le_cal.title = "Sélectionnez une date :";
 le_cal.setChildFunction("onSelect",setDate);
 le_cal.render();
}
function showCal(formDate,link) 
{
 var pos = YAHOO.util.Dom.getXY(link);
 document.getElementById("calContainer").style.display = 'block';
 YAHOO.util.Dom.setXY(document.getElementById("calContainer"),[pos[0],pos[1]+link.offsetHeight+1]);
 le_champ = formDate;
}
function setDate() 
{
 la_date = le_cal.selectedDates[0];
 jj = la_date[2];
 mm = la_date[1];
 aa = la_date[0];
 strDate = '';
 if ( jj < 10 )
 {
  strDate = strDate + '0';
 }
 strDate = strDate + jj + "-";
 if ( mm < 10 )
 {
  strDate = strDate + '0';
 }
 strDate = strDate + mm + "-";
 strDate = strDate + aa;
 le_champ.value = strDate; 
 document.getElementById("calContainer").style.display = 'none';
}
