var req3; 

function carregarBannerTopo(url) 
{ 
    req3 = null; 
    // Procura por um objeto nativo (Mozilla/Safari) 
    if (window.XMLHttpRequest) { 
        req3 = new XMLHttpRequest(); 
        req3.onreadystatechange = processReqChange3; 
        req3.open("GET", url, true); 
        req3.send(null); 
    // Procura por uma versão ActiveX (IE) 
    } else if (window.ActiveXObject) { 
        req3 = new ActiveXObject("Microsoft.XMLHTTP"); 
        if (req3) { 
            req3.onreadystatechange = processReqChange3; 
            req3.open("GET", url, true); 
            req3.send(); 
        } 
    } 
} 

function processReqChange3() 
{ 
    // apenas quando o estado for "completado" 
    if (req3.readyState == 4) { 
        // apenas se o servidor retornar "OK" 
        if (req3.status == 200) { 
            // procura pela div id="news" e insere o conteudo  
            // retornado nela, como texto HTML 
			document.getElementById('secao_publicidade_topo').innerHTML = req3.responseText; 
        } else { 
            document.getElementById('secao_publicidade_topo').innerHTML = '<img src="img_site/loading.gif" />';
        } 
    } 
} 

function alternarBannerTopo() 
{ 	
	carregarBannerTopo("config/inc_banner_topo.php");
}

setInterval("alternarBannerTopo()",20000);
alternarBannerTopo();
