function prepareFormForUpload() {
  // Set the Date Taken field
  var year = $F('date_year');
  var month = $F('date_month');
  var day = $F('date_day');
  $('photo_date').value = new Date(year, month-1, day);
  
  // Prepare the destination fields
  var form_values = "?title=" + $F('photo_title') + "&description=" + $F('photo_description') + "&date=" + year + "-" + month + "-" + day;
  var error_base = $F('error_dest');
  $('error_dest').value = error_base + form_values;
}