// Select form small
$(document).ready(function() {
						   
	var okToToggle = true;
	$(".select-trigger").click(function() {
		okToToggle = false;
		$(this).next().slideToggle("fast", function(){
			okToToggle=true;
		});
	});
	$(document).click(function() {
		if(okToToggle) $(".select-items-wrapper").hide();	
	});
	$(".select-items-ul li").hover(function() {
		$(this).addClass("select-items-ul-li-item-hover");
		$(this).children("a").css({"color":"#FFFFFF", "text-decoration":"none"});
	}, function() {
		$(this).removeClass("select-items-ul-li-item-hover");
		$(this).children("a").css({"color":"#efd9a5"});
	});







	// Select form small
	var okToToggleSmall = true;
	$(".select-small-trigger").click(function() {
		okToToggleSmall = false;
		$(this).next().slideToggle("fast", function(){
			okToToggleSmall = true;
		});
	});
	$(document).click(function() {
							 
		if(okToToggleSmall) $(".select-small-items-wrapper").hide();	
	});
	$(".select-small-items-ul li").hover(function() {
		$(this).addClass("select-small-items-ul-li-item-hover");
		$(this).css({"color":"#FFFFFF", "text-decoration":"none"});
	}, function() {
		$(this).removeClass("select-small-items-ul-li-item-hover");
		$(this).css({"color":"#efd9a5"});
	});
	// Select and change first label small
	$(".select-small-item").click(function() {
		var label = $(this).parent().parent().prev();
		var selected_id = $(this).attr('id').replace('grupo-','');
		var selected_label = $(this).html();
		label.html(selected_label);
		$("#grupo").val(selected_id);
	});

});
