<!-- // form validation for tell-a-friend form
function validate() {
  var output = '';
  
  if(document.form1.send_to1.value.length == 0){
    output += 'Please enter your friend\'s name 1\n';
  }
  if(document.form1.send_from.value.length == 0){
    output += 'Please specify your name\n';
  }
  
  var regexp = /[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}/;
  if(!document.form1.send_from_email.value.match(regexp)) {
    output += 'Your email address is not valid\n';
  } 
  
  for(var i=1;i<6;i++) {
    eval('if (document.form1.send_to' + i
       + '.value.length != 0 || document.form1.send_to_email'
       + i + '.value.length !=0) {if (document.form1.send_to'
       + i + '.value.length == 0) { output += "Please enter your friend\'s name " + i + "\\n";} if (!document.form1.send_to_email'
       + i + '.value.match(regexp)) { output += "Please enter a valid email address " + i + "\\n";}}');
  }
  
  if(output){
    alert(output);
    return false;
  }
  
  return true;
} 
//-->
