function vs() {
  currentFormPrefix = "";
  var ok = 1;

  if (ok && !FormRequired("firstname", "First Name")) ok = 0;
  if (ok && !FormRequired("lastname", "Last Name")) ok = 0;
  if (ok && !FormRequired("address", "Address")) ok = 0;
  if (ok && !FormRequired("city", "City")) ok = 0;
  if (ok && !FormRequired("state", "State")) ok = 0;
  if (ok && !FormRequired("zip", "Zip Code")) ok = 0;
  if (ok && !FormRequired("phone", "Phone Number")) ok = 0;
  if (ok && !FormEmailRequired("email", "Email Address")) ok = 0;
  if (ok && !FormSelectionRequired("location", "Location")) ok = 0;  
  if (ok && !FormSelectionRequired("trainingdate", "Training Date")) ok = 0;  


  if (ok) {
	var index = document.getElementById("trainingdate").selectedIndex;
	document.getElementById("date").value = document.getElementById("trainingdate").options[index].innerText;

	var eventIndex = document.getElementById("trainingdate").options[index].value;
	document.getElementById("starttime").value = eventsArr[eventIndex].starttime;
	document.getElementById("training_address").value = eventsArr[eventIndex].address;
	document.getElementById("training_city").value = eventsArr[eventIndex].city;
	document.getElementById("training_state").value = eventsArr[eventIndex].state;
	document.getElementById("training_zip").value = eventsArr[eventIndex].zip;
  }

  return ok;

}

function LoadEventDates() {
  var oSelect = document.getElementById("trainingdate");
  var locationIndex = document.getElementById("location").selectedIndex;
  var locationStr = document.getElementById("location").options(locationIndex).value;
  var i = 0;

  // Clear the Locations list
   var numDates = oSelect.options.length;
   for (i = numDates-1; i >= 0; i--)
     	oSelect.options[i] = null;

  var oOption = document.createElement("OPTION");
  oSelect.options.add(oOption);
  oOption.innerText = "<Select A Training Date>";
  oOption.value = "";

  var text;

  for (i = 0; i < numEvents; i++) {
	if (eventsArr[i].location == locationStr) {
		text = "";
		oOption = document.createElement("OPTION");
		oSelect.options.add(oOption);
		text += GetMMDDYY(eventsArr[i].startdate) + " - " + eventsArr[i].title;
		if (eventsArr[i].starttime != "" && eventsArr[i].starttime != null)
			text += " [" + eventsArr[i].starttime + "]"
		oOption.innerText = text;
		oOption.value = i;
	}
  }
}

function GetMMDDYY(dateString)
{
  // This function takes a date string of the format "mmm dd yyyy" and returns a date
  // string of the format "mm/dd/yy"
  var month_mmm = dateString.substr(0, 3);
  var day_dd = dateString.substr(4, 2);
  var year_yy = dateString.substr(9, 2);
  var month_mm;

  switch(month_mmm) {
	case "Jan":
		month_mm = "01";
		break;
	case "Feb":
		month_mm = "02";
		break;
	case "Mar":
		month_mm = "03";
		break;
	case "Apr":
		month_mm = "04";
		break;
	case "May":
		month_mm = "05";
		break;
	case "Jun":
		month_mm = "06";
		break;
	case "Jul":
		month_mm = "07";
		break;
	case "Aug":
		month_mm = "08";
		break;
	case "Sep":
		month_mm = "09";
		break;
	case "Oct":
		month_mm = "10";
		break;
	case "Nov":
		month_mm = "11";
		break;
	case "Dec":
		month_mm = "12";
		break;
  } // end switch

  return month_mm + "/" + day_dd + "/" + year_yy;
}