$(document).ready(function() {

$("#header_nav").hover(
  function () {
    $('#cart_block').show("slow");
  },
  function () {
    //$('#cart_block').show("slow");
  }
);

$("#cart_block").hover(
  function () {
    $('#cart_block').show("slow");
  },
  function () {
    $('#cart_block').hide("slow");
  }
);

if( $.browser.msie && $.browser.version<7 ) 
{
  // fix css background pngs
	$('span.produit_epuise').each(function(){
		var bgIMG = $(this).css('background-image');
		if(bgIMG.indexOf(".png")!=-1){
			var iebg = bgIMG.split('url("')[1].split('")')[0];
			jQuery(this).css('background-image', 'none');
			jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
		}
	});
}
  
  // activé pour changer la couleur de la typo d'un element du menu gauche
 $("ul.tree > li").each(function (i) 
 {    
    i = i+1;
    if (i == 1)
    {
      // met la typo en rouge sur la categorie ete 2010
      $(this).addClass('typo_rouge');
      var a = $(this).find('a');
      
      // alert($(this + " a").attr('href'));
      var j = 0;
      jQuery.each(a, function() {
        j = j+1;
        href = $(this).attr('href');
        /*
        if (j == 1)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/195-pulls');
        }
        */
        if (href.search("/194") > 0)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/205-robes');
        }
    });

     // 
      
    }
  
    if (i == 2)
    {
      $(this).addClass('typo_grise');
      var a = $(this).find('a');
      // change l'url pour l'accueil de la categorie hiver 2009
      var j = 0;
      jQuery.each(a, function() {
        j = j+1;
        href = $(this).attr('href');
        /*
        if (j == 1)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/112-pulls');
        }
        */
        if (href.search("/192") > 0)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/112-pulls');
        }
        
    });      
    }
    
    // irresistibles
    if (i == 4)
    {
      var a = $(this).find('a');
      
      // change l'url pour l'accueil de la rubrique 
      var j = 0;
      jQuery.each(a, function() {
        j = j+1;
        
        href = $(this).attr('href');
        /*
        if (j == 1)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/168-tee-shirts');
        }
        
        if (j == 2)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/168-tee-shirts');
        }
        */
        
        if (href.search("/208") > 0)
        {
          // $(this).attr('href','http://www.devernois.fr/eboutique/168-tee-shirts');
          $(this).attr('href','http://www.devernois.fr/eboutique/129-pulls-');
          
          // on fixe le nom de la rubrique en dur
          $(this).html("IRRESISTIBLES<br /><span style='font-size: 10px!important;'>Saisons anciennes d&eacute;marqu&eacute;es</span>");
        }
        
        if (href.search("/210") > 0)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/168-tee-shirts');
        }
        
        if (href.search("/209") > 0)
        {
          $(this).attr('href','http://www.devernois.fr/eboutique/129-pulls-');
        }     
    });      
    }
    
    if (i == 3)
    {
      var a = $(this).find('a');
      
      var j = 0;
      jQuery.each(a, function() {
      j = j+1;
      
      href = $(this).attr('href');
      // ajout du logo D+ sur la catégorie D+
      
      if (href.search("/215") > 0)
      // if (href.search("/215") > 0)
      {
        $(this).html("D+<br /><span style='font-size: 10px!important;'>S&eacute;lection grandes tailles</span>");
        // $(this).html("<div style='width: 40px; height: 40px; height: 25px; clear: both;'><img src='/themes/devernois/img/LogoD+.jpg' /></div>");
      }
     });      
    }
    /*
    if (i == 4)
    {
      // met la typo en rouge sur la categorie ete 2010
      $(this).addClass('typo_verte');
      var a = $(this).find('a');
      
      // alert($(this + " a").attr('href'));
      var j = 0;
      jQuery.each(a, function() {
        j = j+1;
        href = $(this).attr('href');

    });

     // 
      
    }
    */
  

 });
 /*
 */

});

