
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}
function clickload(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}

function validate() {
form = document.forms[0];

   if (form.Email.value.length < 1) { // can't be blank
    alert("Please include your email address.");
    form.Email.select();
    return false;
  }

  if (form.Email.value.indexOf ('@') < 1) { // must have an "@" sign after at least one char
    alert("Invalid email address.");
    form.Email.select();
    return false;
  }

  if (form.Email.value.lastIndexOf ('.',255) < (form.Email.value.indexOf ('@') + 2)) { // must have a "." after at least one char past the "@"
    alert("Invalid email address.");
    form.Email.select();
    return false;
  }

  if (form.Email.value.lastIndexOf ('.') > (form.Email.value.length - 3)) { // must have at last 2 chars after the last "."
    alert("Invalid email address.");
    form.Email.select();
    return false;
  }
    
if (form.Division.value == 'none') {
    alert("Please include your division.");
    return false;
     }

  if (form.ReportingTeam.value.length < 1) {
    alert("Please include your team name.");
    form.ReportingTeam.select();
    return false;
  }

  if (form.RunsFor.value.length < 1) {
    alert("Please include the number of runs you scored.");
    form.RunsFor.select();
    return false;
  }

   if (form.Opponent.value.length < 1) {
    alert("Please include your opponents team name.");
    form.Opponent.select();
    return false;
  }

  if (form.RunsAgainst.value.length < 1) {
    alert("Please include the number of runs your opponent scored.");
    form.RunsAgainst.select();
    return false;
  }
  
if (form.Highlights.value == 'Include 4-6 player highlights each game and make sure to include different players each week.') {
          alert("Please include your game highlights.");
          return false;
     }

//  if (!(form.timeSlot[0].checked || form.timeSlot[1].checked)) {
//    alert("Please choose a webcast date.");
//    return false;
//  }


return true;
}
