function send_compare(id, action)
{
	var xhr_object = null;

	if (window.XMLHttpRequest) // Firefox
	   xhr_object = new XMLHttpRequest();
	else if (window.ActiveXObject) // Internet Explorer
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
	{ // XMLHttpRequest non supporté par le navigateur
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	   return;
	}

	var method = "GET";
	var filename = action + '.php';
	var data     = null;

	if (id != "")
	   data = "id=" + id;

	if (data != null)
	{
	   filename += "?"+data;
	   data      = null;
	}
	
	xhr_object.open(method, filename, true);

	xhr_object.onreadystatechange = function()
	{
	   if (xhr_object.readyState == 4)
	   {
		  var tmp = xhr_object.responseText.split(":");
		  //alert(tmp[0]);
	   }
	}

	if (method == "POST")
	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

	xhr_object.send(data);
	$('#comparatif_box').load('view_comparateur.php');
	if (action == 'add_comparatif')
		alert('Ce produit a bien été ajouté au comparateur.');
	else if (action == 'del_comparateur')
		alert('Ce produit a bien ete supprime du comparateur.');
	window.location.reload();
}

function clean_compare(session_id)
{
	var xhr_object = null;

	if (window.XMLHttpRequest) // Firefox
	   xhr_object = new XMLHttpRequest();
	else if (window.ActiveXObject) // Internet Explorer
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
	{ // XMLHttpRequest non supporté par le navigateur
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	   return;
	}

	var method = "GET";
	var filename = 'clean_comparateur.php';
	var data     = null;

	if (session_id != "")
	   data = "id=" + session_id;

	if (data != null)
	{
	   filename += "?"+data;
	   data      = null;
	}
	
	xhr_object.open(method, filename, true);

	xhr_object.onreadystatechange = function()
	{
	   if (xhr_object.readyState == 4)
	   {
		  var tmp = xhr_object.responseText.split(":");
		  //alert(tmp[0]);
	   }
	}

	if (method == "POST")
	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

	xhr_object.send(data);
	alert('Le comparateur a bien ete vide.');
	window.location.reload(true);
}
