
 function janela_frame_close(){
      document.getElementById('janela_centro').style.display = 'none';
      document.getElementById('janela_centro_conteudo_fundo').style.display = 'none';
 }
 function load_close(){
      document.getElementById('load').style.display = 'none';
 }
 function janela_frame(url){
      tamanho_altura = document.getElementById('tabela').offsetHeight;
      tamanho_altura = tamanho_altura+30;
      document.getElementById('janela_centro').style.height = tamanho_altura+'px';
      document.getElementById('janela_centro').style.display = 'block';
      document.getElementById('load').style.display = 'block';
      document.getElementById('janela_centro_conteudo_fundo').style.display = 'block';
      var largura = '10';
      var altura = '10';
      document.getElementById('janela_centro_conteudo').innerHTML = '<iframe onload="load_close()" id="janela_frame" src="'+url+'" height="'+altura+'px" width="'+largura+'px"></iframe>';
      window.scrollTo( 0, 0);
 }
 
 function janela_carregar(){
                var Tags = ['img'];
                var i = 0;
                if (typeof parte == "undefined") parte = document;
                for(z=0;z<Tags.length;z++){
                        Inputs=parte.getElementsByTagName(Tags[z]);
                        if(Tags[z] == "img")
                          {
                           for(i=0;i<Inputs.length;i++)
                              {
                               if(janela_aplicar(Inputs[i]) == 'nao'){return false;}
                              }
                          }
                }
     }
 function janela_aplicar(campo){
   ampliar = campo.getAttribute('ampliar');
   if(ampliar == 'sim')
     {
      campo.style.cursor = 'hand';
      campo.style.cursor = 'pointer';
      campo.onclick = function(e){
         ampliar_url = campo.getAttribute('ampliar_url');
        if(ampliar_url == '')
          {
           janela_centro_exe(campo.src);
          }
        else
          {
           url = ampliar_url;
           janela_centro_exe(url);
          }
        }
     }
 }
 function janela_centro_close(){
      document.getElementById('janela_centro').style.display = 'none';
      document.getElementById('janela_centro_conteudo_fundo').style.display = 'none';
 }
 function janela_centro_exe(url){
      tamanho_altura = document.getElementById('tabela').offsetHeight;
      tamanho_altura = tamanho_altura+30;
      document.getElementById('janela_centro').style.height = tamanho_altura+'px';
      document.getElementById('janela_centro').style.display = 'block';
      document.getElementById('load').style.display = 'block';      
      document.getElementById('janela_centro_conteudo_fundo').style.display = 'block';
//      document.getElementById('centro').src = url;
//      document.getElementById('centro').style.width = largura;
//      document.getElementById('centro').style.height = altura;
var a = '';
      a += '	  <table >';
      a += '        <tr>'; 
      a += '  	      <td  align="right"><a href="javascript:janela_centro_close()" title="Fechar" ><img border="0" src="imagens/fecha.png" ></a></td>';
      a += '        </tr>';
      a += '        <tr>';
      a += ' 	     <td><img onload="load_close()" src="'+url+'" border="1"/></td>';
      a += '        </tr>';
      a += '      </table>';
      document.getElementById('janela_centro_conteudo').innerHTML = a;
      window.scrollTo( 0, 0);
 } 
 
 
 
