$(document).ready(function(){
	$('#slider li.active').textShadow();

	setTimeout(function(){photoAnimation();},3000);
});

function photoAnimation()
{
textAnimation();
	oCurrent = $('#slider #gallery img.active');
	if (oCurrent.next('img').length){
		oNext = oCurrent.next('img');
	}
	else 
	{
		oNext = $('#slider #gallery img:eq(0)');
	}
	oCurrent.css({'z-index':2});
	oNext.css({'z-index':3,'opacity':0});
	oNext.animate({opacity:1},3000,function(){$('#slider #gallery img').removeClass('active');$(this).addClass('active');setTimeout(function(){photoAnimation();},3000);});
;
}
function textAnimation()
{
	oCurrent = $('#slider li.active');
	if (oCurrent.next('li').length){
		oNext = oCurrent.next('li');
	}
	else 
	{
		oNext = $('#slider li:eq(0)');
	}
	oCurrent.css({'z-index':2});
	oNext.css({'z-index':3,'opacity':0,'display':'block','top':225});
	oCurrent.textShadowRemove();
	oCurrent.animate({'top':0,'opacity':0},3000);
	//oNext.textShadow();
	oNext.animate({opacity:1,'font-size':30,'top':128},3000,function(){
		$('#slider li').removeClass('active');
		$(this).addClass('active');
		$(this).css({opacity:''}).textShadow();
	});
	
}
