function setHelp(txt) { help.innerText = txt ; }
Valida = function(pref){this.pref = pref}
Valida.prototype.campo = function(){this.name = arguments}
Valida.prototype.padrao = function(){this.pattern = arguments}
Valida.prototype.start = function(right, wrong)
{
	var i = this.name.length
	var pt
	var all_ok = []
	while(--i > -1)
	{
		pt = eval(this.pattern[i])
		if(!eval("pt.test(document.all." + this.name[i] + ".value)"))
		{
			eval("document.all." + this.pref + this.name[i] + ".style.color = wrong")
			all_ok[i] = false
		}
		else
		{
			eval("document.all." + this.pref + this.name[i] + ".style.color = right")
			all_ok[i] = true
		}
	}
	var send = true
	for(var i in all_ok)
	{
		if(!all_ok[i]){send = false; break}
		if(all_ok[i]){send = true}
	}
	if(send)
	{
		this.onComplete()
	}
	else if(!send)
	{
		this.onError()
	}
}