//<![CDATA[
 function blockError(){return true;}
  window.onerror=blockError;
  
  
//======================= MUNDA FOCUS ENTRE AS ABAS TECNOLOGIAS  =================================
 function click_planos(obj){
   var objs=document.getElementsByTagName("div"); // Objetos que possuim a tag a
   for(x=0; x < objs.length; x++) {
    if (objs[x].className == 'abas_tecnologia_selected'){ // Objeto selecionado
     objs[x].removeAttribute('class');
     objs[x].className='abas_tecnologia_normal';
    }
   }// end for
   obj.className='abas_tecnologia_selected';
 }
  

//======================= MUNDA DE CAMPO AO PRESSIONAR ENTER =================================
enterAsTab = function(form, a){
	addEvent(form, "keypress", function(e){
		var l, i, f, j, o = e.target;
		if(e.key == 13 && (a || !/textarea|select/i.test(o.type))){
			for(i = l = (f = o.form.elements).length; form[--i] != o;);
			for(j = i; (j = (j + 1) % l) != i && (!form[j].type || form[j].disabled || form[j].readOnly || form[j].type.toLowerCase() == "hidden"););
			e.preventDefault(), j != i && form[j].focus();
		}
	});
};


//======================== VALIDA CAMPOS =======================================
var title_mesg = "TERRA BANDA LARGA!\n============================================\n\n";
// OBS: use a opção alt nos campos do formulário, passando seus respectivos nomes, para indica-los nas mensagens
function valida_form(formulario){ // Passa o Formulário por parametro, no evento onSubmit
 for (x=0; x < formulario.elements.length-1; x++){
   /* Caso não seja necessario verificar o campo, não necessita passar o alt nele
      OBS: em input do tipo select, para não verificar, é necessario passar o alt como "" Ex alt=""
   */
   if (formulario.elements[x].alt == "") continue;
   
   // campo vazio ou select value = null
   if ((formulario.elements[x].value == "")  || (formulario.elements[x].value == '#') || (formulario.elements[x].value == "null")){
     formulario.elements[x].focus();
     if (formulario.elements[x].type != "select-one")
        alert(title_mesg+"O campo ' "+formulario.elements[x].alt+" ' esta vazio!!!");
     else { alert(title_mesg+"Por favor selecione um dos itens do select ' "+formulario.elements[x].alt+" ' para continuar!"); }
     return false;
   }// end if
 }// end for
 return true;
}
//]]>
