function String.prototype.Trim(){return  this.replace(/(^\s*)|(\s*$)/g, "");}
function checkData()
{
	
	this.Null=function(obj)
	{
		if (obj.value.Trim()=='')
		{
			obj.focus();
			throw new Error(1,'不能输入空值');
		}
	}
	
	this.IsNull=function(objValue)
	{
		return objValue.Trim()==''?true:false;
	}
	this.IntNotNull=function(obj)
	{
		this.Null(obj);
		if (isNaN(obj.value*1)){
		obj.focus();
		throw new Error(2,'输入值必须是整形');
		
		}
	
	}
	//输入整数
	this.Int=function(obj)
	{
		
		o=/^(-|\+)?\d+$/.test(obj.value);
		
		if (!this.IsInt(obj)){
		obj.focus();
		throw new Error(2,'输入值必须是整形');
		}
		
	}
	this.IsInt=function(obj)
	{
		return /^(-|\+)?\d+$/.test(obj.value);
	}

}
function Valid()
{
	//是否为空
	this.IsNull=function(objValue)
	{
		return objValue.Trim()==''?true:false;
	}
	//是否是整数
	this.IsInt=function(objValue)
	{
		return /^(-|\+)?\d+$/.test(objValue);
	}
	//是否大于0的整数
	this.IsAboveZeroInt=function(objValue)
	{
		return /^\d+$/.test(objValue);
	}
	//是否大于0的整数
	this.IsDownZeroInt=function(objValue)
	{
		return /^-\d+$/.test(objValue);
	}

}
//EMAIL的判定
function IsMail(mail)
{
    return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail));
}
//手机验证
function IsMoveTel(elem)
{
	return(new RegExp(/^0{0,1}13[0-9]{9}$/).test(elem));
}


