/**
 * Zeit- und Datumanzeige
 */

var showDateTime = new Class({
    
    show_date_time: function()
    {
        var now = new Date();
        
        var day = now.getDate();
        var month = now.getMonth() + 1;
        var year = now.getYear();
        
        if (year < 2000)
            year = year + 1900;
        
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        
        var pre_day = (day < 10) ? '0' : '';
        var pre_month = (month < 10) ? '.0' : '.';
        var pre_hours = (hours < 10) ? '0' : '';
        var pre_minutes = (minutes < 10) ? ':0' : ':';
        var pre_seconds = (seconds < 10) ? ':0' : ':';
        
        var current_date = pre_day + day + pre_month + month + '.' + year;
        var current_time = pre_hours + hours + pre_minutes + minutes + pre_seconds + seconds;
        
        $('po_time').set('text', current_time);
        $('po_date').set('text', current_date);
    },
    
    initialize: function()
    {
        this.show_date_time.periodical(1000);
    }
    
});

window.addEvent('domready', function() {
    if ($('po_time'))
    {
        new showDateTime();
    }
});