//<![CDATA[	
$amount = Math.round(($("#gallery .listado-producto li").length)/2);
$incremental = 0;
function upGallery() {
	if (($amount-$incremental) > 5) {
		$incremental++;
		$("#gallery .listado-producto").animate({
			"top": ((74*$incremental)*(-1))
		}, "swing");
	}
}
function downGallery() {
	$actualTop = $("#gallery .listado-producto").css("top");
	if ($incremental > 0) {
		$actualTopInt = ($actualTop.replace("px", ""))*1;
		$("#gallery .listado-producto").animate({
			"top": ($actualTopInt)+(74)
		}, "swing");
		$incremental--;
	}
}

$(document).ready(function() { 
	$("a.lightbox").fancybox({
		'overlayShow'			: false,
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack'
	}); 
	$("a.external").click( function() {
        window.open( $(this).attr("href") );
    	return false;
    });
    $("#gallery .listado-producto li:nth-child(2n)").css("margin", "0");
    $("#gallery .listado-producto a").each(function() {
		$(this).click(function() {
			$imagen = $(this).attr("href");
			$descripcion = $(this).parent().parent().find(".galeria-descripcion").text();
			$nombre = $(this).parent().parent().find("h3").html();
	
			$("#gallery #main-image h3").fadeOut("slow", function() { $("#gallery #main-image h3").text(''); });
			$("#gallery #main-image .main-descripcion").fadeOut("slow", function() { $("#gallery #main-image .main-descripcion").text(''); });
			$("#gallery #main-image a").fadeOut(
				750, function() {
				$("#gallery #main-image a img").attr("src", $imagen);
				$("#gallery #main-image a").fadeIn(750);		
				$("#gallery #main-image a").attr("href", $imagen.replace('mid\/', 'slideshow\/'));
				$("#gallery #main-image h3").html($nombre);
				$("#gallery #main-image h3").fadeIn();
				$("#gallery #main-image .main-descripcion").text($descripcion);
				$("#gallery #main-image .main-descripcion").fadeIn();
			});
	    	return false;		
		});
    })
	$("#gallery").append('<p class="gallery-controls"><a href="javascript:;" onclick="downGallery();" class="up"><img src="/images/gallery-scroll-buttons.gif" alt="Subir" /></a><a href="javascript:;" onclick="upGallery();" class="down"><img src="/images/gallery-scroll-buttons.gif" alt="Bajar" /></a></p>');
});
//]]>	

<!-- fin scripts galeria imagenes -->


<!-- CAPAS FLOTANTES -->

<!--
//Funcion que muestra el div en la posicion del mouse
function showdiv(event)
{
	//determina un margen de pixels del div al raton
	margin=5;

	//La variable IE determina si estamos utilizando IE
	var IE = document.all?true:false;
	//Si no utilizamos IE capturamos el evento del mouse
	if (!IE) document.captureEvents(Event.MOUSEMOVE)

	var tempX = 0;
	var tempY = 0;
/*
	if(IE)
	{ //para IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}else{ //para netscape
		tempX = event.pageX;
		tempY = event.pageY;
	}
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}
*/
	//modificamos el valor del id posicion para indicar la posicion del mouse
	//document.getElementById('posicion').innerHTML="PosX = "+tempX+" | PosY = "+tempY;

	document.getElementById('flotante').style.top = (tempY+margin);
	document.getElementById('flotante').style.left = (tempX+margin);
	document.getElementById('flotante').style.display='block';
	return;
}


-->
