function change_pic(picture)
{
	$("#image_gr_img").fadeOut(1000,function(){
		$("#image_gr_img").attr("src",picture);
		$("#imagen_gr").css("display","block");
	});
	
	return true;
}

function load_frame(loc,height)
{
	$("#frame").attr("src",loc);
	$("#frame").css("height",0);
	$("#data").css("display","block");
	$("#frame").animate({height:height+"px"},1000);
	
	return true;
}

var actual=1;//bloque actual
/* Function para moverse en las fotos, dir>0 moverse a derecha, sino a izquierda, total es el numero de bloques que existen */
function moving(dir,total)
{
	if(dir>0)
	{
		if(actual<total)
		{
			newLeft=parseInt($("#detalles .top .down .gallery .top .down").css("left"))-283;
			$("#detalles .top .down .gallery .top .down").animate({left:newLeft+"px"},1000);
			actual++;
			$(".bloques").html("Bloque "+actual+"/"+total);
		}
	}
	else if(dir<0)
	{
		if(actual>1)
		{
			newLeft=parseInt($("#detalles .top .down .gallery .top .down").css("left"))+283;
			$("#detalles .top .down .gallery .top .down").animate({left:newLeft+"px"},1000);
			actual--;
			$(".bloques").html("Bloque "+actual+"/"+total);
		}
	}
}

$(document).ready(function(){
	
	$(".foto").click(function(){
		$(".foto").removeClass("selected");
		$(this).addClass("selected");
	});
	
	$("#image_gr_img").load(function(){
		$("#image_gr_img").fadeIn(1000);
	});
});