function isCheckEmail(text)
{
  // there must be >= 1 character before @, so we
  // start looking at character position 1
  // (i.e. second character)
           
  var i = 1;
  var TextLength = text.length;
 
  // look for @
  while ((i < TextLength) && (text.charAt(i) != "@"))
  {
    i++
  }

  if ((i >= TextLength) || (text.charAt(i) != "@"))
  {
    return false;
  }	
  else 
  {
    i += 2;
  }
 
  // look for .
  while ((i < TextLength) && (text.charAt(i) != "."))
  {
    i++
  }
 
  // there must be at least one character after the .
  if ((i >= TextLength - 1) || (text.charAt(i) != ".")) 
  {
    return false;
  }	
  else
  {
    return true;
  }	
}

function email_validate_regex(email)
{
    var match = /^\w+(\w|\.|-)*\w@(\w+(\w|-)\.)+\w{2,5}$/.test(email);
    if(match)
    {
        return true;
    }    
    return false;
}