//ajusta altura mínima do site

VerifiqueTAB = true;

// verifica salto de campos
function Mostra(quem, tammax) 
{
 if ( (quem.value.length == tammax) && (VerifiqueTAB) ) 
 { 
  var i=0, j=0, indice=-1;
  for (i=0; i<document.forms.length; i++) 
  { 
   for (j=0; j<document.forms[i].elements.length; j++) 
   { 
    if (document.forms[i].elements[j].name == quem.name) 
    { 
     indice=i;
     break; 
    } 
   } 
   if (indice != -1) break; 
  } 
  
  for (i=0; i<=document.forms[indice].elements.length; i++) 
  { 
   if (document.forms[indice].elements[i].name == quem.name) 
   { 
    while ( (document.forms[indice].elements[(i+1)].type == "hidden") && 
      (i < document.forms[indice].elements.length) ) 
    { 
     i++;
    } 
    document.forms[indice].elements[(i+1)].focus();
    //VerifiqueTAB = false;
    break; 
   }
  }
 }
} 

function PararTAB(quem) 
{ 
 VerifiqueTAB = false; 
} 
function ChecarTAB() 
{ 
 VerifiqueTAB = true; 
} 


function abrefecha(iditem){

div = document.getElementById(iditem);
div.className = "submenuaberto";

}


function getParameter( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}


function abrefechaaba(aba, abaestilo){

 document.getElementById("aba0").style.display = "none";
 document.getElementById("aba1").style.display = "none";
 document.getElementById("estiloaba1").className = "";
 document.getElementById("estiloaba2").className = "ativa1";

 var abaindex = document.getElementById(aba);
 var estiloabaindex = document.getElementById(abaestilo);
  
 if (abaindex.style.display == "block"){
  abaindex.style.display = "none";
  estiloabaindex.className = "ativa1";
 }else{
  abaindex.style.display = "block";
  estiloabaindex.className = "ativa";
 
 }
 

}

// Preenche com zeros
function strZ(Pnum, Pcasas)
{
 var qZero = Pcasas - Pnum.length;
 var nStr = "";
 for(i=0; i< qZero; i++)
 {
  nStr += 0;
 }
 return (nStr + Pnum);
}


// Exibe Detalhes da Rede Hospitalar
function exibir(linkabre, alvo){
 document.getElementById(linkabre).onclick = function (){
  if(document.getElementById(alvo).className == "itensabertos"){
   document.getElementById(alvo).className = "";
  } else {
   document.getElementById(alvo).className = "itensabertos";
  }
 }
}