function strChinese(str){
 var pattern = /[^\u4E00-\u9FA5]/; 
 return !pattern.test(str);
}
function isPhoneValied(phone){
 for(i=0;i<phone.length;i++){
  tmpc=phone.charAt(i);
  if(tmpc>='0'&&tmpc<='9'){
  }else if(tmpc=='-'||tmpc=='#'||tmpc=='*'){
  }else{
   return false;
  }
 }
 return true;
}
function isRnameValied(realname){
 for(i=0;i<realname.length;i++){
  tmpc=realname.charAt(i);
  if(tmpc>='a'&&tmpc<='z'){
  }else if(tmpc>='A'&&tmpc<='Z'){
  }else if(strChinese(tmpc)){
  }else{
   return false;
  }
 }
 return true;
}
function isEmailValidate(emails){
 for(i=0;i<emails.length;i++){
  tmpc=emails.charAt(i);
  if(tmpc>='a'&&tmpc<='z'){ 
  }else if(tmpc>='A'&&tmpc<='Z'){
  }else if(tmpc>='0'&&tmpc<='9'){
  }else if(tmpc=='@'||tmpc=='.'||tmpc=='_'){
  }else{
   return false;
  }
 }
 return true;
}
function isCodeValied(code){
 for(i=0;i<code.length;i++){
  tmpc=code.charAt(i);
  if(tmpc>='0'&&tmpc<='9'){
  }else{
   return false;
  }
 }
 return true;
}
function isLeapYear(year){
 if(((year%4==0)&&(year%100!=0))||(year%400==0)){
 }else{
  return false;
 }
 return true;
}
 
	posted on 2008-08-31 08:29 
长春语林科技 阅读(186) 
评论(0)  编辑  收藏  所属分类: 
js