function isEmail(s)
{
 
    document.emailform.server.value = location.hostname;
     
    if (typeof s != "string") {
	     return false;
    }

    // there must be >= 1 character before @, so we
    // start looking at character position 1
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;
 
    //don't even bother if string is less than 4 chars ("a@b.c".length=5)
    if (!sLength > 4){
	return false;
	}

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    {
	i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
 
    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) 
        return false;
    else 
    	  return true;
} 
function checkem(adr)
{
	
	if (! isEmail(adr)) {
		alert("Invalid email address");
		return false;
	}
	return true;
}