function validate(theForm) {
  var startDateString = document.searchform.startdate.value;
  var endDateString = document.searchform.enddate.value;

  var startDate = new Date(Date.parse(startDateString.replace(/-/g,' ')))
  var endDate = new Date(Date.parse(endDateString.replace(/-/g,' ')))
  var today = new Date();
  today.setHours(0,0,0,0)
  if (startDate < today) {
    alert('Start date cannot be in the past');
    document.searchform.startdate.focus();
    return false;
  }
  if (endDate < today) {
    alert('End date cannot be in the past');
    document.searchform.enddate.focus();
    return false;
  }
  if (startDate > endDate) {
    alert('Start date cannot be greater than end date');
    document.searchform.startdate.focus();
    return false;
  }
  
  if (startDate == endDate) {
    alert('End date must be greater than start date');
    document.searchform.startdate.focus();
    return false;
  }
  
  return true
} 


function GetRegions() {		
		new Ajax.Updater('region_list','ajax/region_list.asp', {parameters: 'iso='+$F('country')});
}
