
// JavaScript Document 
// FUNÇÃO RESPONSÁVEL DE CONECTAR A UMA PAGINA EXTERNA NO NOSSO CASO A content.PHP 
// E RETORNAR OS RESULTADOS 

function ajax(url, step) 
{ 
document.getElementById('texto').innerHTML="<div align='center'><br><img src='../imagens/ajax.gif'/></div><br><br><br><br><br><br><br><br>";
//alert(nick); 
//alert(dest); 
//alert(msg); 

req = null; 
// Procura por um objeto nativo (Mozilla/Safari) 
if (window.XMLHttpRequest) { 
req = new XMLHttpRequest(); 
req.onreadystatechange = processReqChange; 
req.open("REQUEST",url,true); 
req.send(null); 
// Procura por uma versão ActiveX (IE) 
} else if (window.ActiveXObject) { 
req = new ActiveXObject("Microsoft.XMLHTTP"); 
if (req) { 

req.onreadystatechange = processReqChange; 
req.open("REQUEST",url,true); 

req.send(); 
} 
} 
} 

function processReqChange() 
{ 

// apenas quando o estado for "completado" 
if (req.readyState == 4) { 

// apenas se o servidor retornar "OK" 

if (req.status ==200) { 

// procura pela div id="conteudo" e insere o conteudo 
// retornado nela, como texto HTML 


document.getElementById('texto').innerHTML = req.responseText; 

} else { 
location.href=step;
} 
} 
} 


var tam = 12;
function mudaFonte( tipo )
{
if( tipo == 'mais' )
{
if( tam < 16 ) tam += 2 ;
}
else
{
if( tam > 9 ) tam -= 2 ;
}
if( document.getElementById( 'texto' ) )
mudaFonteRecursiva( tipo , document.getElementById( 'texto' ) ) ;

}

function mudaFonteRecursiva( tipo , domElement )
{
 for( var i = 0 ; i < domElement.childNodes.length ; i++ )
 {
 mudaFonteRecursiva( tipo , domElement.childNodes.item( i ) ) ;
 }
 if( domElement.style )
 domElement.style.fontSize = tam+'px';
}