var ControlToSet;
var theForm = document.theForm;
var CalWidth= "180";
var StartYear = "1990";
var EndYear = "2030";
var FormatAs = "mm/dd/yyyy";

var NN4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
var NN6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var TOP;
var LEFT;

if(NN4)document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = LogPosition;

function LogPosition(evt){

    if (NN4||NN6){
    LEFT=evt.screenX;
    TOP=evt.screenY-10;
    }
    else{
    LEFT=event.screenX;
    TOP=event.screenY-10;
    }

}

function ShowCalendar(CONTROL, location, Format){
	ControlToSet = eval(CONTROL);

	if(Format){	//if they specify a format
		FormatAs = format.toLowerCase();
	}
		
	var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
	var CalWindow = window.open(location + 'HTMLCalendar.htm', "Calendar", strFeatures)
	CalWindow.focus();
	
} //End Function

function SetDate(DATE){
	if(ControlToSet){
		ControlToSet.value = DATE; 
	}
	ControlToSet = null;
	StartYear = "1990";
	EndYear = "2030";
	FormatAs = "mm/dd/yyyy";
}



