// JavaScript Document

function loadFocus() {
	var obj = document.forms;

	for ( x = 0; x < obj.length; x++ ) {
		var objetos = obj[x].length;

		for ( i = 0; i < objetos; i++ ) {
			if ( ( ( obj[x].elements[i].type == 'text' ) || ( obj[x].elements[i].type == 'textarea' ) || ( obj[x].elements[i].type == 'password' ) ) && ( obj[x].elements[i].disabled == false ) ) {
				obj[x].elements[i].focus();
				return true;
			}
		}
	}

	return false
}
var ns4 = ( document.layers ) ? true : false
var ie4 = ( document.all ) ? true : false

var iens6 = document.all || document.getElementById;
var ieBox = iens6 && (document.compatMode == null || document.compatMode != 'CSS1Compat');
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}

function question( str_question ) {
    if ( confirm( str_question ) )
        return true;
    else
        return false;
}

/*RETIRA ESPACOS DOS CAMPOS */
function troca(campo){

campo.value = campo.value.toLowerCase();

var estranha = "áéíóúàèìòùâêîôûäëïöüãõ@#$%^&*()_+=-~` ç";
var correta  = "aeiouaeiouaeiouaeiouao________________c";
var retorno  = "";

for(i=0;i<estranha.length;i++)
   {
   
   for(j=0;j<campo.value.length;j++)
      {
      retorno = campo.value.replace(estranha.substr(i,1),correta.substr(i,1));
      retorno = retorno.replace("_","");
      campo.value = retorno;
      }
   }

  
}

    function dspSwitch(id) {
    var d = document.getElementById(id).style;
    d.display = (d.display == 'block')?'none':'block';
    }
                        
function disabledControls() {
    var obj = document.forms;

    for ( x = 0; x < obj.length; x++ ) {
        var objetos = obj[x].length;
        
        for ( i = 0; i < objetos; i++ )
            if ( obj[x].elements[i].type != 'button' )
                obj[x].elements[i].disabled = true;
    }
}