// check the component of length
function validaterLength(componentName,len,message){
	var comp=document.getElementsByName(componentName)[0];
	var _comp_value=comp.value;
	if(_comp_value.length>parseInt(len)){
		alert(message);
		comp.value="";
		comp.focus()
	}
}
function validatePasswordRule(obj){
	var pwd=obj.value;
	var patrn=/^[A-Za-z0-9]+$/;//only number and letters.
	if(!patrn.exec(pwd))return false;
	var arr=pwd.split(" ");
	if(arr.length>2){
		return false;
	}else{
		return true;
	}
}
