function next(from, to, chars) {
 if (from.value.length == chars)
   document.getElementById(to).focus()
}

function tred(id) {
 document.getElementById(id).style.color = 'red';
}

function isIE() {
 return ((navigator.appName).indexOf("Microsoft")!=-1)
}

function showother(SelID, OtherID) {
 if (document.getElementById(SelID).value == 'Other')
  document.getElementById(OtherID).style.display = isIE() ? 'inline' : 'table-row'
 else
  document.getElementById(OtherID).style.display = 'none'
}

function validate(form) {
 error = 0;
 errortext = '';

 if (form.name.value == '') {
  error = 1;
  errortext += 'You did not enter your name.\n';
  tred('name_l');
 }
 if (form.address1.value == '') {
  error = 1;
  errortext += 'You did not enter your adress.\n';
  tred('address1_l');
 }
 if (form.zip.value == '') {
  error = 1;
  errortext += 'You did not enter your zip code.\n';
  tred('zip_l');
 }
 if (form.phone.value == '') {
  error = 1;
  errortext += 'You did not enter your phone number.\n';
  tred('phone_l');
 }
 if (form.email_from.value == '') {
  error = 1;
  errortext += 'You did not enter your email.\n';
  tred('email_l');
 }
 if (form.subject.value == '') {
  error = 1;
  errortext += 'You did not select a subject.\n';
  tred('subject_l');
 } 
 if ((form.subject.value == 'Other') && (form.subjectother.value == '')) {
  error = 1;
  errortext += 'You did not enter a subject.\n';
  tred('subjectother_l');
 }
 if (form.hear.value == '') {
  error = 1;
  errortext += 'You did not specify where you heard about us.\n';
  tred('hear_l');
 } 
 if ((form.hear.value == 'Other') && (form.hearother.value == '')) {
  error = 1;
  errortext += 'You did not enter a where you heard about us.\n';
  tred('hearother_l');
 }
 if (error) {
  alert(errortext);
  return false;
 }
 else return true;
}