/* Požádat o kalendář */
function RequestCalendar(year, month) {
    StartXHR();
    xmlHttp.onreadystatechange = ViewCalendar;
    url = window.location+"";   /* přetypování na string :-) */
    server = url.substr(0,url.lastIndexOf('/')+1);
    xmlHttp.open("GET", server+calendarUrl+"?year="+year+"&month="+month, true);
    xmlHttp.send(null);

    return false;
}

/* Zobrazit kalendář */
function ViewCalendar() {
    calendar = document.getElementById("box_content_calendar");
    if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
        calendar.innerHTML = xmlHttp.responseText;
    /* TODO: načítám... */
}

/* Požádat o den */
function RequestDay(year, month, day) {
    StartXHR();
    xmlHttp.onreadystatechange = ViewDay;
    url = window.location+"";   /* přetypování na string :-) */
    server = url.substr(0,url.lastIndexOf('/')+1);
    xmlHttp.open("GET", server+calendarUrl+"?year="+year+"&month="+month+"&day="+day, true);
    xmlHttp.send(null);

    return false;
}

/* Zobrazit den */
function ViewDay() {
    activities = document.getElementById("box_content_calendar_activities");
    if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
        activities.innerHTML = xmlHttp.responseText;
    /* TODO: načítám... */
}

/* Přesunout se na daný den v kalendáři */
function GoToDay(year, month, day) {
    StartXHR();
    xmlHttp.onreadystatechange = ViewCalendar;
    url = window.location+"";   /* přetypování na string :-) */
    server = url.substr(0,url.lastIndexOf('/')+1);
    xmlHttp.open("GET", server+calendarUrl+"?year="+year+"&month="+month+"&day="+day+"&all=on", true);
    xmlHttp.send(null);

    return false;
}