

function updateFormDate(id, date)
{
	// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
	var y = date.getFullYear();
	var m = date.getMonth()+1;     // integer, 0..11
	var d = date.getDate();      // integer, 1..31
	// redirect...
	//window.location = "/" + y + "/" + m + "/" + d + "/index.php";
	if (m < 10) { m = "0"+""+m; }
	if (d < 10) { d = "0"+""+d; }	
	$(id).value = y+""+m+""+d+'00';
}

/*
Event.observe(window, 'load', function() {
			function startDateChanged(calendar) {
				// Beware that this function is called even if the end-user only
				// changed the month/year.  In order to determine if a date was
				// clicked you can use the dateClicked property of the calendar:
				if (calendar.dateClicked) {
					updateFormDate('start_date', calendar.date);
				}
			};
			function endDateChanged(calendar) {
				// Beware that this function is called even if the end-user only
				// changed the month/year.  In order to determine if a date was
				// clicked you can use the dateClicked property of the calendar:
				if (calendar.dateClicked) {
					// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
					var y = calendar.date.getFullYear();
					var m = calendar.date.getMonth()+1;     // integer, 0..11
					var d = calendar.date.getDate();      // integer, 1..31
					// redirect...
///					window.location = "/" + y + "/" + m + "/" + d + "/index.php";
					if (m < 10) { m = "0"+""+m; }
					if (d < 10) { d = "0"+""+d; }
					$('end_date').value = y+""+m+""+d+'00';					
				}
			};			
			Calendar.setup({
				flat         : "cal_start_date", // ID of the parent element
				flatCallback : startDateChanged           // our callback function
			});
			Calendar.setup({
				flat         : "cal_end_date", // ID of the parent element
				flatCallback : endDateChanged           // our callback function
			});
		});
		
		hideCalendars = function() {
			$('calendars').hide();
		};
		showCalendars = function() {
			$('calendars').show();
		};
		*/
		checkCompare = function(target) {
			if (target.checked) {
				$('bldg2').show();
			} else {
				$('bldg2').hide();
			}
		}
		
		
		
		