<!--
/* Copyright (c) 1998 Mecklermedia Corp. To receive the right to license
* this code to use on your site the original code must be copied from
* Webreference.com. License is granted if and only if this entire copyright
* notice is included, and you link from the page on which the code is used
* to Webreference at http://webreference.com for the latest version.
* By Andy King. v1.56 980126
*/
<!-- START EMAIL CODE -->
function e(s) {
rex=true;
if (window.RegExp) {
st="a";ex=new RegExp(st);
if (st.match(ex)) {
r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
r2=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
b=(!r1.test(s)&&r2.test(s));
} else {
rex=false;
}
} else {
rex=false;
}
if(!rex) b=(s.indexOf("@")>0&&s.indexOf(".")>0&&s!=""&&s!="enter e-mail");
return (b);
}
function f(h) {
h.focus();h.select();
}
function val(fld) {
s=fld.value;
if(e(s)) {
if(confirm("You entered:  "+s+"  Is this correct?"))
return true;
else {
f(fld);return false;
}
} else {
alert("Please include a proper e-mail address, of the form id@domain.xxx or id@domain.xx.xxx.");
f(fld);return false;
}
}
<!-- END CODE -->
//-->
