// ********** no following words script
var k = 29;
var isProfane = new makeArray(k);
var word = new makeArray(k);
function checkForProfanity(elnum) {
  var temp = document.forms[0].elements[elnum].value;
  temp = temp.toLowerCase();
  word[1] = "asshole";
  word[2] = "ass hole";
  word[3] = "bastard";
  word[4] = "bestiality";
  word[5] = "bisexual";
  word[6] = "bi-sexual";
  word[7] = "bitch";
  word[8] = "cunt";
  word[9] = "dickhead";
  word[10] = "dick head";
  word[11] = "dumbass";
  word[12] = "dumb ass";
  word[13] = "faggot";
  word[14] = "fags";
  word[15] = "fuck";
  word[16] = "homosexual";
  word[17] = "incest";
  word[18] = "lesbian";
  word[19] = "molest";
  word[20] = "penis";
  word[21] = "pervert";
  word[22] = "porno";
  word[23] = "pussy";
  word[24] = "shit";
  word[25] = "whore";

  word[26] = "abuse";
  word[27] = "root@";
  word[28] = ".gov";
  word[29] = "spam";

  for (var j = 1; j <= k; j++) {
    isProfane[j] = temp.indexOf(word[j]);
  }

  for (var j = 1; j <= k; j++) {
    if (isProfane[j] != -1) {
      alert("Please refrain from using the word, \'"+word[j]+"\',on this web site.  Thank you.");
      document.forms[0].elements[elnum].value = "";
      j = k + 1;
      document.forms[0].elements[elnum].focus();
    }
    else {
    }
  }
}

function makeArray(n) {
  this.length = n
  for (var i = 1; i<=n; i++) {
    this[i] = new String();
  }
  return this
}

// ********** tell a friend validator script
function tellafriend_validator(theForm) {

  // makes sure name not left blank
  if (theForm.name.value.length == 0) {
    alert("Please enter your name.");
    theForm.name.focus();
    return (false);
  }

  // makes sure email not left blank
  if (theForm.email.value.length == 0) {
    alert("Please enter your email address.");
    theForm.email.focus();
    return (false);
  }

  // makes sure email is valid with @ and .
  var checkEmail = "@.";
  var checkStr = theForm.email.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  for (i = 0;  i < checkStr.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkEmail.length;  j++) {
      if (ch == checkEmail.charAt(j) && ch == "@")
      EmailAt = true;
      if (ch == checkEmail.charAt(j) && ch == ".")
      EmailPeriod = true;
      if (EmailAt && EmailPeriod)
      break;
      if (j == checkEmail.length)
      break;
    }
    // if both the @ and . were in the string
    if (EmailAt && EmailPeriod) {
      EmailValid = true
      break;
    }
  }
  if (!EmailValid) {
    alert("Please enter a valid email address.");
    theForm.email.focus();
    return (false);
  }

  // makes sure friendsemail1 not left blank
  if (theForm.friendsemail1.value.length == 0) {
    alert("Please enter an email address for Friend 1.");
    theForm.friendsemail1.focus();
    return (false);
  }

  // makes sure friendsemail1 is valid with @ and .
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail1.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  for (i = 0;  i < checkStr.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkEmail.length;  j++) {
      if (ch == checkEmail.charAt(j) && ch == "@")
      EmailAt = true;
      if (ch == checkEmail.charAt(j) && ch == ".")
      EmailPeriod = true;
      if (EmailAt && EmailPeriod)
      break;
      if (j == checkEmail.length)
      break;
    }
    // if both the @ and . were in the string
    if (EmailAt && EmailPeriod) {
      EmailValid = true
      break;
    }
  }
  if (!EmailValid) {
    alert("Please enter a valid email address for Friend 1.");
    theForm.friendsemail1.focus();
    return (false);
  }

  // makes sure friendsemail2 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail2.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 2.");
      theForm.friendsemail2.focus();
      return (false);
    }

  }

  // makes sure friendsemail3 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail3.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 3.");
      theForm.friendsemail3.focus();
      return (false);
    }

  }

  // makes sure friendsemail4 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail4.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 4.");
      theForm.friendsemail4.focus();
      return (false);
    }

  }

  // makes sure friendsemail5 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail5.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 5.");
      theForm.friendsemail5.focus();
      return (false);
    }

  }

  // makes sure friendsemail6 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail6.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 6.");
      theForm.friendsemail6.focus();
      return (false);
    }

  }

  // makes sure friendsemail7 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail7.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 7.");
      theForm.friendsemail7.focus();
      return (false);
    }

  }

  // makes sure friendsemail8 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail8.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 8.");
      theForm.friendsemail8.focus();
      return (false);
    }

  }

  // makes sure friendsemail9 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail9.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 9.");
      theForm.friendsemail9.focus();
      return (false);
    }

  }

  // makes sure friendsemail10 is valid with @ and . if entered
  var checkEmail = "@.";
  var checkStr = theForm.friendsemail10.value;
  var EmailValid = false;
  var EmailAt = false;
  var EmailPeriod = false;
  if (theForm.friendsemail2.value != "") {
    for (i = 0;  i < checkStr.length;  i++) {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++) {
        if (ch == checkEmail.charAt(j) && ch == "@")
        EmailAt = true;
        if (ch == checkEmail.charAt(j) && ch == ".")
        EmailPeriod = true;
        if (EmailAt && EmailPeriod)
        break;
        if (j == checkEmail.length)
        break;
      }
      // if both the @ and . were in the string
      if (EmailAt && EmailPeriod) {
        EmailValid = true
        break;
      }
    }
    if (!EmailValid) {
      alert("Please enter a valid email address for Friend 10.");
      theForm.friendsemail10.focus();
      return (false);
    }

  }

}
