﻿function validateKeyword(controlName)
{
    var control = document.all ? document.all[controlName] : document.getElementById(controlName);
    var value = control.value;
    
    if(value == "" || value.length < 3 )
    {
        alert("You must enter a valid keyword (minimum of 3 characters). Please try again.");
        return false;
    }
    return true;
}

// Put in control ->  onblur="return validateEmail(this);"
function validateEmail(control ) {
  if( control.value == "" )
    return (true);
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(control.value)){
   return (true)
  } else {
    control.focus();
    alert("Invalid Email, correct format juanperez@yahoo.com") 
   return (false);
  }
 }