/*
 * 
 *  GESTION FAMILLE WEB + HOME CATEGORY
 * 
 */
/* Gestion des couleurs produit */ 
function gestionCouleurSmallView() {

	jQuery("div.couleur-produit li.toset").click(function(){
		var options = new Array();
		jQuery(this).attr("id").scan(/[\d]+/, function(match) { options.push(match[0]) });
		var lProductModelId = options[1]; 
		var lProductArticleId = options[2];
		var divImage = jQuery('#img-produit-'+lProductModelId);
		var divImageParent = divImage.parent();
		var divImageNew = jQuery('#produit-'+lProductArticleId+' div:first').clone();
		divImage.replaceWith(divImageNew);
		divImageParent.children('.imgProduit').attr('id','img-produit-'+lProductModelId+'');
		jQuery('#img-produit-'+lProductModelId+' .smallview-image:first').attr('src' , jQuery('#img-produit-'+lProductModelId+' .smallview-image:first').attr('id') );
		jQuery('#img-produit-'+lProductModelId+' .smallview-image').attr('id', '');
		jQuery('#prix-produit-'+lProductModelId).html(jQuery('#produit-'+lProductArticleId+' h5').html());

		var title = jQuery('#img-produit-'+lProductModelId+' img').attr('title');
		jQuery('#img-produit-'+lProductModelId+' img').attr('alt', '');
		var alt = jQuery('#img-produit-'+lProductModelId+' img').attr('alt');
		jQuery('#img-produit-'+lProductModelId+' img').attr('alt', '');
		
		Effect.Fade($('img-produit-'+lProductModelId), { duration: 0.5, from: 0.1, to: 1 });
		
		jQuery('#img-produit-'+lProductModelId+' img').attr('alt', alt);
		jQuery('#img-produit-'+lProductModelId+' img').attr('title', title);
		initQL(jQuery('#img-produit-'+lProductModelId));
		if(jQuery.browser.msie && jQuery.browser.version < 7){
			enableAlphaImages();
		}
        jQuery('#' + jQuery(this).parent().parent().attr('id') + ' .actived').removeClass('actived');
        jQuery(this).addClass('actived');
		return false;
	});
	
	jQuery("div.couleur-produit li.toset").mouseover(function(){
		var attributes = new Array();
		jQuery(this).parent().parent().parent().addClass("overcouleur");
		jQuery(this).attr("id").scan(/[\d]+/, function(match) { attributes.push(match[0]) });
		var productId = attributes[1];
		jQuery('.taille-produit-' + productId ).html(jQuery(this).children(".couleur-tailles:first").html() );
		jQuery('.taille-produit-' + productId ).show();
	});
	
	jQuery("div.couleur-produit li.toset").mouseout(function(){
		var options = new Array();
		jQuery(this).parent().parent().parent().removeClass("overcouleur");
		jQuery(this).attr("id").scan(/[\d]+/, function(match) { options.push(match[0]) });
		var productId = options[1];
		jQuery('.taille-produit-' + productId ).hide();

		
	});
	/*
	jQuery("ol.liste-produit li .imgProduit a").click(function(e){
		setCatContextUrlProductRedirect(this);
	});
	
	jQuery("ol.liste-produit li h5 a").click(function(e){
		setCatContextUrlProductRedirect(this);
	});
	
	jQuery("ol.liste-produit li h4 a").click(function(e){
		setCatContextUrlProductRedirect(this);
	});
	*/
	jQuery("li.toset").removeClass('toset');
}



