var DivAtual;
function MostraDiv(id)
{
   document.getElementById(id).style.background='FDE2DF';
   if (DivAtual)
   {
      document.getElementById(DivAtual).style.background='FFFFFF';
   }
   DivAtual = id;
}

function getObj(name)
{
  if (document.getElementById)
  {
  	return document.getElementById(name);

  }
  else if (document.all)
  {
	return document.all[name];
  }
  else if (document.layers)
  {
   	return document.layers[name];
  }

}

function InicializaCamposColor()
{   
    var ObjetosText = document.body.getElementsByTagName("input");
    var aux;
    var ObjetoFocus;
    
    for (i = 0; i < ObjetosText.length; i++)
    {  
        
        if (((ObjetosText[i].type == 'text') || (ObjetosText[i].type == 'password')) && (ObjetosText[i].onblur == null) && (ObjetosText[i].onfocus == null))
        { 

            if(aux!=1) { ObjetoFocus = ObjetosText[i]; }
            ObjetosText[i].onfocus = function () { enterComponente(this);  }
            ObjetosText[i].onblur =  function () { exitComponente(this);  }                       
            aux = 1;
        }
    }
    
    ObjetoFocus.focus();
}

function enterComponente(e) 
{
    e.style.background = "#FEF0E7";
}

function exitComponente(e) 
{
    e.style.background = "#FFFFFF";
}
