<!--

// Scheduler.js v1.0 by Dominik Switzerlander
// E-mail : info@webxpertise.ch
// Created : July 23, 2002
// Revisions : 
// Copyright 2002 Dominik Switzerlander
// =======================================================================================
// With this script you can time the appearance of texts on your website. 
// When a page containing this script is loaded, it checks if an important date
// has passed and displays the corresponding text.

// To use this script save it as *.js
// Paste the following code to your web page
// <script language="JavaScript" src="js/scheduler.js"></script>
// <noscript>---Please aktivate javascript to see all elements---</noscript>

// Date list
// New entries need to be inserted in the correct order.
// Numbers in [brackets] need to be adjusted to ensure the array works.
// The number xx in "new Array (xx)" needs to be equal to the number of entries in the array.
// An entry consists of a date and text. Enter the date exactly in the format as below
// ("dd.mm.yyyy texttext") and don't forget the trailing ";" sign.

	var important_date = new Array (3);
	important_date[0] = "16.01.2011 Tour starts on 26 Nov in D-Gütersloh. In Switzerland on 24 Dec in Zurich";
	important_date[1] = "01.12.2011 Tour is ongoing in Germany. In Switzerland on 24 Dec in Zurich";
	important_date[2] = "27.12.2011 for 2012 are being planned. Please check again here.";

	
	// the script runs through all entries
	var firsttext = "Next events<br>";
	var eventtext = "";
	for (var n = 0; n < important_date.length; n++) {
    eventtext = important_date[n];
	date = eventtext.substring(0,2);
	month = eventtext.substring(3,5);
	year = eventtext.substring(6,10);

	var eventdate=new Date(year,month-1,date);
	var today = new Date();

	// Checking if a date entry is newer than today.
	// If yes, the previous date entry is being displayed.
		if (eventdate > new Date()) {
		eventtext = important_date[n-1];
		text = eventtext.substring(11,eventtext.length);
		document.write(firsttext + text);
		break; 
		}
		else if (eventdate < new Date()) {
		void(0);
		}
	}

 //-->
