var r={
  'special':/[\W]/g,
  'quotes':/['\''&'\"']/g,
  'notnumbers':/[^\d]/g
}

function valid(o,w){
  o.value = o.value.replace(r[w],'');
}

function LimitChar(thisobj) {
	//var thisobj=event.srcElement;
	if (thisobj.value.length==thisobj.maxLength*1) return false;
}
function CountChar(thisobj,txtobj) {
	//var thisobj=event.srcElement;
	if (thisobj.value.length>thisobj.maxLength) 
		thisobj.value=thisobj.value.substring(0,thisobj.maxLength);
	if (txtobj) txtobj.value=500-thisobj.value.length;
}
