var GALERIAS = {};

GALERIAS.destacaFoto = function(indice) {
	var totalFotos = 0;
		
	$("#galeria").find(".mPC").each(function(index) { // Oculto la foto actual
		totalFotos++;
		if(!$(this).is(":hidden")) {
			$(this).fadeOut();
		}
	});

	$("#galeria").find("#rotatorio-" + indice).fadeIn(); // Muestro la correspondiente a indice

	$("#galeria").find("#rotatorio-" + indice).find(".fotos").each(function(index) { // Tratamiento de los thumbs
		if(index == indice - 1) {
			if($(this).is(":hidden")) { // Oculto la primera visible para poder mostrar esta
				$("#galeria").find("#rotatorio-" + indice).find(".fotos").each(function (index) {
					if(!$(this).is(":hidden")) {
						$(this).hide();
						return false;
					}
				});
				$(this).show();
			}
			$(this).attr("id", "activo");
		} else if(!$(this).is(":hidden")) {
			$(this).attr("id", "");
		}
	});

	// Enlaces anterior-siguiente
	var siguiente = indice == (totalFotos - 1) ? 1 : indice + 1;
	var anterior = indice > 1 ? indice - 1 : (totalFotos - 1);

	$(".thnav_ant").attr({ href: "javascript:GALERIAS.destacaFoto(" + anterior + ")"});
	$(".thnav_sig").attr({ href: "javascript:GALERIAS.destacaFoto(" + siguiente + ")"});

};

GALERIAS.cargaThumbs = function(path_publicacion, id_galeria) {

};