 //***构建判断是否为空的函数
function MyIsNULL (str)
{
return (str==""||str=="undefined")?true:false;
}
//***构建判断是否为邮件地址的函数
function MyIsEmail(str)
{
if(str.length<=6) return false;
return ((str.indexOf('@')!=-1)&&(str.indexOf('.')!=-1))?true:false;
}
//***构建判断是否是数字的函数
function MyIsNaN(int)
{
return (isNaN(int))?false:true;
}
//***构建判断是否是正确时间的函数
function MyIsDate(year,month,day)
{
if ((year==0)&&(month==0)&&(day==0))
return true;
else if((year==0)||(month==0)||(day==0))
{alert("请将生日填写完整！");return false;}
else
{
if((year%4!=0)&&(day==29)&&(month==2))
{alert(year+"年不是闰年！");return false;}
else if((year%4!=0)&&(day>29)&&(month==2))
{alert(year+"年的2月没有那么多天！");return false;}
else if((year%4==0)&&(day>29)&&(month==2))
{alert(year+"闰年的2月也没有那么多天！");return false;}
else if (((month==4)||(month==6)||(month==9)||(month==11))&&(day>30))
{alert(month+"月只有30天！");return false;}
}
return true;
}
//**构建验证两回输入密码是否一致的函数
function ComparePassword(pwd1,pwd2)
{
if(pwd1 != pwd2)
{
alert("两次输入的密码不同");
return false;
}
else return true;
}
//***构造检查有没禁止的词出现
function MyEstopString(str,EstopStr)
{
if(str.indexOf(EstopStr)==-1)
return false;
else return true;
}
//***检查输入数据长度
function CheckLen(str,len)
{
var n=str.length;
var tlen=0;
for(i=0;i<n;i++)
{if(str.charCodeAt(i)>255) tlen+=2;else tlen++;}
if(len>tlen)
return true;
else 
{
alert("您输入的字符数是："+tlen+"请保持在"+len+"个字符内！");
return false;
}
}