var sliderIntervalId = 0;
var sliderBottom = 0;
var sliding = false;
var slideSpeed = 10;

function Slide(id,param) {
  if(sliding) {
    return;
  }
  sliding = true;
  sliderIntervalId = setInterval('SlideDownRun(\''+id+'\','+param+')', 30);
}

function SlideDownRun(id) {
  slider = document.getElementById(id);
  if(sliderBottom <= -100) {
    sliding = false;
    slider.style.display = 'none';
    slider.style.bottom = '0';
    sliderBottom = 0;
    clearInterval(sliderIntervalId);
  }
  else {
    sliderBottom -= slideSpeed;
    if(sliderBottom < -100) {
      sliderBottom = -100;
    }
    slider.style.bottom = sliderBottom + 'px';
  }
}

  function ajouter_panier(ref_produit) {
    $("#panier").load("colonneDroitePanierDev.php", {
      action: "ajouter",
		  ref: ref_produit,
		  quantite: 1,
		  append: 1
    },
    function() {
      $("div[id^='prod"+ref_produit+"sep']").each(function(){
        $(this).load("MajProduitPanier.php?ref="+ref_produit, function() {
        document.getElementById('alertAj').style.display='block';
        setTimeoutId = setTimeout('Slide(\'alertAj\')', 2000);
        }
        );
      }
      );
    }
    );
 }

	function supprimer_panier(article_panier,ref_produit){
    $("#panier").load("colonneDroitePanierDev.php", {
      action: "supprimer",
      article: article_panier
    },
    function() {
      $("div[id^='prod"+ref_produit+"sep']").each(function(){
        $(this).load("MajProduitPanier.php?ref="+ref_produit, function() {
        document.getElementById('alertSup').style.display='block';
        setTimeoutId = setTimeout('Slide(\'alertSup\')', 2000);
        }
        );
      }
      );
    }
    );
  }

