function numOnly(){
	if(document.getElementsByTagName){
		var inpts = document.getElementsByTagName("input");
		for(var i=0; i<inpts.length; i++){
			if(inpts[i].className.indexOf("numonly") > -1){
				inpts[i].style.textAlign = "right";
				inpts[i].onfocus = function(){
					var re = /[^0-9\.]/g;
					this.value = this.value.replace(re,"");
					this.select();
				}
				inpts[i].onkeyup = inpts[i].onblur = function(){
					var re = /[^0-9\.]/g;
					this.value = this.value.replace(re,"");
				}
			}
		}
	}
}

function intOnly(){
	if(document.getElementsByTagName){
		var inpts = document.getElementsByTagName("input");
		for(var i=0; i<inpts.length; i++){
			if(inpts[i].className.indexOf("intonly") > -1){
				inpts[i].style.textAlign = "right";
				inpts[i].onfocus = function(){
					var re = /[^0-9]/g;
					this.value = this.value.replace(re,"");
					this.select();
				}
				inpts[i].onkeyup = inpts[i].onblur = function(){
					var re = /[^0-9]/g;
					this.value = this.value.replace(re,"");
				}
			}
		}
	}
}

numOnly();
intOnly();
