

//获得当前系统日期
function getcurDate()
{
        var now = new Date();
		var s="";
		s += now.getYear() + "-"; 
		if ((now.getMonth()+1)<10)
		{
			s+="0"+(now.getMonth()+ 1) + "-";
		}else{
		s += (now.getMonth()+ 1) + "-";
		}
		if (now.getDate()<10){
			s += "0"+(now.getDate());
		}else{
			s += now.getDate();
		}
		return(s);	
}    


       

//该函数用于数字型校验，返回值：非数字型返回0，整型返回1，浮点型返回2
function testNum(strNum)
{
    if(isNaN(strNum)){
		return (0);	
	}else{
		isInt=true;
		for (i=0;i<strNum.length;i++)			 
	  	{
	  		a=strNum.charAt(i)
	  		if(a==".")
        	{
        	  isInt=false;
        	  break;
        	}
        }
        if (isInt==true){
			return (1);
        }else{
			return (2);
		}
	}
}


function strIsNull(str1){

var strTemp1,strTemp2;

	strTemp1=new String(str1);
	
	if ((strTemp1=="")||(strTemp1==null))
	{	return true;
	}
		
	strTemp2=new String();
	for (t=0;t<strTemp1.length;t++){
		strTemp2=strTemp2 + " ";
	}
	if (strTemp1==strTemp2 )
		return true;
	else
		return false;
}


//检查email地址的格式是否正确
function mailaddrChk(mailStr)
{
    
    if (mailStr.indexOf("@")<=0) {
	alert("Please input incorrect email address!");      	
      	return("fail");
    } else if (mailStr.lastIndexOf("@")==(mailStr.length-1)) {
	alert("Please input incorrect email address!");      	
      	return("fail");
    } else if (mailStr.indexOf(".")<=0) {
	alert("Please input incorrect email address!");      	
      	return("fail");
    } else if (mailStr.lastIndexOf(".")==(mailStr.length-1)) {
	alert("Please input incorrect email address!");      	
      	return("fail");
    } else if(checkChinese(mailStr)==1){
   alert("Please input incorrect email address!"); 
    	   return("fail");
    } else {
        return("succeed");
    }    
} 

function judgeTel(tmpStr)
{
  	if(tmpStr.indexOf('-')==0) {
 		return false;
   } else if(tmpStr.lastIndexOf('-')==tmpStr.length-1) {
 		return false;
   }
   for (var i = 0;i < tmpStr.length;i++)
   {
     var ch = tmpStr.substring(i,i+1);
     if ((ch >= "0"&&ch<="9")||ch=="-"||ch==" "||ch=="("||ch==")") {
  
     } else {
        return false;
     }
   }
} 

   
//重置按钮
function resetdefine(obj){
	obj.reset();   
}
