$(document).ready(function(){
	
	$(".menu_roll").hover(function(){
		$(this).css("opacity", 0.6);
	}, function(){
		$(this).css("opacity", 1);
	});
	
	$("#roll_top").remove();
	
	var orig = "";
	
	$(".menu_dest_roll").hover(function(){
		orig = $(this).attr("src");
		var roll = orig.replace(".jpg", "_over.jpg");
		$(this).attr("src", roll);
	}, function(){
		$(this).attr("src", orig);
	});
	
});


function activar_lightbox() {
	
	$(".lb").lightBox({
		imageLoading: "images/loading.gif",
		imageBtnClose: "images/close.gif",
		imageBtnPrev: "images/prev.gif",
		imageBtnNext: "images/next.gif",
		txtOf: "de",
		txtImage: "Foto"
	});
	
	$(".fotos_hor_mover").click(function() {
				
		var dir = $(this).attr("title");
		var ancho = 485;
		pos_actual = parseInt($("#moveme").css("left"));
		cnt_placas = $("#moveme").children().length;
		
		//alert("Direccion: "+dir+", Posicion actual: "+pos_actual+", Cantidad de placas: "+cnt_placas);
		
		if(dir == "atras" && pos_actual < 0) {
			$("#moveme").animate({
				left: "+="+ancho+"px"
			});
		}
		if(dir == "adelante" && pos_actual > ((cnt_placas-1)*ancho)*(-1) ) {
			$("#moveme").animate({
				left: "-="+ancho+"px"
			});
		}
		
	});
	
	$(".fotos_vert_mover").click(function() {
				
		var dir = $(this).attr("title");
		var alto = 410;
		pos_actual = parseInt($("#moveme").css("top"));
		cnt_placas = $("#moveme").children().length;
		
		//alert("Direccion: "+dir+", Posicion actual: "+pos_actual+", Cantidad de placas: "+cnt_placas);
		
		if(dir == "atras" && pos_actual < 0) {
			$("#moveme").animate({
				top: "+="+alto+"px"
			});
		}
		if(dir == "adelante" && pos_actual > ((cnt_placas-1)*alto)*(-1) ) {
			$("#moveme").animate({
				top: "-="+alto+"px"
			});
		}
		
	});


	
}
