$(document).ready(function(){

	/****************************************************
	*	Gère la combo-box du Formulaire de Contact 
	****************************************************/
	
	// on ouvre #contactEmails quand on clique
	$('#popinFooter .cmb p.select').unbind('click');
	
		$("#popinFooter .cmb p.select").bind('click',function(){	
		var etatD = $(this).next().css('display').toLowerCase();
		if(etatD == "none"){
			$('#contactEmails').hide();
			$(this).next().show();
		}else{
			$(this).next().hide();
		}
		return false;
	});
	
	// Quand un élément de #contactEmails est cliqué...
	$('#contactEmails ul li a').unbind();			
	$('#contactEmails ul li a').bind('click',function(){	
		// On regarde sa classe (l'email)...
		var idBloc = $(this).attr('class');
		// Et on remplit le champ hidden avec		
		$('#fcontact').attr('value', idBloc);
		
		// Puis on passe ce champ dans le span de.cmb
		var label = $(this).html();
		var select = $(this).parent().parent().parent().prev();
		$('span',select).html(label);	
		select.next().hide();
		return false;			
	});
	
	
	
	
});
