function montre_le_panier() {
	if (document.getElementById("iframe_panier")) {
		document.getElementById("iframe_panier").style.display = "block";	
	}
}

function masque_le_panier() {
	if (document.getElementById("iframe_panier")) {
		document.getElementById("iframe_panier").style.display = "none";
	}
}

function ajoute_produit_phare_au_panier(id) {
var el = null;	
	if (document.getElementById("iframe_produits").contentDocument) {
	el = eval("document.getElementById('iframe_produits').contentDocument.liste_des_produits.IDPPH" + id);
	}
	else if (document.frames[1].document) {
	el = eval("document.frames[1].document.liste_des_produits.IDPPH" + id);	
	}	
	// extrait l'idproduit + quantité	
	if (el && document.getElementById("iframe_produits").contentDocument) {
	document.getElementById("iframe_panier").contentDocument.location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
	else if (el && document.frames[1].document) {
	document.frames["popup_panier"].location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
}

function ajoute_au_panier(id) {
var el = null;	
	if (document.getElementById("iframe_produits").contentDocument) {
	el = eval("document.getElementById('iframe_produits').contentDocument.liste_des_produits.IDP" + id);
	}
	else if (document.frames[1].document) {	
	el = eval("document.frames[1].document.liste_des_produits.IDP" + id);	
	}
	// extrait l'idproduit + quantité
	if (el && document.getElementById("iframe_produits").contentDocument) {
	document.getElementById("iframe_panier").contentDocument.location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
	else if (el && document.frames[1].document) {
	document.frames["popup_panier"].location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
}

function ajoute_item_trouve_au_panier(id) {
var el = null;	
	if (document.getElementById("iframe_resultats").contentDocument) {
	el = eval("document.getElementById('iframe_resultats').contentDocument.liste_des_produits.IDP" + id);
	}
	else if (document.frames[1].document) {	
	el = eval("document.frames[1].document.liste_des_produits.IDP" + id);	
	}
	// extrait l'idproduit + quantité
	if (el && document.getElementById("iframe_resultats").contentDocument) {
	document.getElementById("iframe_panier").contentDocument.location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
	else if (el && document.frames[1].document) {
	document.frames["popup_panier"].location = "../produits/popup_panier.php?id=" + id + "&qty=" + el.value;
	montre_le_panier();
	}
}

function ajoute_pack_au_panier(idpack) {
var el = null;

	if (document.getElementById("iframe_packs").contentDocument) {
	el = eval("document.getElementById('iframe_packs').contentDocument.liste_des_packs.IDPACK" + idpack);
	}
	else if (document.frames[1].document) {
	el = eval("document.frames[1].document.liste_des_packs.IDPACK" + idpack);
	}
	// extrait l'idpack + quantité
	if (el && document.getElementById("iframe_packs").contentDocument) {
	document.getElementById("iframe_panier").contentDocument.location = "../produits/popup_panier.php?idpack=" + idpack + "&qtypack=" + el.value;
	montre_le_panier();
	}
	else if (el && document.frames[1].document) {
	document.frames["popup_panier"].location = "../produits/popup_panier.php?idpack=" + idpack + "&qtypack=" + el.value;
	montre_le_panier();
	}
}

function commander() {
masque_le_panier();
window.location = "commander.php";
}

function show_frames() {
var frm = document.frames;
alert("Nom : " + frm["popup_panier"].name);
alert("Location : " + frm["popup_panier"].location);
alert("SRC : " + frm["popup_panier"].src);
}
