function executeFilterEventList(typeView){
	
	if(typeView){
		tipoView = typeView;
		//INVERTO I PULSANTI
		if(tipoView=="lists"){
			$('.lista1').attr("id", "lista1");
			$('.lista1').attr("class", "");
			$('#lista2').attr("class", "lista2");
			$('#lista2').attr("id", "");
			
			$('#tipoView').val('lists');
		}else{
			$('.lista2').attr("id", "lista2");
			$('.lista2').attr("class", "");
			$('#lista1').attr("class", "lista1");
			$('#lista1').attr("id", "");
			
			$('#tipoView').val('details');
		}
	}else{	
		tipoView = $('#tipoView').val();
	}
	
	//RACCOLGO I DATI

	data = "ajax=yes&viewType="+tipoView;

	if($('#check_citta').is(':checked')){
		city = $('#input_citta').val();
		data += "&city="+city;
	}
	if($('#check_locale').is(':checked')){
		locale = $('#input_locale').val();
		data += "&locale="+locale;
	}
	if($('#group').val()!==""){
		group = $('#group').val();
		if(group!=""){
			data += "&group="+group;
		}
	}
	if($('#check_date').is(':checked')){
		dateFrom = $('#dateFrom').val();
		dateTo = $('#dateTo').val();
		data += "&dateFrom="+dateFrom;
		data += "&dateTo="+dateTo;
	}
	if($('#check_dj').is(':checked')){
		dj = $('#input_dj').val();
		data += "&dj="+dj;
	}
	if($('#check_vocalist').is(':checked')){
		vox = $('#input_vocalist').val();
		data += "&vox="+vocalist;
	}
	if($('#check_liveBand').is(':checked')){
		liveBand = $('#input_liveBand').val();
		data += "&liveBand="+liveBand;
	}
	if($('#check_animazione').is(':checked')){
		animazione = $('#input_animazione').val();
		data += "&animazione="+animazione;
	}
	$("#ajax-loader").css("display", "block");
	$("#contenitoreListaEventi").html("");
	 //DA METTERE CENTRATO IN VERTICALE E ORIZZONTALE
	$.ajax({
		   type: "GET",
		   url: URL_ROOT+"ajax_engine.php?page=bl-eventi.php",
		   data: data,
		   success: function(msg){			   			   $("#ajax-loader").css("display", "none");
						   $('#contenitoreListaEventi').html(msg);
				
				$('#contenitoreListaEventi').show();
		   }
	 });
	return false;
}

function setFilterGroup(group){
	//tolgo la classe alla label selezionata
	$('.eventi .disco .selected').attr("class", "");
	if(group==""){
		$('.eventi .disco #all').attr("class", "selected");
		//setto "vuoto" nel campo nascosto(X la ricerca ajax)
		$('#group').val("");
	}else{
		//setto l'id del gruppo scelto nel campo nascosto(X la ricerca ajax)
		$('#group').val(group);
		//setto la classe all'id che sto selezionando
		$('#labelGroup_'+group).attr("class", "selected");
	}
	
	executeFilterEventList();
}

