var oCurrentElement;  // A variable to put the text input field object into while the calendar opens.

// This function grabs the input element object and puts it into the oCurrentElement object
// It then opens a window with the calendar.
// IN:	Text input object
// OUT:	None
function getTheDate(e,x,y,f,t,s){
	oCurrentElement = e;
	var frm;
	var to;
	if(f){frm=f}else{frm='1900'}
	if(t){to=t}else{to='2050'}
	if(s){sel=s}else{sel='1974'}
	var bIsOpen = true;
	winPtr = window.open('/inc/calendar_window.asp?f=' + frm + '&t=' + to + '&s=' + sel ,'Calendar','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=' + y + ',left=' + x + ',width=280,height=170,alwaysRaised=yes,titlebar=no,z-lock=yes');
	winPtr.focus();
}

// This function is called by the calendar window/dialog
// It it formats the date and repopulates the the text box.	
// IN:	Date
// OUT:	Formatted string of a date
function grabValue(val){
	var iDay = val.getDate()
	var iMonth = val.getMonth()
	var iYear = val.getFullYear()
	var arrMonthNames = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	oCurrentElement.value = iDay + " " + arrMonthNames[iMonth] + " " + iYear;
}


