function gallery_big(base_url) {
	var numero_foto = 0; // indico il numero di foto totale
	var foto_width = 0;  // larghezza della foto
	var content_width = $("#slider").css("width").replace("px", ""); // dimensione content
	
	$(".content_pics").find(".ico").each(function(){
		
		// associazione click ico
		$(this).click(function(){
			var rel = $(this).attr("rel");
			var url = base_url + rel;
			
			// cambio background
			animateBackground(url);
			
			// ripristino le thumb
			ripristinaThumb();
			
			// attivo la thumb corrente
			activeCurrentThumb($(this));
		});
		
		numero_foto++; // incremento il numero di foto
		foto_width = eval($(this).css("width").replace("px", ""));
		foto_width += eval($(this).css("margin-left").replace("px", ""));
		foto_width += eval($(this).css("margin-right").replace("px", "")); // prendo la larghezza
	});
	
	
	
	// slider
	var slider_width = numero_foto * foto_width;
	var foto_in_centro = Math.round((eval(content_width) / eval(foto_width)) / 2);
	
	// attivo la foto in centro (inizio)
	setImage(base_url, foto_in_centro);
		
			
	//
	// navigazione
	//
	$(".arrow_prev").click(function(){
		var posizione = $(".content_pics").css("margin-left").replace("px", "");
		
		if(posizione >= -(slider_width - content_width)){	
			posizione = eval(posizione) - eval(foto_width);
			animate(posizione);
		}
	});
	
	$(".arrow_next").click(function(){
		var posizione = $(".content_pics").css("margin-left").replace("px", "");
		posizione = eval(posizione) + eval(foto_width);
		if(posizione <= 0){
			animate(posizione);
		}
	});
}



//
// Inserisce l'immagine nel background
//
function setImage(base_url, foto){
	var foto_corrente = 1;
	$(".content_pics").find(".ico").each(function(){
		if(foto_corrente == foto){
			var rel = $(this).attr("rel");
			var url = base_url + rel;
			animateBackground(url);
		}
		foto_corrente++;
	});
}


//
// Background
//
function animateBackground(url){
	$("#foto_big").css("background", "url('" + url + "')");
}


//
// Animazione della slider
//
function animate(posizione){
	$(".content_pics").animate({"margin-left": posizione}, 300)
}


//
// Ripristino tutte le thumb
// 
function ripristinaThumb(){
	$(".content_pics").find(".ico").each(function(){
		$(this).css("border", "none");
	});
}

function activeCurrentThumb(obj){
	
}
