// ==================================================================
// Author           : a.marti@cmfnet.ch
// 
// Date             : 10.03.2005
// 
// Version          : 1.000
// 
// =====================================================================
// Description      : JavaScript functions for date functions.
// 
// =====================================================================
// Remarks          : none
// 
// ===================================================================*/


// ------------------------------------------------------------
// Set date and time for clock
//
// ------------------------------------------------------------
function set_time (date_field, time_field) {
    var year;
    var month;
    var day;
    var hour;
    var minutes;
    var seconds;
    var date_now = new Date();

    year = date_now.getFullYear ();
    month = date_now.getMonth ()+1;
    day = date_now.getDate ();
    hour = date_now.getHours ();
    minutes = date_now.getMinutes ();
    seconds = date_now.getSeconds ();

    if (hour < 10) {
        hour = "0" + String(hour);
    }
    
    if (minutes < 10) {
        minutes = "0" + String(minutes);
    }
    
    if (seconds < 10) {
        seconds = "0" + String(seconds); }
        if (day < 10) {
        day = "0" + String(day);
    }
    
    if (month < 10) {
        month = "0" + String(month);
    }

    date_field.value=day + "."+month + "." + year;
    time_field.value = hour + ":" + minutes + ":" + seconds;
}

