function validar_senha(){
	var verro="";
	var vsenha1="";
	vsenha1 = document.getElementById("rsenha").value;
	if (vsenha1 == ""){
		verro += "Preenchimento do campo senha obrigatório!";
		}
		else if ( document.getElementById("rsenha").value.length < 6	){
			verro += "Favor digitar um senha com o mínimo de 6 caracteres!"
			}
	
	if(verro !=""){
		alert(verro);
		//document.getElementById("rsenha").focus(); //Volta o focus para o campo.
		return false;
	 }
	} // Final validar().
	
function validar_senha_conf(){
	var verro="";
	var vsenha1="";
	var vsenha2="";
	vsenha1 = document.getElementById("rsenha").value;
	vsenha2 = document.getElementById("rsenhaconf").value;
	if (vsenha1 != ""){
		if (vsenha2 == ""){
			verro += "Preenchimento do campo confirmação de senha obrigatório!";
			} else {
				if (vsenha2 != vsenha1) {
					verro += "Senha não confere! \nFavor digitá-la novamente.";
					}
				}
		}
		 
	 if(verro !=""){
		alert(verro);
		//document.getElementById("rsenhaconf").focus();
		return false;
	 }
	} // Final validar_senha_conf().
	
function cep(){
	vcep = document.getElementById("rcepapres").value;
	if(vcep.length == 5){
	vcep += "-" ;}
	document.getElementById("rcepapres").value = vcep;
	}

function cep1(){
	vcep = document.getElementById("CEP").value;
	if(vcep.length == 5){
	vcep += "-" ;}
	document.getElementById("CEP").value = vcep;
	}
	
function telefone(vForm){
	vfone = document.getElementById(vForm).value;
	if(vfone.length == 0){
	vfone += "(" ;}
	else if(vfone.length == 3){
	vfone += ")" ;}
	else if(vfone.length == 8){
	vfone += "-" ;}
	document.getElementById(vForm).value = vfone;
	}
function data(vForm){
	vdata = document.getElementById(vForm).value;
	if(vdata.length == 2){
	vdata += "/" ;}
	document.getElementById(vForm).value = vdata;
	}

function hora(vForm){
	vhora = document.getElementById(vForm).value;
	if(vhora.length == 2){
	vhora += ":" ;}
	document.getElementById(vForm).value = vhora;
	}
	
function formCheck(formobj){
	var fieldRequired = Array("rtitulo","rsenha","rapresentador","rinstapres","remailapres1","rfoneapres","rendapres","rcidadeapres","restadoapres","rcepapres","rautores","rinstituicoes","rresumo");
	var fieldDescription = Array("Título","Senha","Apresentador","Instituição do Apresentador","E-mail do Apresentador","Telefone do Apresentador","Endereço","Cidade","Estado","CEP","Todos os Autores","Todas as Instituições","Resumo");
	var alertMsg = "Favor preencher os campos:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

function xxgera_refer(){
	vcodarea = "";
	vref = "";
	vaux = "";
	// Pegar código de refer. passada por parametro
	// e gerar um novo código sequencial respeitando o código da área.
	}

function DoPrinting(){
if (!window.print){
alert("Use o Netscape  ou Internet Explorer \n nas versões 4.0 ou superior!")
return
}
window.print()
}
