function hide(n) {
  for (i=1;i<=n;i++)
    document.getElementById('tb'+i).style.visibility = 'hidden';
}


function isIE(){
	 if (window.document.all)
       return true
   else 
     if (window.document.layers)
       return false

};

//t- identifica a tabela que será mostrada em uma determinada posição
//x- identifica a posicao que a tabela t será mostrada
//Ok - identifica se é ou não para mostrar a tabela t
function showInfo(t,x,ok,id_posicao) {
 //distância do começo da tela até o início da tabela principal
 tabela = document.getElementById("tabmenu");
 
 if (isIE()) {
    p = parseInt((screen.width-tabela.offsetWidth)/2);
 } else {
    p = parseInt((innerWidth-tabela.offsetWidth)/2);
 };
 
 //distância do começo da tela até o início da última celula da tabela principal (contato)
 p1= parseInt(p + (tabela.offsetWidth - x.offsetWidth)-15);

  
/*
  alert('Largura da Tela: '+ screen.Width);
	alert('Largura da Tabela Principal:' + tab_ref.offsetWidth);
  alert('Largura da Tabela Principal1:' + tabmenu.offsetWidth);
  alert('Largura da Tabela Menu:' + t.offsetWidth);  
  alert('Largura da Celula na Tabela Principal:' + x.offsetWidth);
*/
  hide(7);
  
	if (ok) {
    
    //Caso seja a tabela de contato id_posicao=8, o alinhamento e feito pela direita
    if (id_posicao == 8) {
      t.style.left = parseInt(p1) - (t.offsetWidth-x.offsetWidth); 
    } else { 
      t.style.left = parseInt(p) + x.offsetLeft-5; 
    };
    
    t.style.top  = tabela.offsetTop + 33;
    t.style.visibility = 'visible';
    
  } else
     t.style.visibility = 'hidden'; 
  
};
