var isNav = navigator.appName.indexOf("Netscape") != -1;
var isIE = navigator.appName.indexOf("Microsoft") != -1;
function handler(e) {
    status = "unknown";
    var x = 0, y = 0;
    if (isNav) {
	x = e.x-document.moons.x;
	y = e.y-document.moons.y;
    }
    if (isIE) {
	e = window.event;
	x = e.pageX-document.moons.x;
	y = e.pageY-document.moons.y;
    }
    if (x < 0 || x >= document.moons.width || y < 0 || y >= document.moons.height) return true;
    var moonth = Math.floor((y-52)/23);
    var moonth_start = [573, 563, 571, 563, 557, 568, 562, 574,
		       584, 577, 586, 593, 584 ];
    var moonth_date = [
		       "20 Oct 1998", "19 Nov 1998", "18 Dec 1998",
		       "17 Jan 1999", "16 Feb 1999", "17 Mar 1999",
		       "16 Apr 1999", "15 May 1999", "13 Jun 1999",
		       "13 Jul 1999", "11 Aug 1999", "9 Sep 1999",
		       "9 Oct 1999" ];
    if (moonth < 0) {
	status = "before start of calendar";
    } else if (moonth > 12) {
	status = "after end of calendar";
    } else {
	var moonth_day = (moonth_start[moonth]-x)/17.1;
	var time = new Date(Date.parse(moonth_date[moonth]) + moonth_day * 24  * 60 * 60 * 1000);
	time = new Date(Date.UTC(time.getFullYear(), time.getMonth(),
				 time.getDate(), time.getHours(), time.getMinutes()));
	status = time.toUTCString();
    }
    return false;
}
function enableHandler() {
    status='Click to see date ...';
    window.captureEvents(Event.CLICK);
    return true;
}
function disableHandler() {
    status='';
    window.captureEvents(0);
    return true;
}
window.onclick = handler
