var ie4 = document.all;
var ns4 = document.layers;
var x = 0;
var y = 0;

/*
Netscape doesn't track mouse position over form
buttons so keep running track at all times.
*/

function init() {
	if (ns4) { document.captureEvents(Event.MOUSEMOVE); }
	document.onmousemove = mouseMove;
}

function mouseMove(e) {
	if (ie4) {
		x = event.screenX
		y = event.screenY
	}
	if (ns4) {
		x = e.screenX;
		y = e.screenY;
	}
}

/*
Now we can take those coordinates and popup a mini
calendar in the right spot.  Clicking on a calendar
date updates the form element el with the selected
date.
*/

function calpopup(frm,el) {
	x = x + 15; y = y - 10;
	var date = eval("document." + frm + "." + el + ".value");
	var url = "cal_mini.asp?element=" + el + "&form=" + frm + "&date=" + date
	popWin=window.open(url,"calendar","height=140,width=140,scrollbars=no,titlebar=no,resizable,screenX="+x+",left="+x+",screenY="+y+",top="+y);
}