function showProductOnglet(id) {
 thosId	= '#'+id;
	
 $$('.onglet_over').each(function(item) {
  item.writeAttribute('class', 'onglet');
 });
 $$(thosId).each(function(item) {
  item.writeAttribute('class', 'onglet_over');
 });
	
 $$('.onglet_content_sub').each(function(item) {
  item.writeAttribute('class', 'dnone onglet_content_sub');
 });
 thisId	= thosId+'_content';
 $$(thisId).each(function(item) {
  item.writeAttribute('class', 'onglet_content_sub');
 });
}

function  setHomeSlide(num) {
 maClasse	= 'home_slide_'+num;
 $$('#home_slide').each(function(item) {
  item.writeAttribute('class', maClasse);
 });
 $$('#home_slide a.hover').each(function(item) {
  item.removeClassName('hover');
 });
	
 if (num == 1)
  $$('#home_slide a.un').each(function(item) {
   item.addClassName('hover');
  });
 else if (num == 2)
  $$('#home_slide a.deux').each(function(item) {
   item.addClassName('hover');
  });
 else if (num == 3)
  $$('#home_slide a.trois').each(function(item) {
   item.addClassName('hover');
  });
 else if (num == 4)
  $$('#home_slide a.quatre').each(function(item) {
   item.addClassName('hover');
  });
}

function changeVisu(newSrc) {
 $$('.cur_img_produit').each(function(item) {
  item.writeAttribute('src', newSrc);
 });
}

var LightBox = new Object();
LightBox = {
    
 show : function(url) {
  var hauteur = document.body.getHeight();
  var largeur = document.body.getWidth();
  var content = '<div id="lightbox"><div id="lightbox_background" style="height:'+hauteur+'px; width:'+largeur+'px;" onclick="LightBox.close(); return false;"></div><div id="lightbox_content" onclick="LightBox.close(); return false;"><img src="'+url+'" /><span id="lightbox_back">Revenir à la page produit</span></div></div>';
  document.body.insert({
   top:content
  });
 },
    
 close: function ()
 {
  $('lightbox').remove();
 }
    
}

function switchOption(selectToChange, indexToUpdate, optionToActivate) {
 document.getElementById(selectToChange).selectedIndex = indexToUpdate;
 var optionToActivateJS = document.getElementById(optionToActivate);
 var optionToActivate = $(optionToActivateJS);
 $$('li.associated-product').each(function(item) {
  item.removeClassName('option-active');
  item.addClassName('option-inactive');
 });
 $(optionToActivate).removeClassName('option-inactive');
 $(optionToActivate).addClassName('option-active');
}
