function E_mail(strEmail)
{
var checkok="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
var checkstr=strEmail;
var allvalid=true;
for (i=0;i<checkstr.length;i++)
{
ch=checkstr.charAt(i);
for (j=0;j<checkok.length;j++)
if (ch==checkok.charAt(j))
break;
if (j==checkok.length)
{
allvalid=false;
break;
}
}
if(checkstr.length>0){
if((checkstr.indexOf("@")==-1)||(checkstr.indexOf("@")==0)||(checkstr.charAt(checkstr.length-1)=="@"))
allvalid=false;
if((checkstr.indexOf(".")==-1)||(checkstr.indexOf(".")==0)||(checkstr.charAt(checkstr.length-1)=="."))
allvalid=false;
}
if (allvalid==false)
return (false);
}
function check()
{
if (document.form.title.value==""){
alert("标题不能为空!");
document.form.title.focus();
return false;
}
if (E_mail(document.form.email.value)==false){
alert("E_mail格式不正确!");
document.form.email.focus();
return false;
}
if (document.form.email.value==""){
alert("E-MAIL不能为空!");
document.form.email.focus();
return false;
}
}
//-->
</script>