function LastChanged(){
var m = document.lastModified;
var p = m.length-8;
if (Date.parse(document.lastModified) != 0)
   document.writeln('<p>This page was changed last at ' + m.substring(p,0) + '</p>');
}
function LetzteAend(){
var m = document.lastModified;
t = new Date(); 
t.setTime(Date.parse(document.lastModified));
var p = m.length-8;
if (Date.parse(document.lastModified) != 0){
   y = t.getFullYear();
   if (y < 2000) y += 100;
   s = t.getDate() + '.' + (t.getMonth() + 1) + '.' + y;
   document.writeln('<p>Diese Seite wurde am ' + s + ' ge&auml;ndert</p>');
   }
}
function TimeStamp(){
Stamp = new Date();
year = Stamp.getYear();
if (year < 2000) year = 1900 + year;
document.writeln('<p>Page was called at: ');
document.writeln((Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+year);
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}	
document.writeln(Hours + ":" + Mins + Time + "</p>");
}
function ZeitStempel(){
Stamp = new Date();
year = Stamp.getYear();
if (year < 2000) year = 1900 + year;
document.writeln('<p>Die Seite wurde aufgerufen am: ');
document.writeln(Stamp.getDate() + ". " + (Stamp.getMonth() + 1) +". " + year);
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}	
document.write(" - " + Hours + ":" + Mins + "</p>");
}
function Hello(){
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if ((thehour > 22) || (thehour < 6)) display = "Night";
else if (thehour > 18) display = "Evening";
else if (thehour >12) display = "Afternoon";
else display = "Morning";
var greeting = ("<h2>Good " + display + "!</h2>");
document.writeln(greeting);
}
function Servus(){
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if ((thehour > 22) || (thehour < 6)) display = "<h2>Gute Nacht!</h2>";
else if (thehour > 18) display = "<h2>Guten Abend!</h2>";
else if (thehour >12) display = "<h2>Guten Nachmittag!</h2>";
else display = "<h2>Guten Morgen!</h2>";
document.writeln(display);
}
function ChristDays(){
today = new Date();             // Make a note of today's date
christmas = new Date();         // Get a date with the current year
christmas.setMonth(11);         // Set the Month to December
christmas.setDate(25);          // Set the Day to the 25th.

// If Christmas hasn't already passed, compute the number of 
// milliseconds between now and Christmas, then convert this to a
// number of days and print a message.
if (today.getTime() < christmas.getTime()) {
   difference = christmas.getTime() - today.getTime();
   difference = Math.floor(difference / (1000 * 60 * 60 * 24));
   document.writeln("Nur " + difference + " Tage bis Weihnachten!"); 
}
else {
   difference = today.getTime() - christmas.getTime();
   difference = Math.floor(difference / (1000 * 60 * 60 * 24));
   document.writeln('Weihnachten war vor ' + difference + ' Tagen!');
   }
}

function advent(tag) {
var d = new Date();
var day = d.getDate();
var month = d.getMonth();
url = "dez" + tag + ".htm";
if (month == 11 && tag <= day && day <= 31)
   location.href=url;
else
   location.href="dez0.htm";
}

