
/* 
 * [a] Dries Van haver
 * [c] Oskar D
 * [w] www.oskard.be
 * 
*/

var animationFade = 600;

$j(document).ready(function() {		
		slideShow(5000, 0.85);
});

function slideShow(speed, alpha) {
	$j('#gallery a').css({opacity: 0.0});
	$j('#gallery a:first').css({opacity: 1.0});
	/* GEEN CAPTION */
	$j('#gallery .caption').css({opacity: alpha});
	$j('#gallery .caption').css({width: $j('#gallery a').find('img').css('width')}); // resize caption
	//$j('#gallery .content').css({opacity: 0.0});
	$j('#gallery .content').html($j('#gallery a:first').find('img').attr('rel'));
	//.animate({opacity: 1.0}, 400);
	$j('#gallery').show();
	setInterval('gallery()',speed);
}

function gallery() {
	var current = ($j('#gallery a.show')?  $j('#gallery a.show') : $j('#gallery a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $j('#gallery a:first') :current.next()) : $j('#gallery a:first'));	
	//var caption = next.find('img').attr('rel');	
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 2000);
	current.animate({opacity: 0.0}, 2000)
	.removeClass('show');
	$j('#gallery .content').hide(0);
	/* GEEN CAPTION
	$j('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:400 }).animate({height: '1px'}, { queue:true, duration:300 });	
	$j('#gallery .caption').animate({opacity: 0.85},500 ).animate({height: '50px'},animationFade,'linear',$j('#gallery .content').html(caption).show(500));*/
	//	// display content
}
