try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
atual=0
function carrega(n){
    var conteudo=document.getElementById("guias_conteudo")
    conteudo.innerHTML='<div class="carregando"><img src="carregando.gif" alt="carregando..." /></div>'
    atual=n

	xmlhttp.open("GET", "funcoes.php?n="+n,true);

	xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            var texto=xmlhttp.responseText
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            var conteudo=document.getElementById("guias_conteudo")
            conteudo.innerHTML=texto
            var menu=document.getElementById("guias_menu")
            var links=menu.getElementsByTagName("a")
            for(var i=0;i<links.length;i++)
                links[i].className=""
            links[atual-1].className="selected"
        }
    }
    xmlhttp.send(null)
}
function menuclick(e){
    if(typeof(e)=='undefined')var e=window.event
    source=e.target?e.target:e.srcElement
    if(source.nodeType==3)source=source.parentNode
    n=source.getAttribute("href").replace(/.*=/,"")
    carrega(parseInt(n))
    return false
}
function init(){
    var menu=document.getElementById("guias_menu")
    var links=menu.getElementsByTagName("a")
    for(var i=0;i<links.length;i++)
        links[i].onclick=menuclick
}

function mostra(id)
{
	var obj = document.getElementById(id);
	if(obj.style.display == 'block')
		obj.style.display = 'none';
	else
		obj.style.display = 'block';
}
function mostra2(id)
{
	var obj = document.getElementById(id);
	if(obj.style.display == 'none')
		obj.style.display = 'block';
	else
		obj.style.display = 'none';
}

function abre(url) {
	open(url, "_blank" ,"channelmode=no, fullscreen=no, height=480, left=50, location=no, menubar=no, resizeble=no, scrollbars=no, status=0, titlebar=no, toolbar=no, top=50, width=640",true);
}
if(xmlhttp)window.onload=init
