var req; 

function loadXMLDoc(url,valor) 
{ 
    req = null; 
    // Procura por um objeto nativo (Mozilla/Safari) 
    if (window.XMLHttpRequest) { 
        req = new XMLHttpRequest(); 
        req.onreadystatechange = processReqChange; 
        req.open("GET", url+'?categoria='+valor, 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+'?categoria='+valor, 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('atualiza').innerHTML = req.responseText; 
        } else { 
            alert("Houve um problema ao obter os dados:\n" + req.statusText); 
        } 
    } 
} 

function Atualiza(valor) 
{ 
    loadXMLDoc("atualiza.php",valor); 
} 

function showLayer(div) {
document.getElementById(div).style.visibility="visible";
}
function hideLayer(div) {
document.getElementById(div).style.visibility="hidden";
}

function abrefecha(obj)
		{
			obj = document.getElementById(obj);
			if (obj.style.display == "none")
				obj.style.display =  "inline";
			else
				obj.style.display =  "none";
		}
		
		function MM_callJS(jsStr) { //v2.0
        return eval(jsStr)
        }

function popsenha(foto) {
var winPopup = window.open(foto,'popsenha','width=400,height=320,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,marginleft=0,margintop=0,left='+(((screen.width-400)/2)+-10)+',top='+(((screen.height-300)/2)+-30));
}

