/*
    contact2.js      2007-06-25  (c) e.sens.e GmbH
*/



function checkForm() {

  if (!validEmail(document.forms[0].email.value)) {
    
	alert("Insert a correct e-mail address, please!");
	return(false);
  }
    
}


function validEmail(email) {
    //TESTME regexp ok?
    //var user = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
    var user = "[a-zA-Z0-9][a-zA-Z0-9_.-]*";
    var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]+\\.[a-zA-Z]{2,}";
    var r = new RegExp("^" + user + "\@" + domain + "$");
    return r.exec(email);
}
