Yanzheng = {
	curElem:null,	//当前元素对象
	
	//定义属性
	email:"/\\w+@\\w+\\.[a-zA-Z]*/",
	url:"/^http:\\/\\/.*/i",
	date:"/^\\d{4}-\\d{2}-\\d{2}$/",
	
	//结束
	require:function(){
		if(this.curElem.getAttribute('require') && this.curElem.value==''){
			return 1;
		}
	},
	
	show:function(txt){
		alert(this.curElem.getAttribute(txt));
		return false;
	},
	
	zhengze:function(){
		if(this.curElem.getAttribute('zhengze')){
			if(this.curElem.getAttribute('zhengze') in this){	//如果能找到已经定义好属性，则调用
				this.curElem.getAttribute('zhengze') = this[this.curElem.getAttribute('zhengze')];
			}
			if(!this.curElem.value.match(eval(this.curElem.getAttribute('zhengze')))){
				return 1;
			}
		}
	},
	
	limit:function(){
		if(this.curElem.value.length<this.curElem.mind){
			alert('数据值的长度不能小于' + this.curElem.mind);
			return false;
		}
		if(this.curElem.value.length>this.curElem.maxd){
			alert('数据值的长度不能大于' + this.curElem.maxd);
			return false;
		}
		return true;
	},
	
	confirmd:function(){
		var to = T.$(eval("this.curElem['toID']"));
		if(this.curElem.value!=to.value){
			return this.show('confirmtxt');
		}
		return true;
	},
	
	manzu:function(){
		if(this.curElem.value.length<this.curElem.getAttribute('manzu')){
			//alert('你必须要输入为' + this.curElem.getAttribute('manzu') + '位字符！');
			
			show_tishi_info('','你必须要输入为' + this.curElem.getAttribute('manzu') + '位字符!');
			
			return false;
			
		}
		return true;
	},
	
	yanzheng:function(elem,disabled){
		for(var t=0;t<elem.length;t++){
			//单文本框
			if(elem[t].type=="text" && !elem[t].getAttribute('parentemel')){		//必须输入
				this.curElem = elem[t];
				if(this.require()){
					return this.show('require');
				}
				
				if(this.zhengze()){
					
					return this.show('zhengzetxt');	
				}
				
				
				
				if(this.curElem.getAttribute('datatype')){
					
					if(!this[this.curElem.getAttribute('datatype')]()){
						return false;
					};
				}
				
			}
			
			//textarea
			if(elem[t].tagName=='TEXTAREA'){
				this.curElem = elem[t];
			
				if(this.require()){
					return this.show('require');
				}
				
				if(this.curElem.getAttribute('datatype')){
					
					if(!this[this.curElem.getAttribute('datatype')]()){
						return false;
					};
				}
				
			}
			
			//password
			//单文本框
			if(elem[t].type=="password"){		//必须输入
				this.curElem = elem[t];
				
				
				if(this.require()){
					return this.show('require');
				}
				
				if(this.zhengze()){
					return this.show('zhengzetxt');	
				}
				
				if(this.curElem.datatype){
					if(!this[this.curElem.datatype]()){
						return false;
					};
				}
				
			}
			
			
			//radio
			if(elem[t].type=="radio" && elem[t].checked){
				var	duiyi = _$(elem[t].value);
				if(duiyi.hasChildNodes()){
					for(var d=0,len = duiyi.childNodes.length;d<len;d++){
						if(duiyi.childNodes[d].tagName!="INPUT")
							continue;
						
						this.curElem = duiyi.childNodes[d];
						
						if(this.require()){
							
							return this.show('require');
						}
						
						/*
						if(this.zhengze()){
						
							return this.show('zhengzetxt');	
						}*/
					}	
				}
			}
			
			//
						
		}
		
		//完成验证
		if(disabled == 'disabled'){	//锁定提交按钮，防止进一步提交
			elem[0].form.submit.disabled = true;
		}
		return true;

		
	}
	//验证结束
	
	
	
}
