// JavaScript Document
	function checkValue(str){			
		var notAllowStr="<,>,',`,^,&";		
		var rtn=true;
		var notAllowArr=new Array();
		notAllowArr=notAllowStr.split(",");
		for(var i=0;i<notAllowArr.length;i++){
			if(str.indexOf(notAllowArr[i])!=-1){
					rtn=false;
			}
		}
		return rtn;
	}
	
	function checkDate(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var dateReg=/^[0-9]{4,4}(-|\/)[0-9]{2,2}(-|\/)[0-9]{2,2}$/;		//建立日期正刚表达式
		
		return dateReg.test(str);
	}
	
	function checkIndCard(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var cardReg=/^(\d{8}(01|02|03|04|05|06|07|08|09|10|11|12)(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\d{3}|\d{6}(19|20)\d{2}(01|02|03|04|05|06|07|08|09|10|11|12)(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\d{3}(\d|X))$/;		//建立生份证的正则表达式
		return cardReg.test(str);
	}
	
	function checkZip(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var zipReg=/^[0-9]{6,6}$/;		
		return zipReg.test(str);
	}
	
	function checkEmail(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var emailReg=/^(\S)+[@]{1}(\S)+[.]{1}(\w)+$/;		
		//alert(regStr(dateReg,str));
		return emailReg.test(str);
	}
	function checkUrl(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var urlReg=/^[a-zA-z]+:\/\/(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$/;
		return urlReg.test(str);
	}
		function checkTel(str){
		if(checkValue(str)!=true){
			alert("请勿使用敏感字符!!!");
			return false;	
		}
		var telReg=/^[0-9|-]{6,12}$/;
		return telReg.test(str);
	}
	
	function killspace(str){
		while(str.length>0 && str.charAt(0)==" ")
			str=str.substring(1,str.length);
		while(str.length>0&&str.charAt(str.length-1)==" ")
			str=str.substring(0,str.length-1);
		return str;		
	}
	
		function checkTimes(str,char,times){
		var findTimes=0;
		for(var i=0;i<str.length;i++){
			if(str.charAt(i)==char){
				findTimes+=1
			}
		}
		if(findTimes>times){
			return false;
		}else{
			return true;
		}
	}
	

	function regInput(obj, reg, inputStr){
			var docSel	= document.selection.createRange()
			if (docSel.parentElement().tagName != "INPUT")	return false
			oSel = docSel.duplicate()
			oSel.text = ""
			var srcRange	= obj.createTextRange()
			oSel.setEndPoint("StartToStart", srcRange)
			var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
			return reg.test(str)
	}


