$(document).ready(function() {

	//--------SLIDER--------
	if ($('#slider').length) {
		$('#slider').cycle({
			fx:		'fade',
			timeout:	9000
		});

	};

	if ($('.slide-lr').length) {
		$('.slide-lr li').animate({ opacity: 0 }, 0);
		menuItemsIn($(".slide-lr li"), 0);
	};

});

function onAfter(curr, next, opts, fwd) {
	var $ht = $(this).height();

	//set the container's height to that of the current slide
	$(this).parent().animate({height: $ht});
}

var mmtop=0;
function menuItemsIn($list, n) {
	$list.eq(n).css('margin-top', mmtop);
	$list.eq(n).animate({left:0, opacity:1}, 'slow', 'easeInBack', function() {
		if(n < $list.length-1) { menuItemsIn($list, n+1) };
	});
	mmtop=mmtop + 20;
}
