function ajaxCesta(valor,tipo,ses,url,bol) {
	var dados,total,i,sep,topo,pi,pf;
	sep = ''
	
	if (bol==1){
		dados = "id="+valor+"&tipo_produto="+tipo+"&secao="+ses+"&";
		
		total= document.getElementById('tt').value;
		for(i=0;i<total;i++){
			dados+=sep+'qtd_lb'+(i+1)+'='+document.getElementById('qtd_lb'+(i+1)).value;
			sep='&'
		}
	}
	else{
		dados = "id="+valor+"&tipo_produto="+tipo+"&secao="+ses;	
	}
	
	//return false;
		
	// Create the XML request
	xmlReq = null;
	if(window.XMLHttpRequest) xmlReq = new XMLHttpRequest();
	else if(window.ActiveXObject) xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	if(xmlReq==null) return; // Failed to create the request
	
	// Anonymous function to handle changed request states
	xmlReq.onreadystatechange = function()
	{
		switch(xmlReq.readyState)
		{
		case 0: // Uninitialized
				break;
		case 1: // Loading
				break;
		case 2: // Loaded
				break;
		case 3: // Interactive
				break;
		case 4: // Done!
			retorno = xmlReq.responseText;
			document.getElementById('car_lb').innerHTML = retorno;
			if (retorno.indexOf("@cari")!=-1){
				pi = retorno.indexOf("@cari")+5;
				pf = retorno.indexOf("@carf");
				
				topo = retorno.substring(pi,pf);	
				document.getElementById('carrinho').innerHTML=topo;
			}
			break;
			
		default:
				break;
		}
	}
	
	
	// Make the request
	xmlReq.open('POST', url+'/cesta_ajax.asp', true);
	xmlReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlReq.setRequestHeader("Content-length", dados.length);
	xmlReq.send(dados);	
	
}
