function CalendarPopUp(adDate, asPageName, asField) {
/*  USE: Displays a calendar that the user can select a date from.  You also need PopupCalendar.asp and clsCalendar.asp
 *   IN: adDate = the date currently entered if any
 *       asPageName = the page that is calling this function
 *       asField = name of the field that will receive the date
 *  OUT: Nothing
 *  USE THE FOLLOWING TO ENACT THE POPUP CALENDAR
 *  INSTRUCTIONS:
	*  LINK CODE GOES DIRECTLY IN THE <BODY> OF YOUR WEB DOCUMENT
	*  PLACE TEXT LINK IMMEDIATELY FOLLOWING THE FORM FIELD
	*  REPLACE "YOUR FORM NAME" WITH THE NAME OF YOUR FORM WITHOUT THE [] BRACKETS
	*  REPLACE "YOUR FORM FIELD" WITH THE NAME OF YOUR FORM FIELD NAME WITHOUT THE [] BRACKETS
	*  REPLACE "YOUR FILE NAME" WITH THE NAME OF YOUR AND FILE WITHOUT THE [] BRACKETS
 *  CODE SNIPPET:
 *  <a href="javascript:CalendarPopUp([YOUR FORM NAME].[YOUR FORM FIELD].value,%20'[YOUR FILE NAME]',%20'[YOUR FORM NAME].[YOUR FORM FIELD]');">Choose Date</a>
 *  EXAMPLE:
 *  <form action="MyDNREventsFormProcess.asp" method="post" name="frmAdd">
 *    <label for="txtEDate">Event End Date</label> <input id="txtEDate" title="Use the calendar button to enter the event end date." type="text" name="txtEDate" size="20" maxlength="20"> * &nbsp; <a href="javascript:CalendarPopUp(frmAdd.txtEDate.value,%20'dnrEventsInputForm.asp',%20'frmAdd.txtEDate');">Choose Date</a>
 */
	var x, y;
	x = y = 0;
			
	var CalPop = window.open("/org/land/er/forms/scripts/PopupCalendar.asp?dt=" + adDate + "&refpg=" + asPageName + "&fld=" + asField, "cal", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width=300,height=380,resizable=yes");
	if (parseInt(navigator.appVersion) >=3) 
		CalPop.focus();
	
	//Determine where to display the help window so that its centered.
	x = (screen.availWidth / 2) - (300 / 2);
	y = (screen.availHeight / 2) - (380 / 2);
	
	//use x and y to move the helpWin to the center of the screen.
	CalPop.moveTo(x, y);
}

