<!-- Hide from old browsers
function checkForm() {

// the variables below are assigned to each form input
  var gname, gemail, gurl, gmessage;

  with(window.document.guestform) {
    gname    = txtName;
    gemail   = txtEmail;
    gweb     = txtWeb;
    gmessage = mtxMessage;
  }

// Filter out sites

rExp = /xoomer.alice.it/gi;
myString = gmessage.value+gname.value+gweb.value+gemail.value
results = myString.search(rExp)
if(results != -1) 
{
  return false;
}

// if name is empty alert the visitor
  if (trim(gname.value) == '...' | trim(gname.value) == '..' | trim(gname.value) == '.')
  {
    alert('Invalid Entry');
    gname.focus();
    return false;
  }
  if(trim(gname.value) == '')
  {
    alert('Please enter your name');
    gname.focus();
    return false;
  }
// if message is empty alert the visitor
   else if(trim(gmessage.value) == '')
   {
      alert('Please enter a message');
      gmessage.focus();
      return false;
   }
// check for "funny characters"
   else if(validated(gmessage.value+gname.value+gweb.value+gemail.value) == 1)
   {
      gmessage.focus();
      return false;
   }

   else
   {
     return true;
   }
}

// Strip whitespace from the beginning and end of a string
function trim(str)
{
   return str.replace(/^\s+|\s+$/g,'');
}


// Strip out "unwanted" characters
function validated(string)
{
    var okdoka=0
    for (var i=0, output='', valid=' 123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,:/@"*?()!-'+"'"; i<string.length; i++)
    {
       if (valid.indexOf(string.charAt(i)) != -1) {
          output += string.charAt(i)
       }
       else {
         alert("Please remove any "+string.charAt(i)+"'s that you have entered");
         i=string.length;
         okdoka=1;
       }
    }
    return okdoka;
}// -- End Hiding Here -->
