// JavaScript Document
try {
	ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
	try {
		ajax = new XMLHttpRequest();
	}
	catch(ex) {
		try{
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(exc) {
			alert("Esse browser não tem recursos para uso do Ajax");
			ajax = null;
		}
	}
}

function getclick(id){    
	//se tiver suporte ajax
	if(ajax) {
		ajax.open("POST", "../anuncios/contador_ouro.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		ajax.onreadystatechange = function() {
			
			//enquanto estiver processando...emite a msg de carregando
			if(ajax.readyState == 1) {
			   //-------
			}
			//após ser processado - chama função processXML que vai varrer os dados
			if(ajax.readyState == 4 ) {
			   if(ajax.responseText) {
					//----------------
			   }else{
				   //caso não seja um arquivo XML emite a mensagem abaixo
				   //idOpcao.innerHTML = "--Primeiro selecione o Estado--";
			   }
			}
		}
		//passa o código do estado escolhido
		var params = "id="+id;
		ajax.send(params);
	}
}