// JavaScript Document
function Confirmar(formulario){
	if( confirm("Deseja continuar?") ){
		return true
	}else{
		return false
		}
}

function Validar(formulario, confirma){
	for (i=0;i<formulario.elements.length;i++){
		if(formulario.elements[i].value == ""){
			formulario.elements[i].focus()
			return false
			break
		}
	} 
	if(confirma){
		return Confirmar(formulario)
	}
	SubmitOnce(formulario)
	return true;
}

function SubmitOnce(formulario){
	if (document.all||document.getElementById){
		for (i=0;i<formulario.length;i++){
			if(formulario.elements[i].type.toLowerCase()=="submit"){
				formulario.elements[i].disabled = "disabled";
			}else{
				formulario.elements[i].readonly = "readonly";
			}
		}
	}
}

/*
function submitonce(theform){

Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
http://www.dynamicdrive.com/dynamicindex11/submitonce.htm
<form method="POST" onSubmit="submitonce(this)">

//if IE 4+ or NS 6+
if (document.all||document.getElementById){
	//screen thru every element in the form, and hunt down "submit" and "reset"
	for (i=0;i<theform.length;i++){
		var tempobj=theform.elements[i]
		if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
		//disable em
		tempobj.disabled=true
		}
	}
}*/