function selectProduto(idCategoria)
{
	url = '../listaProdutos.php?produto='+idCategoria;
	req = null;
	// Procura por um objeto nativo (Mozilla/Safari)
	if (window.XMLHttpRequest) 
	{
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChangeProdutos;
		req.open("GET",url,true);
		req.send(null);
		// Procura por uma versão ActiveX (IE)
	} 
	else if (window.ActiveXObject) 
	{
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) 
		{
			req.onreadystatechange = processReqChangeProdutos;
			req.open("GET",url,true);
			req.send();
		}
	}
}
function processReqChangeProdutos()
{
	// apenas quando o estado for "completado"
	if (req.readyState == 4) 
	{
		// apenas se o servidor retornar "OK"
		if (req.status == 200) 
		{
			var string = req.responseText;
			//alert(string);
			var separador = string.split("!");
			var cidades = separador[0].split("|");
			var idCidades = separador[2].split("@");
			var quantidade = separador[1];
			//alert(idCidades);
					
			var i = "";
			var optionValue = "";
			
			
			
			optionValue += "<select name='produtos' id='produtos' class='formContatoAssociados02' >";
			optionValue += "<option value='"+idCidades+"'>Todos</option>";
			for(i=0;i<=quantidade;i++)
			{
				if(cidades[i])
				{
					optionValue += "<option value='"+idCidades[i]+"'>"+cidades[i]+"</option>";			
				}
			}
			optionValue += "</select>";
			//alert(optionValue);
			document.getElementById('selectProdutos').innerHTML = optionValue;
		} 
		else 
		{	
			alert("Houve um problema ao obter os dados:n" + req.statusText);
		}
	}
}

