//Iniciar Menu
over = function() {
	var sfEls = document.getElementById("nav").
getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" over";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.
replace(new RegExp(" over\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", over);

function abre_link(endereco) {
	
	window.open(endereco, '_blank');
	
}

function loadXMLDoc(url, codprojeto)
{
    req = null;
    // Procura por um objeto nativo (Mozilla/Safari)
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url+'?codprojeto='+codprojeto, true);
        req.send(null);
    // Procura por uma versao ActiveX (IE)
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url+'?codprojeto='+codprojeto, 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="atualiza" e insere o conteudo
            // retornado nela, como texto HTML
            document.getElementById('resumo_box').innerHTML = req.responseText;
			// executa scripts
            //extraiScript(req.responseText);
        } else {
            alert("Houve um problema ao obter os dados:\n" + req.statusText);
        }
    }
}

function abre_resumo(codprojeto)
{
	document.getElementById("resumo").style.display="block";
	document.getElementById("resumo_box").style.display="block";
    loadXMLDoc("projetos-resumo.php", codprojeto);
}

function fecha_resumo() {
    document.getElementById("resumo").style.display="none";
	document.getElementById("resumo_box").style.display="none";	
}