	
	function getHTTPObject() {
		var req;
		req = false;
		// branch for native XMLHttpRequest object
		if(window.XMLHttpRequest) {
			try {
				req = new XMLHttpRequest();
			} catch(e) {
				req = false;
			}
		// branch for IE/Windows ActiveX version
		} else if(window.ActiveXObject) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
					req = false;
				}
			}
		}
		return req;
	}
	
	var req = getHTTPObject();

	
	function escolhe_local(id) {		
		$(".hide_cat").css("display","none");
		if (id != "") {
			$("#"+id).css("display","block");
		}
	}
	function escolhe_revista(val) {
		$(".hide").css("display","none");
		if (val != "") {
			$("#"+val).css("display","block");
		}
		
		//============
			req.open("POST", "carrega_revista.php?edicao_id="+val, true);
			req.onreadystatechange = function() 
			{
				if(req.readyState == 4) 
				{
					var html = req.responseText;
					var lista = document.getElementById("htm_revista");
					lista.innerHTML = html;
				}
			};
			
			req.setRequestHeader('Content-Type', 'text/html; charset=iso-8859-1');
			req.send("");
		//============
		
	}
