// JavaScript Document

function slideSwitch() {
	var $active = $('#slideshow img.active');
	if ( $active.length == 0 ) $active = $('#slideshow img:last');
	var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');
	$active.addClass('last-active');
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
	 }
$(function() {
	setInterval( "slideSwitch()", 4000 );
});
		 

$(function(){
	
	var BANNER_NUM = 3;
	var DELAY = 5000;
	var ANIMATION_SECONDS = 700;
	
	$('#topBanner').each(function(){
		$(this).css({
			width:330,
			height:79*BANNER_NUM+3*(BANNER_NUM-1),
			overflow:'hidden'
		});
		$('#topBanner ul').css({
			position:'absolute'
		});
		
		setInterval(function(){
			var current = 
			$('#topBanner ul').animate({
				'top': -79-0
			}, {
				duration:ANIMATION_SECONDS,
				easing:'easeOutCubic',
				complete:function(){
					var topnode = $('#topBanner ul li:first-child').get(0);
					$('#topBanner ul').css({
						'top': 0
					});
					$('#topBanner ul').append(topnode);
				}
			});
		}, DELAY)
		
	});
	
});





