//åˆ¤æ–æ˜¯å¦æ˜¯ç©º
function isEmpty(pObj,errMsg){
var obj = eval(pObj);
if( obj == null || Trim(obj.value) == ""){
 if (errMsg == null || errMsg =="")
  alert("输入为空!");
 else
  alert(errMsg);
 obj.focus();
 return false;
}
return true;
}
//åˆ¤æ–æ˜¯å¦æ˜¯æ•°å?br />function isNumber(pObj,errMsg){
var obj = eval(pObj);
strRef = "1234567890";
if(!isEmpty(pObj,errMsg))return false;
for (i=0;i<obj.value.length;i++) {
 tempChar= obj.value.substring(i,i+1);
 if (strRef.indexOf(tempChar,0)==-1) {
  if (errMsg == null || errMsg =="")
   alert("æ•°æ®ä¸ç¬¦åˆè¦æ±?è¯äh£€æŸ?);
  else
   alert(errMsg);
  if(obj.type=="text")
   obj.focus();
  return false;
 }
}
return true;
}
//åˆ¤æ–æ˜¯å¦æ˜¯æ•°å?æ•°å—å¯ä»¥ä¸ø™´Ÿæ•?br />function isNegative(pObj,errMsg){
var obj = eval(pObj);
strRef = "1234567890-";
if(!isEmpty(pObj,errMsg))return false;
for (i=0;i<obj.value.length;i++) {
 tempChar= obj.value.substring(i,i+1);
 if (strRef.indexOf(tempChar,0)==-1) {
  if (errMsg == null || errMsg =="")
   alert("æ•°æ®ä¸ç¬¦åˆè¦æ±?è¯äh£€æŸ?);
  else
   alert(errMsg);
  if(obj.type=="text")
   obj.focus();
  return false;
 }else{
  if(i>0){
   if(obj.value.substring(i,i+1)=="-"){
    if (errMsg == null || errMsg =="")
     alert("æ•°æ®ä¸ç¬¦åˆè¦æ±?è¯äh£€æŸ?);
    else
     alert(errMsg); Â
    if(obj.type=="text")
    obj.focus();
    return false;
   }
  }
 }
}
return true;
}
//åˆ¤æ–æ˜¯å¦æ˜¯é’±çš„åÅžå¼?br />function isMoney(pObj,errMsg){
 var obj = eval(pObj);
 strRef = "1234567890.";
 if(!isEmpty(pObj,errMsg)) return false;
   for (i=0;i<obj.value.length;i++) {
    tempChar= obj.value.substring(i,i+1);
    if (strRef.indexOf(tempChar,0)==-1) {
     if (errMsg == null || errMsg =="")
   alert("æ•°æ®ä¸ç¬¦åˆè¦æ±?è¯äh£€æŸ?);
     else
   alert(errMsg); Â
   if(obj.type=="text")
   obj.focus();
   return false;
   }
   else{
   tempLen=obj.value.indexOf(".");
   if(tempLen!=-1){
     strLen=obj.value.substring(tempLen+1,obj.value.length);
     if(strLen.length>2){
       if (errMsg == null || errMsg =="")
       alert("æ•°æ®ä¸ç¬¦åˆè¦æ±?è¯äh£€æŸ?);
       else
       alert(errMsg); Â
       if(obj.type=="text")
         obj.focus();
         return false;
      }
     }
    }
 }
 return true;
}
function isLeapYear(year)
{
if((year%4==0&&year%100!=0)||(year%400==0))
{
return true;
}Â
return false;
}
//åˆ¤æ–æ—‰™—´æ˜¯å¦æ£ç¡®
function isDate(checktext){
var datetime;
var year,month,day;
var gone,gtwo;
if(Trim(checktext.value)!=""){
datetime=Trim(checktext.value);
if(datetime.length==10){
 year=datetime.substring(0,4);
 if(isNaN(year)==true){
  alert("误‚¾“入日æœ?æ ¼å¼ä¸?yyyy-mm-dd) \nä¾?2001-01-01)åQ?);
  checktext.focus();
  return false;
 }
 gone=datetime.substring(4,5);
 month=datetime.substring(5,7);
 if(isNaN(month)==true){
  alert("误‚¾“入日æœ?æ ¼å¼ä¸?yyyy-mm-dd) \nä¾?2001-01-01)åQ?);
  checktext.focus();
  return false;
 }
 gtwo=datetime.substring(7,8);
 day=datetime.substring(8,10);
 if(isNaN(day)==true){
  alert("误‚¾“入日æœ?æ ¼å¼ä¸?yyyy-mm-dd) \nä¾?2001-01-01)åQ?);
  checktext.focus();
  return false;
 }
 if((gone=="-")&&(gtwo=="-")){
  if(month<1||month>12) {
   alert("月䆾必须�1�2之间!");
   checktext.focus();
   return false;
   }
  if(day<1||day>31){
   alert("日期必须�1�1之间!");
   checktext.focus();
   return false;
  }else{
   if(month==2){Â
    if(isLeapYear(year)&&day>29){
      alert("二月份日期必™åÕdœ¨01åˆ?9之间!");
      checktext.focus();
      return false;
    }     Â
    if(!isLeapYear(year)&&day>28){
      alert("二月份日期必™åÕdœ¨01åˆ?8之间!");
      checktext.focus();
      return false;
    }
   }
   if((month==4||month==6||month==9||month==11)&&(day>30)){
    alert("在四åQŒå…åQŒä¹åQŒå一月䆾 \n日期必须åœ?1åˆ?0之间!");
    checktext.focus();
    return false;
   }
  }
 }else{
  alert("误‚¾“入日æœ?æ ¼å¼ä¸?yyyy-mm-dd) \nä¾?2001-01-01)");
  checktext.focus();
  return false;
 }
}else{
 alert("误‚¾“入日æœ?æ ¼å¼ä¸?yyyy-mm-dd) \nä¾?2001-01-01)");
 checktext.focus();
 return false;
}
}else{
return true;
}
return true;
}
//åˆ¤æ–æ˜¯å¦æœˆä†¾æ£ç¡®
function isYearMonth(checktext){
 var datetime;
 var year,month,day;
 var gone,gtwo;
 if(Trim(checktext.value)!=""){
   datetime=Trim(checktext.value);
   if(datetime.length==7){
   year=datetime.substring(0,4);
   if(isNaN(year)==true){
    alert("输入错误!æ ¼å¼ä¸?yyyy-mm) \nä¾?2001-01)åQ?);
    checktext.focus();
    return false;
   }
   gone=datetime.substring(4,5);
   month=datetime.substring(5,7);
   if(isNaN(month)==true){
    alert("输入错误!æ ¼å¼ä¸?yyyy-mm) \nä¾?2001-01)åQ?);
    checktext.focus();
    return false;
   }
   if((gone=="-")){
     if(month<1||month>12) {
      alert("月䆾必须�1�2之间!");
      checktext.focus();
      return false;
      }
   }
   else{
     alert("输入错误!æ ¼å¼ä¸?yyyy-mm) \nä¾?2001-01)åQ?);
     checktext.focus();
     return false; Â
   }
  }
   else{
     alert("输入错误!æ ¼å¼ä¸?yyyy-mm) \nä¾?2001-01)åQ?);
     checktext.focus();
     return false;
   }
}
 return true;
}
function fucCheckNUM(NUM) {
 if (NUM.length!=11)
  return false;
   Â
 var i,j,strTemp;
 strTemp="0123456789";
 if ( NUM.length== 0)
  return false;
 if ( NUM.length== undefined||NUM==undefined)
  return false;
 for (i=0;i<NUM.length;i++)
 {
  j=strTemp.indexOf(NUM.charAt(i));
  if (j==-1)
  {
  //说明有嗽W¦ä¸æ˜¯æ•°å?br />  return false;
  }
 }
 //说明是数å?br /> return true;
}
Â
function click () {
 //alert ('ä¸è®¸åïLœ‹åQç¦æ¢ä‹Éç”¨é¼ æ ‡å³é”?');
 window.event.returnValue=false;
}