// JavaScript Document

$(document).ready(function(){
	
	$("#mainboxFoto2").fadeOut();
	$("#mainboxFoto3").fadeOut();
	
			   
$("#mainboxNavegacion").find('span').hover(function() { $(this).find('img').css({'height':'12px','width':'12px','top':'0px'}).end(); },
      function() { $(this).find('img').css({'height':'','width':'','top':''}).end(); 
    }).end();
$(".mainboxLinkF").click(function() {
	var index=$("#mainboxNavegacion a").index(this);
	$('#mainboxContent').stop().animate({scrollLeft:900*index+"px"},500);
});
$("#arrowL").click(function() {
	$('#mainboxBlueSliderContent').stop(true,true).animate({scrollLeft:"-=664"},500);
});
$("#arrowR").click(function() {
	$('#mainboxBlueSliderContent').stop(true,true).animate({scrollLeft:"+=664"},500);
});

$("#arrowLI").hover(function() { $(this).css({'height':'12px','width':'12px','top':'-3px','left':'-3px'}); },
      function() { $(this).css({'height':'','width':'','top':'','left':''}); 
    });

$("#arrowRI").hover(function() { $(this).css({'height':'12px','width':'12px','top':'-3px'}); },
      function() { $(this).css({'height':'','width':'','top':''}); 
    });

});
var c=100;
var t;
function timedCount()
{
	if(c==100){
		c=2;
		t=setTimeout("timedCount()",8000);
	}
	else if(c==1){
		$('#mainboxFoto2').fadeOut(500);
		$('#mainboxFoto3').fadeOut(500,function(){
			$('#mainboxFoto1').fadeIn(500);
		});
		c=2;
		t=setTimeout("timedCount()",8000);
	}
	else if(c==2){
		$('#mainboxFoto3').fadeOut(500);
		$('#mainboxFoto1').fadeOut(500,function(){
			$('#mainboxFoto2').fadeIn(500);
		});
		c=3;
		t=setTimeout("timedCount()",8000);
	}
	else if(c==3){
		$('#mainboxFoto1').fadeOut(500);
		$('#mainboxFoto2').fadeOut(500,function(){
			$('#mainboxFoto3').fadeIn(500);
		});
		c=1;
		t=setTimeout("timedCount()",8000);
	}
}
