
function parcourrir_famille(ref)
{
	if(PMP.common.isUndefined(ref))
		return;
	
	famille_ref = ref;
	
	PMP.com.liste.showLoader('listeproduit');
	PMP.com.liste.refresh("listeproduit", {data:{famille:famille_ref}}, "produit", "famille", 1);
	
	var familles = PMP.dom.getElementsByMaskId('menu-%s', 'li');
	alert(count(familles));
}

function supprimer_famille_active(ref)
{
	var titreBox = "Modification d'une famille";
		
	if( PMP.common.isUndefined(ref) )
	{
		pmpAlert("La référence du produit est invalide.", titreBox, "erreur");
		return false;
	}		
	
	// ajout du produit au panier
	var ajax = new PMP.util.pmpAjax("", "POST");
	
	if(!ajax)
	{
		var msgbox = new PMP.util.pmpMsgBox("L'instanciation de la classe AJAX a échouée", "erreur", titreBox);
		return false;
	}
	
	ajax.appendData("action", "supprimer_famille_active");
	ajax.appendData("ref", ref);
		
	ajax.send({context:true});
	
	if(ajax.reponse.etat)
	{
		PMP.com.liste.refresh("listefamillesactives", "", "produit", "famille", 1);
	}
	
	return ajax.reponse;
}

function changeHref(listeId)
{
	var elements = PMP.dom.getElementsByMaskId("listearticles_panier_%i", "a");
	
	for(i=0; i<elements.length; i++)
	{
		elements[i].href = 'javascript:void(0);';
	}
	
	var elements = PMP.dom.getElementsByMaskId("wmpromo_panier_%i", "a");
	
	for(i=0; i<elements.length; i++)
	{
		elements[i].href = 'javascript:void(0);';
	}
	
	var elements = PMP.dom.getElementsByMaskId("wmnouv_panier_%i", "a");
	
	for(i=0; i<elements.length; i++)
	{
		elements[i].href = 'javascript:void(0);';
	}
}

function modifPrix()
{
	val = $("#select_taille option:selected").val();
	
	var tmp = val.split('_');
	
	if(tmp[1] == 0)
	{
		$("#option_"+tmp[0]).attr('selected', 'selected');
		modifPrix();
	}
	else
	{
		if(tmp[0] == 1)
		{
			$('#prix_taille').html($('#prix_enfant').val());
			$('#prix_base').html($('#prix_base_enfant').val());
		}
		else
		{
			$('#prix_taille').html($('#prix_adulte').val());
			$('#prix_base').html($('#prix_base_adulte').val());
		}
		
		$('#selected_taille').val(val);
	}
}

$(function() {
	if($.browser.msie)
	{
		$(".label_click").click(function () { 
	      var id = '#'+$(this).attr('for');
	      
	      	$(id).attr('checked', 'true');
	    });
    }
});