function cria_ajax(){
	try{
		xmlhttp = new XMLHttpRequest();
	}
	catch(ee){
		try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){
			try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
		catch(E){xmlhttp = false;}
		}
	}
return xmlhttp;
}

function mudacxa(cxa, id){
	var xmlhttp=cria_ajax();
	imagem = 'img/estados/'+id+'.jpg';
	document.getElementById('imagem_estado').setAttribute('src', imagem);
	xmlhttp.open("GET", "busca_caixa.asp?cxa="+cxa+'&id='+id+'&acao=comercial', true);
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			document.getElementById(cxa).innerHTML=xmlhttp.responseText;
			document.getElementById('imgestado').style.display='block';
		}
	}

xmlhttp.send(null);
delete xmlhttp;
}
