function sendRequest(metodo, r_url, valore)
{
	req = createXMLHttpRequest();
	req.open(metodo, r_url+valore);
	req.onreadystatechange = handleResponse;
	req.send(null);
}

function handleResponse() 
{
	if(req.readyState === 4)
	{
   		if(req.status == 200)
		{	  
			var response = req.responseText;
			var update = new Array();
	
			if(response.indexOf('||' != -1))
			{
				update = response.split('||');
				document.getElementById("prob1").innerHTML = update[1];
				document.getElementById("prob1").style.display = 'block';
			}
		}
  	}
	else
	{
		//document.getElementById("risultato_user").style.display = 'none';
	}
}

function colora(indice)
{
	document.getElementById("partita"+indice).style.background = "#94dbeb";
}

function scolora(indice)
{
	if(indice%2 == 0)
	{
		document.getElementById("partita"+indice).style.background = "#ddd";
	}
	else
	{
		document.getElementById("partita"+indice).style.background = "#fff";
	}
}

function prendi_prob(metodo, r_url, valore)
{
	sendRequest(metodo, r_url, valore);
}

