	function getDateFromCalendar(inputArray)
	{
		var references = calendarObjForForm.getHtmlElementReferences(); // Get back reference to form field.
		var value = inputArray.year + '-' + inputArray.month + '-' + inputArray.day;
		
		if (calendarObjForForm.displayTimeBar == true)
		{
			value += ' ' + inputArray.hour + ':' + inputArray.minute;
		}
		eval('references.' + inputName + '.value=\'' + value + '\';');
		calendarObjForForm.hide();	
	}	


	function pickDate(buttonObj,inputObject, objectName, format)
	{
		calendarObjForForm.setCalendarPositionByHTMLElement(inputObject,0,inputObject.offsetHeight+2);	// Position the calendar right below the form input
		calendarObjForForm.setInitialDateFromInput(inputObject,format);	// Specify that the calendar should set it's initial date from the value of the input field.
		calendarObjForForm.addHtmlElementReference(objectName,inputObject);	// Adding a reference to this element so that I can pick it up in the getDateFromCalendar below(myInput is a unique key)
		
		inputName = objectName;
		
		if(calendarObjForForm.isVisible()){
			calendarObjForForm.hide();
		}else{
			calendarObjForForm.resetViewDisplayedMonth();	// This line resets the view back to the inital display, i.e. it displays the inital month and not the month it displayed the last time it was open.
			calendarObjForForm.display();
		}		
	}	
	
