function forms_valida(form)
{
	var f=document.forms[form];
	var quant=f.elements.length;
	for(var i=0;i<quant;i++)
	{
		var ele = document.forms[form].elements[i];
		if(ele.getAttribute("vazio")=='false')
		{


if(ele.value=='')
{
var nome=ele.getAttribute('name');
var mais=nome.toUpperCase();			
alert("-O campo "+ mais +" não pode ficar vazio.");
			ele.focus();
			event.returnValue=false;
			break;
			}
if(ele.getAttribute("name")=='email')
{		{
if((ele.value.indexOf('@')==-1)||(ele.value.indexOf('.')==-1))
{
nome=ele.getAttribute('name');
mais=nome.toUpperCase();			
alert("-O "+ mais +" Precisa ser preenchido corretamente.");
			ele.focus();
			event.returnValue=false;
			break;

}
}
}
else 
{

}
}

}
}

function pular_campo()
{
if(window.event.srcElement.type=='text')
{
	var ele=window.event.srcElement;
	var index=ele.sourceIndex;
	if(window.event.keyCode==13)
		{
		document.all.item(index+2).focus();
		}
}
}

function automatico_troca()
{
if(event.srcElement=='text')
{
var ele=event.keyCode;
var index=ele.sourceIndex;
if(ele.value==ele.getAttribute('maxlength'))
{
document.all.item(index+1).focus();
}
}
}

function resetar()
{
	var ele=window.confirm("- Continuar!");
	if(ele)
	{
		document.form1.reset();
		}else
		{
			document.form1.nome.focus();
			}
	}
	
	
	