//achtung form[3] ist irgendwie blöde

function mousePress(cell_id){
    document.forms[3].eintragStart.value = cell_id;
}

function mouseRelease(cell_id){
    document.forms[3].eintragStop.value = cell_id;
    if( saveEntry( document.forms[3].eintragStart.value, cell_id ) ){
        document.forms[3].submit();
    }
}

function saveEntry(cell_id1, cell_id2){
    index = cell_id1.indexOf("_");
    day = cell_id1.substring(0, index);
    start = cell_id1.substring(index+1, 5);
    temp = start%2;
    if(temp == 1) start = ((start-1)/2)+":30";
    else start = start/2;
    stop = parseInt( cell_id2.substring(index+1, 5) )+1;
    temp = stop%2;
    if(temp == 1) stop = ((stop-1)/2)+":30";
    else stop = stop/2;
    check = confirm("Möchtest du am "+day+". von "+start+" Uhr bis "+stop+" Uhr reservieren?");
    return check;
}

function checkClearDB(){
    check = confirm("Willst du wirklich den gesamten Inhalt der Datenbank StkBelegung löschen?");
    if(check) {
        check = confirm("Bist du ganz sicher, daß alle gespeicherten Reservierungen gelöscht werden sollen?");
    }
    return check;
}


function deleteEntry(cell_id){
    check = confirm("Möchtest du diese Reservierung löschen?");
    if(check == true) {
        document.forms[3].loescheEintrag.value = cell_id;
        document.forms[3].submit();
    }
}

function makePublic(cell_id){
    check = confirm("Möchtest du anderen Mitgliedern die Möglichkeit geben mitzufahren?");
    if(check == true) {
        document.forms[3].gopublic.value = cell_id;
        document.forms[3].submit();
    }
}

function makeUnPublic(cell_id){
    check = confirm("Möchtest du diese Reservierung wieder als 'Privat' markieren?");
    if(check == true) {
        document.forms[3].gounpublic.value = cell_id;
        document.forms[3].submit();
    }
}

function sendHandEntry(){
    document.forms[1].handEntry.value = "true";
    document.forms[1].submit();
}

function sendHandDelete(){
    document.forms[2].handDelete.value = "true";
    document.forms[2].submit();
}




