
$(window).load(function(){
	$('.slide-show img.slide').not(':last').hide();
	switchSlides();
	$('#news-slides .drawer').mouseover(function() {
		
		drawerId = $(this).attr('id');
		if (drawerId.indexOf('#') < 0) { drawerId = "#" + drawerId; } 
				
		drawer = $(drawerId);
		$('#news-slides .drawer').not(drawerId).animate({height:'27px'}, 'fast');
		drawer.animate({height:'345px'}, 'fast');
	});
		
});

var slideShowTimer = null;
switchSlides = function(){
	curSlide = $('.slide-show img.slide:visible');
	nextSlide = curSlide.next(".slide");
	if (nextSlide.length == 0) { nextSlide = $('.slide-show img.slide:first'); }
	
	curSlide.fadeOut();
	nextSlide.fadeIn();
	
	slideShowTimer = setTimeout(switchSlides,8000);
}
