var xmlhttp = null;
var divBox = "";
function pegaConteudo(url,div) {
    try { 
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e) { 
        try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
        } catch (E) { 
            xmlhttp = false; 
        } 
    } 

    if  (!xmlhttp && typeof  XMLHttpRequest != 'undefined' ) { 
        try  { 
            xmlhttp = new  XMLHttpRequest(); 
        } catch  (e) { 
            xmlhttp = false ; 
        } 
    }
	divBox = div;
	//alert(url);
	// Mata o flash problematico 
	document.getElementById("flashObject").style.display = "none";
    if (xmlhttp) {
        xmlhttp.onreadystatechange = processadorMudancaEstado;
        xmlhttp.open("GET", url, true);
        xmlhttp.setRequestHeader('Content-Type','text/xml');
        xmlhttp.setRequestHeader('encoding','ISO-8859-1');
        xmlhttp.send(null);
    }
}

function processadorMudancaEstado () {
    if ( xmlhttp.readyState == 4) { // Completo 
        if ( xmlhttp.status == 200) { // resposta do servidor OK 
			//alert(divBox);
            document.getElementById(divBox).innerHTML = xmlhttp.responseText ; 
			document.getElementById(divBox).style.visibility = "visible";
        } else { 
            alert( "Problema: " + xmlhttp.statusText );  
        } 
    }
}

function abreDiv(div){
	document.getElementById(div).style.visibility ="visible";
}
function fechaDiv(div){
	document.getElementById(div).style.visibility ="hidden";
	// Mostra o flash problematico 
	document.getElementById("flashObject").style.display = "inline";
}

