/*
 *  Ajout client-side basket - XG - 01/2008
 *  Ajout tracking Yahoo - XG - 03/2009 
 *  Ajout fonctions MEA - RVI - 20/12/2009
 *  Modif de updateprice() ajout d'un espace entre les milliers et les centaines et remplacement du point par la virgule - RmnX - 21/05/2010
 *  PopUp centrée - XG - 06/07/2010
 */

function CenteredPopup(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
 
// Ouvertur de popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Gestion d'affichage des layers d'aide
function openHelp(nameOfLayer){
	hlp_layer = document.getElementById(nameOfLayer).style;

	if (hlp_layer.display == "none" || hlp_layer.display == ""){
		hlp_layer.display = "block";
	}
}
function closeHelp(nameOfLayer){
	hlp_layer = document.getElementById(nameOfLayer).style;

	if (hlp_layer.display == "block"){
		hlp_layer.display = "none";
	}
}

function simulComparateur_old(type){
	window.location.href = "comparateur-"+type+"-moins.htm";
}

function simulComparateur(formName,str_w1){
      
          var page ='';
      
          var numberCheck=0;
		var choix = document.forms[formName].cases;
		
		for (i=0; i<choix.length; i++){
			if(choix[i].checked == true ){
				numberCheck++;
                        page = page + choix[i].value +'$';
			}
		}
		
           page = page.substr(0,page.length-1);




	window.location.href = "comparateur.asp?w1="+ str_w1 +"&c1="+page ;
}



// Gestion d'affichage des layers du panier
function openPanier(){
	min_layer = document.getElementById("layer_panier").style;
	
	document.getElementById("panier_open").style.backgroundImage = "url(http://img.plantes-et-jardins.com/nav/panier-layer-on.gif)";

	if (min_layer.display == "none"){
		min_layer.display = "";
	}
}

function closePanier(){
	min_layer = document.getElementById("layer_panier").style;
		
	document.getElementById("panier_open").style.backgroundImage = "url(http://img.plantes-et-jardins.com/nav/panier-layer.gif)";

	if (min_layer.display == ""){
		min_layer.display = "none";
	}
}



// Gestion d'affichage des layers dans les listes produit mode diapo
function openLayer(layerPath){
	min_layer = document.getElementById("layer_detail_"+layerPath).style;

	if (min_layer.display == "none"){
		min_layer.display = "";
	}
}

function closeLayer(layerPath){
	min_layer = document.getElementById("layer_detail_"+layerPath).style;

	if (min_layer.display == ""){
		min_layer.display = "none";
	}
}




function openCarrousel(carrouselPath){
	min_carrousel = document.getElementById("min"+carrouselPath).style;

	if (min_carrousel.display == "none"){
		min_carrousel.display = "";
	}
}

function closeCarrousel(carrouselPath){
	min_carrousel = document.getElementById("min"+carrouselPath).style;

	if (min_carrousel.display == ""){
		min_carrousel.display = "none";
	}
}



function openRub(rubNum){
	search_tab = document.getElementById("s_tab"+rubNum).style;
	search_advanced = document.getElementById("s_advanced"+rubNum).style;
	search_img = document.images["s_arrow"+rubNum];

	if (search_tab.display == ""){
		search_tab.display = "none";
		search_advanced.display = "none";
		search_img.src = "http://img.plantes-et-jardins.com/search-int-down.gif";
	}else{
		search_tab.display = "";
		search_advanced.display = "";
		search_img.src = "http://img.plantes-et-jardins.com/search-int-up.gif";
	}
}

function actionFiltre(){
	a_filtre = document.getElementById("new_filtre").style;
	off_filtre = document.getElementById("filtre_off").style;
	on_filtre = document.getElementById("filtre_on").style;

	if (a_filtre.display == "none"){
		a_filtre.display = "";
		off_filtre.display = "none";
		on_filtre.display = "";
	}else{
		a_filtre.display = "none";
		off_filtre.display = "";
		on_filtre.display = "none";
	}
}




function openSouffle(souffleNum){
	if ( souffleNum == 1){
		document.getElementById("s_souffle_on_1").style.display = '';
		document.getElementById("s_souffle_1").style.display = 'none';
		document.getElementById("s_result_1").style.display = '';
		
		document.getElementById("s_souffle_on_2").style.display = 'none';
		document.getElementById("s_souffle_2").style.display = '';
		document.getElementById("s_result_2").style.display = 'none';
		
		document.getElementById("s_souffle_on_3").style.display = 'none';
		document.getElementById("s_souffle_3").style.display = '';
		document.getElementById("s_result_3").style.display = 'none';
	}
	if ( souffleNum == 2){
		document.getElementById("s_souffle_on_1").style.display = 'none';
		document.getElementById("s_souffle_1").style.display = '';
		document.getElementById("s_result_1").style.display = 'none';
		
		document.getElementById("s_souffle_on_2").style.display = '';
		document.getElementById("s_souffle_2").style.display = 'none';
		document.getElementById("s_result_2").style.display = '';
		
		document.getElementById("s_souffle_on_3").style.display = 'none';
		document.getElementById("s_souffle_3").style.display = '';
		document.getElementById("s_result_3").style.display = 'none';
	}
	if ( souffleNum == 3){
		document.getElementById("s_souffle_on_1").style.display = 'none';
		document.getElementById("s_souffle_1").style.display = '';
		document.getElementById("s_result_1").style.display = 'none';
		
		document.getElementById("s_souffle_on_2").style.display = 'none';
		document.getElementById("s_souffle_2").style.display = '';
		document.getElementById("s_result_2").style.display = 'none';
		
		document.getElementById("s_souffle_on_3").style.display = '';
		document.getElementById("s_souffle_3").style.display = 'none';
		document.getElementById("s_result_3").style.display = '';
	}
}

function goToCompare(formName, page){
		
		var numberCheck=0;
		var choix = document.forms[formName].cases;
		
		for (i=0; i<choix.length; i++){
			if(choix[i].checked == true ){
				numberCheck++;
                        page = page + choix[i].value +'$';
			}
		}
		
           page = page.substr(0,page.length-1);

		if(numberCheck<5){
			if(numberCheck<2){
				alert('Vous devez choisir au moins 2 produits');
			}else{
				//window.location.href = page;
				window.location= page;

			}
		}else{
			alert('Vous avez choisi '+numberCheck+' produit(s), merci d\'en sélectionner 4 maximum');
		}
		
		
}

function testCheckBox(formName, pCheckOn){
		
		var numberCheck=0;
		var choix = document.forms[formName].cases;
		
		for (i=0; i<choix.length; i++){
			if(choix[i].checked == true ){
				numberCheck++;
			}
		}
		
		if(numberCheck>4){
			alert('Vous avez choisi '+numberCheck+' produit(s), merci d\'en sélectionner 4 maximum');
			choix[pCheckOn].checked = false;
		}
}

function caddie_openTr(trNum){
	tr_name = document.getElementById("tr_open"+trNum).style;
	tr_img = document.images["pdt_assoc"+trNum];
	//tr_color = document.getElementById('pdt_td_assoc'+trNum);

	if (tr_name.display == "none"){
		tr_name.display = "";
		tr_img.src = "http://img.plantes-et-jardins.com/search-int-up.gif";
		//tr_color.className = 'pdt_assoc_td_on';
	}else{
		tr_name.display = "none";
		tr_img.src = "http://img.plantes-et-jardins.com/search-int-down.gif";
		//tr_color.className = 'pdt_assoc_td';
	}
}

function caddie_upQte(qteNum){
	document.formcaddie["qte"+qteNum].value++;
	Submitpanier(-1);
}


function caddie_dwQte(qteNum){
	if(document.formcaddie["qte"+qteNum].value<2){
		alert('Minimum 1 produit');
	}else{
		document.formcaddie["qte"+qteNum].value--;
		Submitpanier(-1);
	}
}


function adLivraison(){

	liv = document.getElementById("ad_livraison").style;
	l_same = document.getElementById("liv_same_off").style;
	l_sameon = document.getElementById("liv_same").style;
	l_same_cont = document.getElementById("same_content");
	l_img = document.images["liv_arrow"];
	
	if (liv.display == "none"){
		liv.display = "";
		l_same.display = "";
		l_sameon.display = "none";
		l_same_cont.className = 'same';
		l_img.src = "http://img.plantes-et-jardins.com/search-int-up.gif";
		document.form1.same.checked = false;
	}else{
		liv.display = "none";
		l_same.display = "none";
		l_sameon.display = "";
		l_same_cont.className = 'same_off';
		l_img.src = "http://img.plantes-et-jardins.com/search-int-down.gif";
		document.form1.same.checked = true;
	}
}





function openNavMag(numNav, pClass){

	nav_ttl = document.getElementById("nav_ttl"+numNav).style;
	nav_bc = document.getElementById("nav_bc"+numNav).style;
	nav_img = document.images["up_"+numNav+"_"+pClass];
	
	if (nav_bc.display == "none"){
		nav_bc.display = "";
		nav_img.src = "http://img.plantes-et-jardins.com/navg-bg-close-"+pClass+".gif";
	}else{
		nav_bc.display = "none";
		nav_img.src = "http://img.plantes-et-jardins.com/navg-bg-open-"+pClass+".gif";
	}
}

function expandContener(numNumber, numEx){
	ex_cont = document.getElementById("expand_content_"+numEx).style;
	ex_img = document.images["expand_click_"+numEx];

	if (ex_cont.display == ""){
		ex_cont.display = "none";
		ex_img.src = "http://img.plantes-et-jardins.com/arrow-soufflet-down.gif";
	}else{
		ex_cont.display = "";
		ex_img.src = "http://img.plantes-et-jardins.com/arrow-soufflet-up.gif";
	}
	
	expandException(numNumber, numEx);
}


function expandException(numNumber, numOfEx){
	for (i=1; i<numNumber+1; i++){
		if(i!=numOfEx){
			document.getElementById("expand_content_"+i).style.display = "none";
			document.images["expand_click_"+i].src = "http://img.plantes-et-jardins.com/arrow-soufflet-down.gif";
		}
	}
}


function expandAll(numOfEx){
	for (i=1; i<numOfEx+1; i++){
		document.getElementById("expand_content_"+i).style.display = "";
		document.images["expand_click_"+i].src = "http://img.plantes-et-jardins.com/arrow-soufflet-up.gif";
	}
}

function retractAll(numOfEx){
	for (i=1; i<numOfEx+1; i++){
		document.getElementById("expand_content_"+i).style.display = "none";
		document.images["expand_click_"+i].src = "http://img.plantes-et-jardins.com/arrow-soufflet-down.gif";
	}
}


function expandFiche(numNumber){
	ex_cont = document.getElementById("expand_content_"+numNumber).style;
	ex_img = document.images["expand_click_"+numNumber];
	
	if (ex_cont.display == "" || ex_cont.display == "block"){
		ex_cont.display = "none";
		ex_img.src = "http://img.plantes-et-jardins.com/arrow-soufflet-down.gif";
	}else{
		ex_cont.display = "block";
		ex_img.src = "http://img.plantes-et-jardins.com/arrow-soufflet-up.gif";
	}
}

function openLegend(pLegend){
	document.getElementById("legend"+pLegend).style.display = "";
}
function closeLegend(pLegend){
	document.getElementById("legend"+pLegend).style.display = "none";
}



// Gestion de l'ouverture des layers centraux
function openMiddleLayer(nameOfDiv, catOfDiv){
	
	layer_id = document.getElementById(nameOfDiv).style;

	if (layer_id.display == "block"){
		layer_id.display = "none";
	}else{
		layer_id.display = "block";
	}
	
	if(nameOfDiv=="opac_friend"){
		document.getElementById("layer_alertfriend").style.display="block";
		document.getElementById("layer_alertfriend_ok").style.display="none";
	}
	
	if(catOfDiv=="vegetal"){
		document.getElementById("layer_addtocaddie_vegetal").style.display="block";
		document.getElementById("layer_addtocaddie_manuf").style.display="none";
	}
	
	if(catOfDiv=="manuf"){
		document.getElementById("layer_addtocaddie_manuf").style.display="block";
		document.getElementById("layer_addtocaddie_vegetal").style.display="none";
	}
}

function switchFriend(){
	
	layer_form  = document.getElementById("layer_alertfriend").style;
	layer_valid = document.getElementById("layer_alertfriend_ok").style;

	if (layer_valid.display == "" || layer_valid.display == "none"){
		layer_form.display = "none";
		layer_valid.display = "block";
	}else{
		layer_form.display = "block";
		layer_valid.display = "none";
	}
}



// Gestion de l'ouverture des "Mais aussi" dans les idÃ©es/histoire/dÃ©tail

function expandMore(numNumber, numEx){
	ex_cont   = document.getElementById("expand_content_"+numEx).style;
	lnk_cont  = document.getElementById("link_"+numEx).style;

	if (ex_cont.display == ""){
		ex_cont.display = "none";
		lnk_cont.fontWeight = "normal";
	}else{
		ex_cont.display = "";
		lnk_cont.fontWeight = "bold";
	}
	
	switchMore(numNumber, numEx);
}


function switchMore(numNumber, numEx){
	
	for (i=1; i<numNumber+1; i++){
		if(i!=numEx){
			document.getElementById("expand_content_"+i).style.display = "none";
			document.getElementById("link_"+i).style.fontWeight = "normal";
		}
	}
}


/** ZOOM **/

zoom_temp = 0;

function zoomInit(numOfEx, pPath){

	document.images["img_zoom"].src="http://img.plantes-et-jardins.com/"+pPath+"/zoom0.jpg";
	
	for(i=1; i<numOfEx+1; i++){
		document.images["vgn"+i].src="http://img.plantes-et-jardins.com/"+pPath+"/vgn"+i+".jpg";
	}
	
	zoom_temp = 0;
}

function swapZoom(zNum){
	zoom_img = document.images["img_zoom"];
	vgn_img = document.images["vgn"+zNum];
	
	var chaine_zoom = zoom_img.src.replace(/zoom/, "vgn");
	var chaine_vgn = vgn_img.src.replace(/vgn/, "zoom");
	
	if(zoom_temp!=zNum){
		zoom_img.src = chaine_vgn;
		//vgn_/img.src = chaine_zoom;
	}
	
	zoom_temp = zNum;
}

function swapZoom_cat4(zNum){
	zoom_img = document.images["img_zoom"];
	//vgn_img = document.images["vgn"+zNum];
	zoom_img.src = zNum;
	
      /*var chaine_zoom = zoom_img.src.replace(/zoom/, "vgn");
	var chaine_vgn = vgn_img.src.replace(/vgn/, "zoom");
	
	if(zoom_temp!=zNum){
		
		
	}
	
	zoom_temp = zNum;
*/
}

function zoomOver(zNum){
	
	p_img = document.images["img_page"];
	vgn_img = document.images["vgn_page"+zNum];
	
	var chaine_vgn = vgn_img.src.replace(/vgn/, "zoom");
	
	p_img.src = chaine_vgn;
	
}

function zoomOver_cat4(zNum){
	
	p_img = document.images["img_page"];
	//vgn_img = document.images["vgn_page"+zNum];
	
	//var chaine_vgn = vgn_img.src.replace(/vgn/, "zoom");
	
	//p_img.src = chaine_vgn;
      p_img.src = zNum;

	
}

function zoomOut(indeximg){
	zoom_img = document.images["img_page"].src = "http://photos.plantes-et-jardins.com/" + indeximg;
}







// Gestion de l'ouverture des onglets dans les fiches produit
function swapContener(numberOfDiv, numOfDivOn){
	
	for(i=1; i<numberOfDiv+1; i++){
		if(numOfDivOn==i){
			document.getElementById("ongContener"+i).style.display = "block";
			document.getElementById("ong"+i).className = "onglet_on";
		}else{
			document.getElementById("ongContener"+i).style.display = "none";
			document.getElementById("ong"+i).className = "onglet_off";
		}
	}
	
}

function launch(url, largeur, hauteur)
  {
         var param = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+ largeur +',height='+ hauteur+'' ;
         fenetre=window.open(url, "pj", param) ;
  }


/* Simple AJAX Code-Kit (SACK) */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */

function sack(file){
	this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
	this.requestFile = file;
	this.method = "POST";
	this.URLString = "";
	this.encodeURIString = true;
	this.execute = false;

	this.onLoading = function() { };
	this.onLoaded = function() { };
	this.onInteractive = function() { };
	this.onCompletion = function() { };

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err) {
				this.xmlhttp = null;
			}
		}
		if(!this.xmlhttp && typeof XMLHttpRequest != "undefined")
			this.xmlhttp = new XMLHttpRequest();
		if (!this.xmlhttp){
			this.failed = true; 
		}
	};
	
	this.setVar = function(name, value){
		if (this.URLString.length < 3){
			this.URLString = name + "=" + value;
		} else {
			this.URLString += "&" + name + "=" + value;
		}
	};
	
	this.encVar = function(name, value){
		var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
	return varString;
	};
	
	this.encodeURLString = function(string){
		varArray = string.split('&');
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split('=');
			if (urlVars[0].indexOf('amp;') != -1){
				urlVars[0] = urlVars[0].substring(4);
			}
			varArray[i] = this.encVar(urlVars[0],urlVars[1]);
		}
	return varArray.join('&');
	};
	
	this.runResponse = function(){
		eval(this.response);
	};
	
	this.runAJAX = function(urlstring){
		this.responseStatus = new Array(2);
		if(this.failed && this.AjaxFailedAlert){ 
			alert(this.AjaxFailedAlert); 
		} else {
			if (urlstring){ 
				if (this.URLString.length){
					this.URLString = this.URLString + "&" + urlstring; 
				} else {
					this.URLString = urlstring; 
				}
			}
			if (this.encodeURIString){
				var timeval = new Date().getTime(); 
				this.URLString = this.encodeURLString(this.URLString);
				this.setVar("rndval", timeval);
			}
			if (this.element) { this.elementObj = document.getElementById(this.element); }
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					var totalurlstring = this.requestFile + "?" + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
				}
				if (this.method == "POST"){
  					try {
						this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
					} catch (e) {}
				}

				this.xmlhttp.send(this.URLString);
				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState){
						case 1:
							self.onLoading();
						break;
						case 2:
							self.onLoaded();
						break;
						case 3:
							self.onInteractive();
						break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;
							self.onCompletion();
							if(self.execute){ self.runResponse(); }
							if (self.elementObj) {
								var elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							self.URLString = "";
						break;
					}
				};
			}
		}
	};
this.createAJAX();
}

/************************************************************************************************************

based on flyingbasket
Alf Magne Kalleland
(C) www.dhtmlgoodies.com, March 2006

************************************************************************************************************/

var url_addProductToBasket = '/include/addProduct.asp';
var ajaxObjects = new Array();

function get_var(id_var)
{
  var quantity = 1;
  
  if( document.getElementById('select1') ) {
    quantity = document.getElementById('select1').options[document.getElementById('select1').selectedIndex].value;  // catalogue 4
  }
  ajaxAddProduct(id_var,quantity);	
  openMiddleLayer('opac_addtocaddie');  
}

function showAjaxBasketContent(ajaxIndex)
{
	// Getting a reference to the shopping cart items table
	var itemBox = document.getElementById('shopping_cart_items');
	
	var productItems = ajaxObjects[ajaxIndex].response.split('|||');	// Breaking response from Ajax into tokens
	
	if(document.getElementById('shopping_cart_items_product' + productItems[0])){	// A product with this id is allready in the basket - just add number items
		var row = document.getElementById('shopping_cart_items_product' + productItems[0]);
		var items = row.cells[0].innerHTML /1;
    var unitprice = productItems[2];// row.cells[3].innerHTML / items; // retrouve le prix unitaire
		items = items + (productItems[3]/1);  // rajoute la quantité voulue
		row.cells[0].innerHTML = items;
		row.cells[3].innerHTML = (items * unitprice).toFixed(2); // met à jour le total de ligne	
	}
  else
  {	// Product isn't allready in the basket - add a new row
		var tr = itemBox.insertRow(-1);
		tr.id = 'shopping_cart_items_product' + productItems[0];
		tr.vAlign = "top";
		
		var td = tr.insertCell(-1);
		td.innerHTML = productItems[3]; 	// Number of items     '1'
		td.className = "csbasketbold";
	
 		var td = tr.insertCell(-1);
		td.innerHTML = '&nbsp;-&nbsp;';
 		td.className = "csbasketbold";

		var td = tr.insertCell(-1);
		td.innerHTML = productItems[1]; 	// Description
		
		var td = tr.insertCell(-1);
		td.innerHTML = (productItems[2] * productItems[3]).toFixed(2); 	// Price	(on reprend le prix; cas des prix dégressifs)
		td.className = "csbasketbold";

 		var td = tr.insertCell(-1);
		td.innerHTML = '&euro;';
 		td.className = "csbasketbold";
	} 

	updateTotalPrice();
	
	ajaxObjects[ajaxIndex] = false;		
	
}

function updateTotalPrice()
{
	var itemBox = document.getElementById('shopping_cart_items');
	// Calculating total price and showing it below the table with basket items
	var totalPrice = 0;
	var total_display_tmp;
	var total_display;
	if(document.getElementById('shopping_cart_totalprice')){
	
		for(var no=0;no<itemBox.rows.length;no++){
			totalPrice = totalPrice + ( 1.0 * itemBox.rows[no].cells[3].innerHTML.replace(",","."));			
		}	
		
		total_display = totalPrice.toFixed(2).replace(".",",");

		if (total_display.length > 6){
			total_display_tmp = total_display.substr(0,total_display.length-6) + "&nbsp;" + total_display.substr(total_display.length-6);
			total_display = total_display_tmp;
		}

		document.getElementById('shopping_cart_totalprice').innerHTML = itemBox.rows.length + "&nbsp;art.&nbsp;-&nbsp;" + total_display + "&nbsp;&euro;";
		
	}		
}

function ajaxAddProduct(productId,qty)
{
	var ajaxIndex = ajaxObjects.length;
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = url_addProductToBasket;	// Saving product in this file
	ajaxObjects[ajaxIndex].setVar('productId',productId);
	ajaxObjects[ajaxIndex].setVar('qty',qty);
	ajaxObjects[ajaxIndex].onCompletion = function(){ showAjaxBasketContent(ajaxIndex); };	// Specify function that will be executed after file has been found
	ajaxObjects[ajaxIndex].runAJAX();		// Execute AJAX function		
}

function csbasket_insert(idvar,descr,qty,rowamount)
{
  	// Getting a reference to the shopping cart items table
  	var itemBox = document.getElementById('shopping_cart_items');

		var tr = itemBox.insertRow(-1);
		tr.id = 'shopping_cart_items_product' + idvar;
		tr.vAlign = "top";
		
		var td = tr.insertCell(-1);
		td.innerHTML = qty; 	// Number of items
		td.className = "csbasketbold";
	
 		var td = tr.insertCell(-1);
		td.innerHTML = '&nbsp;-&nbsp;';
 		td.className = "csbasketbold";

		var td = tr.insertCell(-1);
		td.innerHTML = descr; 	// Description
		
		var td = tr.insertCell(-1);
		td.innerHTML = rowamount.toFixed(2); 	// Price	
		td.className = "csbasketbold";

 		var td = tr.insertCell(-1);
		td.innerHTML = '&euro;';
 		td.className = "csbasketbold";

}

// Liens pour catalogue 4
function getParamValue(param,url)
{
    var u = url == undefined ? document.location.href : url;
    var reg = new RegExp('(\\?|&|^)'+param+'=(.*?)(&|$)');
    matches = u.match(reg);
    if (matches != null){
    	return matches[2] != undefined ? decodeURIComponent(matches[2]).replace(/\+/g,' ') : '';
	}else{
		return '';
	}
}

function gotoCat4(id){
	
	var chemin, w1, sec ;
	w1 = getParamValue('w1');
	sec = getParamValue('id_sections');
	if(w1==''){
		chemin = sec;
	}else{
		chemin = w1+'$'+sec;
	}
	var link = "/catalogue/catalogue4.asp?id_variations="+id+"&w1="+chemin;
	//alert(link);
	window.parent.location.href = link;
}

// Yahoo
var ysm_accountid  = "1N7NPKTJ047IKRVV4OOLT3DE5UC";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv1.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
