//
// hier wird das Datum Berechnet
// 



var timerID = null
var timerRunning = false
function MakeArray(size) 
{
    this.length = size;
    for(var i = 1; i <= size; i++)
	{
		this[i] = "";
    }
    return this;
}

function stopclock ()
{
    if(timerRunning)
    clearTimeout(timerID);
    timerRunning = false
}

function showtime () 
{
    var now = new Date();
//    var year = now.getYear();
    var year = now.getFullYear();  // getFullYear() schnallt auch der Firefox laut einer Aussage bei selfhtml
//	alert("Jahr: " + year);

    var month = now.getMonth() + 1;
    var date = now.getDate();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var day = now.getDay();
    Day = new MakeArray(7);
    Day[0]="Sontag";
    Day[1]="Montag";
    Day[2]="Dienstag";
    Day[3]="Mittwoch";
    Day[4]="Donnerstag";
    Day[5]="Freitag";
    Day[6]="Samstag";
    var timeValue = "";
    timeValue += (Day[day]) + "   ";
    // DE-Version TT/MM/JJ
    timeValue += date + "-";
    timeValue += ((month < 10) ? "0" : "") + month + "-";
// das ist fusch, aber der FireFox schnallt das nicht anders!! Zeigt bei 2006 immer 106 an!!
//    timeValue += 2008 + "    ";
	
    timeValue += year + "    ";
    
          //  timeValue += ((month > 10) ? " 0" : " ") + month + "-"; (US-Version MM/TT/JJ)
          //  timeValue += date + "-" + year + "    "; (US-Version MM/TT/JJ)
    timeValue += ((hours <= 12) ? hours : hours - 12);
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    timeValue += (hours < 12) ? " AM" : " PM";
    document.datum.face.value = timeValue;
//    document.face.value = timeValue;
    timerID = setTimeout("showtime()",2000);
    timerRunning = true
}

function startclock () 
{
//	alert("Aufruf der Funtion startclock")
    stopclock();
    showtime()
}



