function ShowDtPicker(txt, img, showSetEmpty, triggerCkModif)
{
    var x = findPosX(img)-105;
    var y = findPosY(img)+18;
    
    var dt = txt.SelectedDates.DateArray[0];
    
    MainCalendar.SetSelectedDate(dt);
    MainCalendar.SetVisibleDate(dt);

    activeTxt = txt;
    
    var _imgCalUp = document.getElementById("imgCalUp");
    var _imgCalDown = document.getElementById("imgCalDown");
    var _imgCalEmpty = document.getElementById("imgCalEmpty");
    var _imgCalClose = document.getElementById("imgCalClose");
    
    _imgCalUp.src = root+"Images/NAV_UP_BLUE.gif";
    _imgCalDown.src = root+"Images/NAV_DOWN_BLUE.gif";
    _imgCalEmpty.src = root+"Images/no_file2.gif";
    _imgCalClose.src = root+"Images/CANCL_gray.gif";

    
    _imgCalEmpty.style.display = (showSetEmpty?"inline-block":"none");
    
    MainCalendar.__triggerCkModif = triggerCkModif;
    MainCalendar.Show(x,y);
    
    

}

function YearDw()
{
    var v = MainCalendar.VisibleDate;
    var newVisibleDate = new Date(v.getFullYear()-1, v.getMonth(), 1);
    MainCalendar.SetVisibleDate(newVisibleDate);
}
function YearUp()
{
    var v = MainCalendar.VisibleDate;
    var newVisibleDate = new Date(v.getFullYear()+1, v.getMonth(), 1);
    MainCalendar.SetVisibleDate(newVisibleDate);
}
function SetEmptyCal()
{
    activeTxt.ClearSelectedDate();
    MainCalendar.Hide();
} 
function onCalendarChange(calendar)
{
    if(MainCalendar.__triggerCkModif)
        __ckModif();
        
    activeTxt.SetSelectedDate(calendar.GetSelectedDate());
    MainCalendar.Hide();
}
function closeDtPicker(){MainCalendar.Hide();}


