window.addEvent('domready', function() {
	if($$('.carousel').length > 0) var indexCarousel = new Carousel();

	/* Navigation */
	$$('#mainnav_sleeve>ul>li').addEvents({
		'mouseenter':function() {
			this.addClass('over');
		},
		'mouseleave':function() {
			this.removeClass('over');
		}
	});

	$$('#mainnav_sleeve>ul>li>a').addEvent('focus', function() {
		$$('#mainnav_sleeve>ul>li.over').removeClass('over');
		this.getParent().addClass('over');
	});

	$$('#mainnav_sleeve>ul>li ul li:last-child a').addEvent('focus', function() {
		this.getParents('li')[1].addClass('over');
	});

var smoothScroller = new Fx.Scroll(document.body, {
	wait: false,
	duration: 1000,
	offset: {'y': -25},
	transition: Fx.Transitions.Sine.easeIn
});

/* Setup navigation to scroll on main nav */
$$('.backtotop').addEvent('click', function(e) {
	e.stop();
	smoothScroller.toTop();
});

});
