function DT_validateform() {
	var fv,rex,t,i,ru,eMsg=0,errors='',args=DT_validateform.arguments; 
	for (i=0; i<(args.length-4); i+=5){ 
		fv=args[i].value;  
		rex=new RegExp(args[i+1]); 
		ru=args[i+3]; 
		t=eval(ru+rex.test(fv)); 
		if(args[i+4]) {  
			if(fv.length<=0||!t){ 
				eMsg=eMsg+1; 
				errors=errors+'- '+unescape(args[i+2])+'\n'; }}
		else if(fv.length>0&&!t){ 
			eMsg=eMsg+1; 
			errors=errors+'- '+unescape(args[i+2])+'\n'; } 
	} 
	if(eMsg>0) {    
	alert('Please correct these entries ('+eMsg+')\n'+errors); 
	return (submitvalue = false) 
	}
	else { 
	return (submitvalue = true) 
	}
}		

function DT_validatefield(val,re,eMsg) {
var strPass = val.value; 
var rslt = re.test(strPass); 
if(!rslt) { 
	if(confirm('This entry is not valid.' +eMsg+ '\nWould you like to correct your entry?')) { 
	val.focus(); 
	val.select() 
	}
}	
}

function DT_checkonchange(val,re) {
var strPass = val.value; 
var objRegExp = new RegExp(re,"g"); 
val.value = strPass.replace(objRegExp,"") 
}


function DT_checkchar(val,re,ru) {
var strPass = val.value; 
var strLength = strPass.length; 
var lchar = val.value.charAt((strLength) - 1); 
if(ru == "1" && lchar.search(re) != -1) { 
	var tst = val.value.substring(0, (strLength) - 1); 
	val.value = tst; 
   }
else if (ru != "1" && lchar.search(re) == -1) { 
	var tst = val.value.substring(0, (strLength) - 1); 
	val.value = tst; 
   }
}

