$(document).ready(function(){

	$("#header ul ul").css({display: "none"});
	$("#header ul li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(350);
	},function(){
		$(this).find('ul:first').fadeOut(150);
	})
	
	if ($('#slideshow li').size() > 1) {
		$(function() {
		  setInterval(slideSwitch, 5000);
		});
	}
	
	function slideSwitch() {
		var $active = $('#slideshow li.active');

		if ( $active.length == 0 ) $active = $('#slideshow li:last');

		var $next =  $active.next().length ? $active.next()
			: $('#slideshow li:first');

		$active.addClass('last-active');

		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {
				$active.removeClass('active last-active');
			});
	}
	
	//$("#scrollable").scrollable({easing: "custom", size: 1, items: "#slideshow", circular: true}).autoscroll({autoplay: true, interval:1000, autopause:false}).navigator({activeClass: "active", navi: "#slideshow-nav"}); 

});

	


