function file(fichier)
{
	if(window.XMLHttpRequest) /*FIREFOX*/ xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) /*IE*/  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else return(false); 
	tmp = Math.random(); 
	xhr_object.open("GET", fichier, false); 
	xhr_object.send(null); 
	if(xhr_object.readyState == 4)
	 return(xhr_object.responseText);
	else 
	return(false);
}


function rnd() {
	ord=Math.random();
	ord=ord*10000000000000000000;
	return ord;
}

function writediv(div,texte)
{
	document.getElementById(div).innerHTML = texte;
}

function addToCard(lang,itemtoadd){

	if(texte = file('../panier/add.php?lang='+lang+'&item='+itemtoadd+'&rnd='+rnd())){	
	alert(texte);
}
}

function DeleteFromCard (lang,itemtodel){
	if(texte = file('../panier/delete.php?lang='+lang+'&item='+itemtodel+'&rnd='+rnd())){	
	writediv('monPanier',texte);
	}
}

function Return (lang,nba,nbb,idc){
	
	file('../panier/return.php?lang='+lang+'&nba='+nba+'&nbb='+nbb+'&idc='+idc+'&rnd='+rnd());
	window.location.href = "../panier/panier.php?lg="+lang;
}

function ChangePlace (myselect,myinput){
		var obj = document.getElementById(myselect);
		document.getElementById(myinput).value = obj.value;
}

	



