
    
    function clock()
    {
        var now = new Date();
        var day_of_week = getDayOfWeek( now ) + ', ';
        var day = now.getDate();
        var month = getMonth( now );
        var year = now.getYear();
        if ( year < 1900 )
        {
            year = 1900 + year;
        }
        var hours = now.getHours();
        if ( hours < 10 )
        {
            hours = '0' + hours;
        }
        var minutes = now.getMinutes();
        if ( minutes < 10 )
        {
            minutes = '0' + minutes;
        }
        var seconds = now.getSeconds();
        if ( seconds < 10 )
        {
            seconds = '0' + seconds;
        }

        var timestamp = day_of_week + day + '. ' + month + ' ' + year + '  ' + hours + ':' + minutes + ':' + seconds;
        document.frmClock.txtClock.value = timestamp;
        window.setTimeout( 'clock()', 100 );
}

    /**
     * Returns the day of week as a string.
     * @param date the date
     * @return the day of the week f.e. Montag
     */
    function getDayOfWeek( date )
    {
        var day_of_week = date.getDay();
        if ( day_of_week == 0 )
        {
            day_of_week = 'Sonntag';
        }
        else if ( day_of_week == 1 )
        {
            day_of_week = 'Montag';
        }
        else if ( day_of_week == 2 )
        {
            day_of_week = 'Dienstag';
        }
        else if ( day_of_week == 3 )
        {
            day_of_week = 'Mittwoch';
        }
        else if ( day_of_week == 4 )
        {
            day_of_week = 'Donnerstag';
        }
        else if ( day_of_week == 5 )
        {
            day_of_week = 'Freitag';
        }
        else if ( day_of_week == 6 )
        {
            day_of_week = 'Samstag';
        }

        return day_of_week;
    }

    /**
     * Returns the month as a string.
     * @param date the date
     * @return the month f.e. Januar
     */
    function getMonth( date )
    {
        var month = date.getMonth();

        if ( month == 0 )
        {
            month = 'Jan.';
        }
        else if ( month == 1 )
        {
            month = 'Feb.';
        }
        else if ( month == 2 )
        {
            month = 'März';
        }
        else if ( month == 3 )
        {
            month = 'April';
        }
        else if ( month == 4 )
        {
            month = 'Mai';
        }
        else if ( month == 5 )
        {
            month = 'Juni';
        }
        else if ( month == 6 )
        {
            month = 'Juli';
        }
        else if ( month == 7 )
        {
            month = 'August';
        }
        else if ( month == 8 )
        {
            month = 'Sept.';
        }
        else if ( month == 9 )
        {
            month = 'Okt.';
        }
        else if ( month == 10 )
        {
            month = 'Nov.';
        }
        else if ( month == 11 )
        {
            month = 'Dez.';
        }

        return month;
    }

