  var regras = new Array();
  function Regra(CAMPO,VALOR,CONDICAO){ 
    this.campo = CAMPO 
    this.valor = VALOR 
    this.condicao = CONDICAO 
  }
 
  function validate(ARRAY) {
    var erro = '';
    for (i=0; i<ARRAY.length; i++) {
      if (ARRAY[i].valor==ARRAY[i].condicao) {
         erro += '   ' + ARRAY[i].campo + ' \n';
      }
    }
    regras = new Array();
    if (erro.length>0) {
      alert('Error: \n' + erro + '. Fill in the fields.');
      return false;
    } else {
      return true;
    }
  }

  function toLowerCase(ELEMENTS) {
    ELEMENTS.value = ELEMENTS.value.toLowerCase();
  }

  function toUpperCase(ELEMENTS) {
    ELEMENTS.value = ELEMENTS.value.toUpperCase();
  }

  function toJavaCase(ELEMENTS) {
    ELEMENTS.value = ELEMENTS.value.substring(0,1).toUpperCase() + ELEMENTS.value.substring(1);
  }

  function toDouble(ELEMENTS) {
    var original = ELEMENTS.value;
    if (ELEMENTS.value.indexOf(',')!=-1) {
      ELEMENTS.value = (ELEMENTS.value).replace(".","");
    }

    ELEMENTS.value = (ELEMENTS.value).replace(",",".");
  }

  function today(ELEMENTS) {
    var today = new Date()
    ELEMENTS.value= today.getDate() + '/' + (today.getMonth()+1) + '/' + today.getYear();
  }

  function show(ID) {
    m = document.getElementById(ID).style;
    if (m.display=='none') {
      m.display='block';
    } else {
      m.display='none'; 
    }
  }


  function verificaCpf(x, y) { 
    var numero = x.value;
    var digito = y.value;
    
 if (numero== null ||
        numero=='' ||
        digito==null || 
        digito=='' || 
        numero==111111111 || 
        numero==222222222 || 
        numero==333333333 || 
        numero==444444444 || 
        numero==555555555 || 
        numero==666666666 || 
        numero==777777777 || 
        numero==888888888 || 
        numero==999999999) { 
      numero="";
      digito="";
      x.focus();
      alert('Cpf inválido');
      return false;
    } else { 
      Div_Ini = 100000000;
      Mult_Ini = 10;
      Num_Ini = x.value;
      Acum = 0;
      Acum_Aux = 0; 
      Div_Calc = 0;
      Mult_Calc = 0;  
      V_Digito = 0;
      Resultado = 0;

      for (i = 0; i < 2; i++) { 
        Mult_Calc = Mult_Ini+i;
        Div_Calc  = Div_Ini * ( 9*i+1 );
        Acum_Aux = Num_Ini * ( 9*i+1 )+Acum;
        Acum = 0;
        while (Div_Calc > 0 ) { 
          V_Digito = (Acum_Aux - ( Acum_Aux % Div_Calc ))/Div_Calc;
          Acum = Acum + V_Digito * Mult_Calc;
          Acum_Aux  = Acum_Aux - ( V_Digito * Div_Calc );
          Mult_Calc = Mult_Calc-1;
          if (Mult_Calc < 2) {  
            Mult_Calc = 9;
          }  
          Div_Calc  = Div_Calc / 10;
        }  
        Acum = 11 - (Acum % 11);
        if (Acum > 9) {  
          Acum = 0;
        }  
        Resultado = Resultado + Acum * ( 9*( 1-i ) + 1 );
      }  
      if (Resultado != y.value) { 
        alert('Dï¿½gito CPF incorreto. Dï¿½gito CPF incorreto');
        x.focus();  
        return false;
      }  
    } 
    return true;
  } 


function FormatDate(campo,teclapres) {
 var tecla = teclapres.keyCode;
 vr = campo.value;
 vr = vr.replace( ".", "" );
 vr = vr.replace( "-", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 tam = vr.length + 1;
 if ( tecla != 9 && tecla != 8 ){
  if ( tam > 2 && tam < 5 )
   campo.value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );
  if ( tam >= 5 && tam <= 10 )
   campo.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); 
 }
}
function FormatNumber(campo,tammax,teclapres) {
    var tecla = teclapres.keyCode;
    var vl = String.fromCharCode(teclapres.keyCode);
    vr = campo.value;
    if (vl!='0' && vl!='1' && vl!='2' &&  vl!='3' && vl!='4' && vl!='5' && vl!='6' && vl!='7' && vl!='8' && vl!='9' && vl!='.' && vl!=',') {
      vr = vr.replace(vl, "");
      campo.value = vr;
      return;
    }
}
function FormatValue(campo,tammax,teclapres) {
 var tecla = teclapres.keyCode;
 var vl = String.fromCharCode(teclapres.keyCode);
 vr = campo.value;
        if (vl!='0' && vl!='1' && vl!='2' &&  vl!='3' && vl!='4' && vl!='5' && vl!='6' && vl!='7' && vl!='8' && vl!='9' && vl!='.' && vl!=',') {
          vr = vr.replace(vl, "");
          campo.value = vr;
          return;
        }
        vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ",", "" );
 tam = vr.length;

 if (tam < tammax && tecla != 8){ tam = vr.length + 1 ; }

 if (tecla == 8 ){ tam = tam - 1 ; }
  
 if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ){
  if ( tam <= 2 ){ 
    campo.value = vr ; }
   if ( (tam > 2) && (tam <= 5) ){
    campo.value = vr.substr( 0, tam - 2 ) + '.' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 6) && (tam <= 8) ){
    campo.value = vr.substr( 0, tam - 5 ) + ',' + vr.substr( tam - 5, 3 ) + '.' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 9) && (tam <= 11) ){
    campo.value = vr.substr( 0, tam - 8 ) + ',' + vr.substr( tam - 8, 3 ) + ',' + vr.substr( tam - 5, 3 ) + '.' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 12) && (tam <= 14) ){
    campo.value = vr.substr( 0, tam - 11 ) + ',' + vr.substr( tam - 11, 3 ) + ',' + vr.substr( tam - 8, 3 ) + ',' + vr.substr( tam - 5, 3 ) + '.' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 15) && (tam <= 17) ){
    campo.value = vr.substr( 0, tam - 14 ) + ',' + vr.substr( tam - 14, 3 ) + ',' + vr.substr( tam - 11, 3 ) + ',' + vr.substr( tam - 8, 3 ) + ',' + vr.substr( tam - 5, 3 ) + '.' + vr.substr( tam - 2, tam ) ;}
 }
}
function isNumber(inputValue) {
  inputStr = inputValue.toString();
  for (var i = 0; i < inputStr.length; i++) {
    var oneChar = inputStr.charAt(i);
    if (i == 0 && oneChar == "-") {
      continue;
    }
    if (oneChar == "." && !oneDecimal) {
      oneDecimal = true;
      continue;
    }
    if (oneChar == "," && !oneDecimal) {
      oneDecimal = true;
      continue;
    }
    if (oneChar < "0" || oneChar > "9") {
      return false;
    }
  }
  return true;
}
function parseNumber(field) {
  oneDecimal = false;
  var inputValue = field.value;
  if (!isNumber(inputValue)) {
    alert('Not a number!');
    field.value = '';
    field.focus();      
    return false;
  }
  return true;
}
function parseDate(field) {
  var DATE = field.value;
  if (DATE==null || DATE=='' || DATE.length==0) {
    return true;
  }
  var begin = DATE.indexOf('/');
  var last = DATE.lastIndexOf('/');
  var dia = DATE.substr(0,begin);
  var mes = DATE.substr((begin+1),((last-begin)-1));
  var ano = DATE.substr((last+1));
  if (!isNumber(dia) || !isNumber(mes) || !isNumber(ano) ) {
    alert('Correct date format: dd/mm/aaaa!');
    field.focus();
    return false;
  }
  if (ano<1 || ano>9999) {
    alert('Invalid Date - check year!');
    field.focus();
    return false;
  } 
  if (mes<1 || mes>12) {
    alert('Invalid Date - check month!');
    field.focus();
    return false;
  } 
  if (mes=='1' || mes=='01' || 
      mes=='5' || mes=='05' || 
      mes=='7' || mes=='07' || 
      mes=='8' || mes=='08' || 
      mes=='10' || 
      mes=='12') {
    if (dia<1 || dia>31) {
      alert('Invalid Date - check day!');
      field.focus();
      return false;
    }
  } else if (mes==2 || mes==02) {
    if (dia<1 || dia>29) {
      alert('Invalid Date - check day!');
      field.focus();
      return false;
    }
  } else if (
      mes=='1' || mes=='01' || 
      mes=='3' || mes=='03' || 
      mes=='4' || mes=='04' || 
      mes=='9' || mes=='09' || 
      mes=='11') {
    if (dia<1 || dia>30) {
      alert('Invalid Date - check day!');
      field.focus();
      return false;
    }
  }
}
function corrige_ponto(X) {
  var original = X.value;
  if (X.value.indexOf(',')!=-1) {
    X.value = (X.value).replace(".","");
  }
  X.value = (X.value).replace(",",".");
}

function FormataData(campo,teclapres) {
 var tecla = teclapres.keyCode;
 vr = campo.value;
 vr = vr.replace( ".", "" );
 vr = vr.replace( "-", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 tam = vr.length + 1;
 if ( tecla != 9 && tecla != 8 ){
  if ( tam > 2 && tam < 5 )
   campo.value = vr.substr( 0, tam - 2  ) + '/' + vr.substr( tam - 2, tam );
  if ( tam >= 5 && tam <= 10 )
   campo.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, 4 ); 
 }
}

function FormataHora(campo,teclapres) {
 var tecla = teclapres.keyCode;
 vr = campo.value;
 vr = vr.replace( ".", "" );
 vr = vr.replace( "-", "" );
 vr = vr.replace( ":", "" );
 vr = vr.replace( ":", "" );
 vr = vr.replace( ":", "" );
 tam = vr.length + 1;
 if ( tecla != 9 && tecla != 8 ){
  if ( tam > 2 && tam < 5 )
   campo.value = vr.substr( 0, tam - 2  ) + ':' + vr.substr( tam - 2, tam );
  if ( tam >= 5 && tam <= 10 )
   campo.value = vr.substr( 0, 2 ) + ':' + vr.substr( 2, 2 ) + ':' + vr.substr( 4, 4 ); 
 }
}

function FormatValue(campo,tammax,teclapres) {
 var tecla = teclapres.keyCode;
 vr = document.form[campo].value;
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( ",", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 vr = vr.replace( ".", "" );
 tam = vr.length;

 if (tam < tammax && tecla != 8){ tam = vr.length + 1 ; }

 if (tecla == 8 ){ tam = tam - 1 ; }
  
 if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ){
  if ( tam <= 2 ){ 
    document.form[campo].value = vr ; }
   if ( (tam > 2) && (tam <= 5) ){
    document.form[campo].value = vr.substr( 0, tam - 2 ) + ',' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 6) && (tam <= 8) ){
    document.form[campo].value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 9) && (tam <= 11) ){
    document.form[campo].value = vr.substr( 0, tam - 8 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 12) && (tam <= 14) ){
    document.form[campo].value = vr.substr( 0, tam - 11 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; }
   if ( (tam >= 15) && (tam <= 17) ){
    document.form[campo].value = vr.substr( 0, tam - 14 ) + '.' + vr.substr( tam - 14, 3 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;}
 }
  
 for (var ct = 0; ct < document.form.elements.length; ct++) {
  if (document.form.elements[ct].name == document.form.elements[campo].name) {
   if ( !teclapres.shiftKey && tecla == 9 && document.form[ct+1].name == "senhaConta" && document.applets['tclJava'] ){
    document.applets['tclJava'].setFocus();
   } 
  }
 }
}

function switchOn(tab,contents,topblock,cell) {
  topRow = document.getElementById(topblock);
  tabArray = topRow.childNodes;
  for (var i=0; i<tabArray.length; i++) {
    if (tabArray[i].className != 'tabspacer') {
      tabArray[i].className = 'tab';
    }
  }
  contentsCell = document.getElementById(cell);
  contentsArray = contentsCell.childNodes;
  for (var j=0; j<contentsArray.length; j++) {
    contentsArray[j].className = 'contents';
  }
  document.getElementById(tab).className = 'selectedtab';
  document.getElementById(contents).className = 'selectedcontents';
}

function confirmSubmit(text) {
  if (text==null || text=='') {
    var agree=confirm("Confirma esta Operação?");
  } else {
    var agree=confirm(text);
  }
  if (agree) {
   return true ;
  } else {
   return false ;
 }
}

function confirmSubmit(text, ok, cancel) {
  if (text==null || text=='') {
    text = 'Confirma esta Operação?';
  }  
  if (ok==null || ok=='') {
    ok = 'Ok';
  }  
  if (cancel==null || cancel=='') {
    cancel = 'Cancel';
  }  
  var agree=confirm(text, ok, cancel);
  if (agree) {
   return true ;
  } else {
   return false ;
 }
}

var state = 'hidden';
function showhide(layer_ref) {
  if (state == 'visible') {
    state = 'hidden';
  } else {
    state = 'visible';
  }
  if (document.all) { 
    eval( "document.all." + layer_ref + ".style.visibility = state");
  }
  if (document.layers) { 
    document.layers[layer_ref].visibility = state;
  }
  if (document.getElementById && !document.all) {
    maxwell_smart = document.getElementById(layer_ref);
    maxwell_smart.style.visibility = state;
  }
}

function abremenu(x){
 if (IE) {
 document.all.divinfos[x-1].style.visibility="hidden";
 document.all.divinfos[x-1].style.display='';
 document.all.divinfos[x-1].style.filter="blendTrans(duration=.5)";
 document.all.divinfos[x-1].filters.blendTrans.Apply();
 document.all.divinfos[x-1].style.visibility="visible";
 document.all.divinfos[x-1].filters.blendTrans.Play();
 }
}

function fechamenu(x){
 if (IE) {
 document.all.divinfos[x-1].style.visibility="hidden";
 document.all.divinfos[x-1].style.display='none';
 }
}

var display_url=0
function showmenuie5(e){
  if (navigator.appName.indexOf("Microsoft") < 0) {
    document.getElementById("ie5menu").style.left=e.pageX;
    document.getElementById("ie5menu").style.top=e.pageY; 
  } else {
    document.getElementById("ie5menu").style.left=event.clientX
    document.getElementById("ie5menu").style.top=event.clientY

  }
  document.getElementById("ie5menu").style.visibility="visible"
  return false
}

function hidemenuie5(){
  document.getElementById("ie5menu").style.visibility="hidden"
}

/* Novas Funções adicionadas a partir desta linha*/

/**
 * Remove todos os itens nao selecionados de um select(multipla seleção)
 */
function removeNaoSelecionados(campo) {
  
  while(!isAllSelected(campo)) {
    for (var j=0; j<campo.length; j++) {
      if (!campo.options[j].selected) {
        campo.options[j] = null;
      }
    }
  }
}

/**
 * Verifica se todos os itens de uma combo estao selecionados
 */
function isAllSelected(campo) {
  var cont = 0;
  for (var i=0; i<campo.length; i++) {
    if (campo.options[i].selected) {
       cont++;
    }
  }

  if (cont == campo.length)
    return true;
  else
    return false;
}

/**
 * Adiciona um item selecionado de uma combo para a outra.
 */
function addItem(comboDest, comboOrigem) {
    var position = comboDest.options.length;
    
    var value = comboOrigem.options[comboOrigem.selectedIndex].value;
    var text  = comboOrigem.options[comboOrigem.selectedIndex].text;

    comboDest.options[position] = new Option(text,value);
    
    selectAll(comboDest);
}

/**
 * Seleciona todos os items de uma combo
 */
function selectAll(combo) {
   for (var i=0;i<combo.length;i++) {
     combo.options[i].selected=true;
   }
 }

function janelaCodigoUsuario(tipo) { 
  
  var w = 480, h = 340;
  if (document.all || document.layers) {
     w = screen.availWidth;
     h = screen.availHeight;
  }
  
  var popW =500, popH = 330;
  var leftPos = (w-popW)/2, topPos = (h-popH)/2;
  
  if(tipo=='CLI') {
     newWin = window.open('../lov/ClientesLov.do?returnBlock=0&return0=codigo_usuario','','width=630,height=300,top='+topPos+',left='+leftPos+',scrollbars');
     setTimeout('newWin.focus()',100);
  }
  if(tipo=='REP') {
     newWin = window.open('../lov/RepresentantesLov.do?returnBlock=0&return0=codigo_usuario','','width=630,height=300,top='+topPos+',left='+leftPos+',scrollbars');
     setTimeout('newWin.focus()',100);
  } 
  
}

function limita2(campo){
	if(document.forms.length > 1){
		var tamanho = document.form[1][campo].value.length;
		var tex=document.form[1][campo].value;
		if (tamanho>=255){	document.form[1][campo].value=tex.substring(0,255); }
		return true;
		}
	else{
		var tamanho = document.form[campo].value.length;
		var tex=document.form[campo].value;
		if (tamanho>=255){	document.form[campo].value=tex.substring(0,255); }
		return true;
		}
}

function contacampo2(campo, tamtxt){
	if(document.forms.length > 1)
  	    document.form[1][tamtxt].value = 256-document.form[1][campo].value.length;
	else	
	    document.form[tamtxt].value = 256-document.form[campo].value.length;
}

function textCounter( field, countfield, maxlimit ) {
  if ( field.value.length > maxlimit )  {
    field.value = field.value.substring( 0, maxlimit );
    alert( 'Limite de caracteres excedido.' );
    return false;
  }
  else 
  { 
    if (countfield != null) {
        countfield.value = maxlimit - field.value.length;
    }
  }
}  
  
 function gerarRelatorioDefault() {
  var acao = document.forms[0].action;
  var destino = document.forms[0].target;

  document.forms[0].target = "_blank";
  document.forms[0].action = "../servlet/ServletRelatorios";
  document.forms[0].submit();
  
  document.forms[0].target = destino;
  document.forms[0].action = acao;
}  

  function frameTitulo(page2) {
     parent.tit.location.href=page2;     
 }  
 
function vazio(campo,texto)
{
var flag=0;
if(campo == "" || campo == "undefined" || campo == null)
{
Response.Write("<br>O Campo:<b>"+texto+"</b> não foi preenchido.");
flag = 1;
}
return flag;
}


function nochar(x,y){

    
    var digito = y.value;

var DTN = x.value;

for (var i = 0; i < DTN.length; i++) 
            {

var ch = DTN.substring(i, i + 1);
          
  //   if   ( (/[^a-zA-Z0-9_]/))

 if ((ch < "0" || "9" < ch) && (ch != "/")) 
 
 //if ((ch < "^a-z" || "A-Z_" < ch)&&(ch < "0" || "9" < ch)||(ch == "<")) 
               {
               alert("\nO campo " + x.name +" aceita somente números:");
               x.focus();
               return false;
               }
}
}


function nosimbol(x,y){

    
    var digito = y.value;

var DTN = x.value;

for (var i = 0; i < DTN.length; i++) 
            {

var ch = DTN.substring(i, i + 1);

if (ch.search(/[^a-zA-Z0-9-^ÂÊÎÔÛÁÉÍÓÚ,çÇ~ãõ´ôêîûâéáíãóú@ ._]/)!=-1)
               {
               alert('\nO caractere "' + ch +'" é inválido!');
               x.focus();
               return false;
               }
}
}

//VALIDAÇÃO DA DATA 

function VerData(x,y) 
{
    var bissexto = 0;
    var data = x.value; 
    var tam = x.length;
    
if (data != "") 
  {

        var dia = data.substr(0,2)
        var mes = data.substr(3,2)
        var ano = data.substr(6,4)



        if ((ano > 1900)||(ano < 2100))
        {
            switch (mes) 
            {
                case '01':
                case '03':
                case '05':
                case '07':
                case '08':
                case '10':
                case '12':
                    if  (dia <= 31) 
                    {
                        return true;
                    }
                    break
                
                case '04':        
                case '06':
                case '09':
                case '11':
                    if  (dia <= 30) 
                    {
                        return true;
                    }
                    break
                case '02':
                    /* Validando ano Bissexto / fevereiro / dia */ 
                    if ((ano % 4 == 0) || (ano % 100 == 0) || (ano % 400 == 0)) 
                    { 
                        bissexto = 1; 
                    } 
                    if ((bissexto == 1) && (dia <= 29)) 
                    { 
                        return true;                 
                    } 
                    if ((bissexto != 1) && (dia <= 28)) 
                    { 
                        return true; 
                    }            
                    break                        
            }
        }
    //}    
    alert('Digite a data no formato "dd/mm/aaaa."');
    return false;
}



}

function FormataCep(x,y) {
 var tecla = y.keyCode;
 vr = x.value;
 vr = vr.replace( ".", "" );
 vr = vr.replace( "-", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 vr = vr.replace( "/", "" );
 tam = vr.length + 1;
 if ( tecla != 9 && tecla != 8 ){
  if ( tam > 2 && tam < 5 )
   x.value = vr.substr( 0, tam - 4  ) + '.' + vr.substr( tam - 4, tam );
  if ( tam >= 3 && tam <= 11 )
   x.value = vr.substr( 0, 2 ) + '.' + vr.substr( 2, 3 ) + '-' + vr.substr( 5, 5 ); 
 }
}

function submeteform(x,y)
{


var strcurso=document.frm.curso.value;
var strcpf=document.frm.cpf.value;
var strcategoria=document.frm.Renda.value;
var strnome=document.frm.nome.value;
var strtel=document.frm.tel.value;
var strmae=document.frm.mae.value;


var strdata=document.frm.nascimento.value;
var strendereco=document.frm.endereco.value;
var strnum_end=document.frm.num_end.value;
var strbairro=document.frm.bairro.value;
var strCep=document.frm.cep.value;
var strCidade=document.frm.cidade.value;
var strEstado=document.frm.estado.value;
var strEmail=document.frm.email.value;

var soma=0;

var str_op_escolha_1=document.frm.op_escolha_1.checked;
var str_op_escolha_2=document.frm.op_escolha_2.checked;
var str_op_escolha_3=document.frm.op_escolha_3.checked;
var str_op_escolha_4=document.frm.op_escolha_4.checked;
var str_op_escolha_5=document.frm.op_escolha_5.checked;
var str_op_escolha_6=document.frm.op_escolha_6.checked;
var str_op_escolha_7=document.frm.op_escolha_7.checked;
var str_op_escolha_8=document.frm.op_escolha_8.checked;
var str_op_escolha_9=document.frm.op_escolha_9.checked;
var str_op_escolha_10=document.frm.op_escolha_10.checked;
var str_op_escolha_11=document.frm.op_escolha_11.checked;



if (str_op_escolha_1  == true) 
{
str_op_escolha_1 =1;
soma=(soma + str_op_escolha_1);
}


if (str_op_escolha_2  == true) 
{
str_op_escolha_2 =1;
soma=(soma + str_op_escolha_2);
}


if (str_op_escolha_3 == true) 
{
str_op_escolha_3 =1;
soma=(soma + str_op_escolha_3);
}


if (str_op_escolha_4 == true) 
{
str_op_escolha_4 =1;
soma=(soma + str_op_escolha_4);
}


if (str_op_escolha_5  == true) 
{
str_op_escolha_5 =1;
soma=(soma + str_op_escolha_5);
}


if (str_op_escolha_6  == true) 
{
str_op_escolha_6 =1;
soma=(soma + str_op_escolha_6);
}


if (str_op_escolha_7  == true) 
{
str_op_escolha_7 =1;
soma=(soma + str_op_escolha_7);
}


if (str_op_escolha_8  == true)
{
str_op_escolha_8 =1;
soma=(soma + str_op_escolha_8);
}


if (str_op_escolha_9  == true) 
{
str_op_escolha_9 =1;
soma=(soma + str_op_escolha_9);
}


if (str_op_escolha_10  == true) 
{
str_op_escolha_10 =1;
soma=(soma + str_op_escolha_10);
}


if (str_op_escolha_11  == true)
{
str_op_escolha_11 =1;
soma=(soma + str_op_escolha_11);
}




var flag=0;

	if(strcurso == "Escolha seu curso" || strcurso == 0  ){
	alert(" Curso não selecionado!");
	document.frm.curso.focus();
	}else{

	if(strcpf == ""){
	alert(" CPF não informado!");
	document.frm.cpf.focus();
	}else{

	if(strnome == "" || strnome == "undefined" || strnome == null){
	alert(" Nome não informado!");
	document.frm.nome.focus();
	}else{


	if(strdata == "" || strdata == "undefined" || strdata == null){
	alert(" Data de nascimento não informado!");
	document.frm.nascimento.focus();
	}else{	

	if(strmae == "" || strmae == "undefined" ||strmae== null){
	alert(" Nome da mãe não informado!");
	document.frm.mae.focus();
	}else{

	if(strendereco == "" || strendereco == "undefined" ||strendereco== null){
	alert(" Endereço não informado!");
	document.frm.endereco.focus();
	}else{

	if(strnum_end == "" || strnum_end == "undefined" ||strnum_end== null){
	alert(" Número de endereço não informado!");
	document.frm.num_end.focus();
	}else{
	 
	if(strbairro == "" || strbairro == "undefined" || strbairro == null){
	alert(" Bairro não informado!");
	document.frm.bairro.focus();
	}else{

	if(strCep == "" || strCep == "undefined" || strCep == null){
	alert(" Cep não informado!");
	document.frm.cep.focus();
	}else{

	if(strCidade == "" || strCidade == "undefined" || strCidade == null){
	alert(" Cidade não informada!");
	document.frm.cidade.focus();
	}else{

	if(strEstado == "" || strEstado == "undefined" || strEstado == null){
	alert(" Estado não informada!");
	document.frm.estado.focus();
	}else{

	if(strtel== "" || strtel == "undefined" || strtel == null){
	alert("Telefone não informado!");
	document.frm.tel.focus();
		
	}else{


	if(strEmail == "" || strEmail == "undefined" || strEmail == null){
	alert(" Email não informado!");
	document.frm.email.focus();
	}else{


	if(strcategoria == "" || strcategoria == "undefined" || strcategoria == null){
	alert("Faixa Salarial não informada!");
	document.frm.Renda.focus();
	}else{
	
	
	if (soma != 3)
	{
	alert("Selecione três atributos que pesaram na sua escolha:!");
	//document.frm.Renda.focus();
	}else{


	document.frm.submit() 
	
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
        }
	

return flag;
}


function submetecadevent(x,y)
{





var strHabilitacao=document.frm.cb_habilitacao.value;
var strEvento=document.frm.evento.value;

var flag=0;



	if(strEvento == "" || strEvento == "undefined" || strEvento == null){
	alert(" Evento não informado!");
	document.frm.evento.focus();
	}else{



	if(strHabilitacao == "" || strHabilitacao == "undefined" || strHabilitacao == null){
	alert(" Habilitação não informado!");
	document.frm.cb_habilitacao.focus();
	}else{






	 document.frm.submit() 
	
	
	
	
	
	
	}
	}

return flag;

}



function submeteeditar(x,y)
{

document.frm.action = "editarevento.asp" ;
document.frm.submit() ;


}

function subvoltar(x,y)
{

window.location = "acomp_.asp" ;



}

function subnovo(x,y)
{

document.frm.action = "cadevento.asp?evento=" ;
document.frm.submit() ;


}

function atualizapalestra(x,y)
{

document.frm.action = "update_cad_evento.asp" ;
document.frm.submit() ;


}

function atualizaevento(x,y)
{

document.frm.action = "update_evento.asp" ;
document.frm.submit() ;


}

function subcadastro(x,y)
{

document.frm.action = "insert_cad_evento.asp" ;
document.frm.submit() ;


}

function submeteeditevent(x,y)
{





var strHabilitacao=document.frm.cb_habilitacao.value;
var strEvento=document.frm.evento.value;

var flag=0;



	if(strEvento == "" || strEvento == "undefined" || strEvento == null){
	alert(" Evento não informado!");
	document.frm.evento.focus();
	}else{

       document.frm.action="ficha.asp"();

       document.frm.submit() 
	
	
	
	
	
	
	}
	
return flag;

}

function submeterp(x,y)
{

document.frm.action = "inscricao.asp" ;
document.frm.submit() ;


}

function submeteficha(x,y)
{
document.frm.method = "GET";
document.frm.action = "ficha.asp";
document.frm.submit() ;


}

function subcertificado(x,y)
{

document.frm.action = "listaEmCert_.asp";
document.frm.submit() ;


}




//if (document.frm.temcpf.checked="False"){

//document.frm.temcpf.value="N";
//}

//}