function frmFeedbackSubmit(formFeedback) {
  var msg = "";
  if (formFeedback.name.value.length == 0) {
    msg += 'Please enter your name.\n';
  }
  if (formFeedback.email.value.length == 0) {
    msg += 'Please enter your email address.\n';
  }
  else {
    var p1 = formFeedback.email.value.indexOf('@');
    if ((p1 <= 0) || (p1 >= formFeedback.email.value.length - 1)) {
      msg += 'Please check the format of your email address.\n';
    }
  }
  if (formFeedback.question.value.length == 0) {
    msg += 'Please enter a comment.\n';
  }
  if (msg.length > 0) {
    alert (msg);
    return false;
   }
  else {
    return true;
  }
}

function frmJoinSubmit(formJoin) {
  var msg = "";
  if (formJoin.txtFirstName.value.length == 0) {
    msg += 'Please enter your first name.\n';
  }
  if (formJoin.txtLastName.value.length == 0) {
    msg += 'Please enter your last name.\n';
  }
  if (formJoin.txtEmail.value.length == 0) {
    msg += 'Please enter your email address.\n';
  }
  else {
    var p1 = formJoin.txtEmail.value.indexOf('@');
    if ((p1 <= 0) || (p1 >= formJoin.txtEmail.value.length - 1)) {
      msg += 'Please check the format of your email address.\n';
    }
  }
  if (msg.length > 0) {
    alert (msg);
    return false;
   }
  else {
    return true;
  }
}

function sourceChange() {
  if (diplayedSourceSubItem) {
    diplayedSourceSubItem.style.display = "none";
    diplayedSourceSubItem = null;
  }
  var sel = selSource.selectedIndex;
  if (sel == 1) {
    itemSourceReferral.style.display = "list-item";
    diplayedSourceSubItem = itemSourceReferral;
    sourceSubChange(selSourceReferral);
  }
  else if (sel == 2) {
    itemSourcePrint.style.display = "list-item";
    diplayedSourceSubItem = itemSourcePrint;
    sourceSubChange(selSourcePrint);
  }
  else if (sel == 3) {
    itemSourceOnline.style.display = "list-item";
    diplayedSourceSubItem = itemSourceOnline;
    sourceSubChange(selSourceOnline);
  }
  else if (sel == 4) {
    itemSourceConference.style.display = "list-item";
    diplayedSourceSubItem = itemSourceConference;
    sourceSubChange(selSourceConference);
  }
  else if (sel == 7) {
    itemSourceOther.style.display = "list-item";
  }
  else {
    itemSourceOther.style.display = "none";
  }
}

function sourceSubChange(selSourceSub) {
  var x1 = selSourceSub.options[selSourceSub.selectedIndex].value;
  if ((x1 == "999") || (x1 == "101")) {
    itemSourceOther.style.display = "list-item";
  }
  else {
    itemSourceOther.style.display = "none";
  }
}


