$(document).ready(function()
{
	speed=1000;
	j=0;
	height_big_foto=$("#content2").height();

	var_foto1='<table id="big_foto_table" border=0" cellpadding="0" cellspacing="0">';
	var_foto1+='<tr>';
		for (i=1; i<=total_foto; ++i)
		var_foto1+='<td><img src="../img/'+dir_big_foto+'/'+i+'.jpg"  number="'+i+'" height='+height_big_foto+' class="big_foto_class"></td>';
	var_foto1+='</tr>';
	var_foto1+='</table>';
	
	$(document).ready(function()
	{
		$("#big_foto").html(var_foto1);		
		
		$(".big_foto_class").load(function()													  
		{
			$(".big_foto_class").last().css("borderRight", "none");
			$(this).fadeIn(speed, function()
			{
				width_big=$("#big_foto_table").width();
			});
		});

		$("#but_next1").mouseover(function()
		{
			$("#bottom_scale").hide();
			scroll1=setInterval('$("#content1").scrollLeft(j); j=j+10;', 1);
		});	
		
		$("#but_back1").mouseover(function()
		{
			$("#bottom_scale").hide();
			scroll1=setInterval('$("#content1").scrollLeft(j); j=j-10;', 1);
		});
		
		$("#but_next1, #but_back1").mouseout(function()
		{
			$("#bottom_scale").hide();
			clearInterval(scroll1);
		});
		
		$(window).resize(function()
		{
			$(".big_foto_class").height($("#content2").height());
			
			width_big=$("#big_foto_table").width();
		});
	});
});
