/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 8000 );
});

/************************************/


/************************************/

$(document).ready(function(){
	$("#thumbs li a").click(function(){
									 
		$("#cargando").css("display","inline");
		
		imagen="<img src="+$(this).attr("href")+"/>";
		
		$("#big_picture_car").html(imagen).hide();

		$("#big_picture_car img").load(function(){
			$("#big_picture_car").fadeIn(1000);
			$("#cargando").css("display","none");
			
		});
		
		return false;
		
	});
	$("#thumbs li a:first").click();
});

/************************************/

$(document).ready(function(){
	$('.acc_container').hide();
	$('.acc_trigger:first').addClass('active').next().show(1000);
	$('.acc_trigger').click(function(){
		if($(this).next().is(':hidden'))
		{
			$('.acc_trigger').removeClass('active').next().slideUp(1000);
			$(this).toggleClass('active').next().slideDown();
		}
		return false;
	})
});


$(window).resize(function () {
	$('#fade').height($(window).height());
});

$(document).ready(function(){
	$("#fade").click(function(){
		$("#mensaje").fadeOut(300),
		$(this).fadeOut(400)
	});
	
	$("#w_btn_close a").click(function(){
		$("#mensaje").fadeOut(300);
		$("#fade").fadeOut(400);
	});
})
