﻿$(function () {

	//Animate slideshow banners
	setInterval("slideSwitch('.slideshow')", 5000);

});

function slideSwitch(slideShow) {
	if ($(slideShow + ' span').length > 1) {
		var $active = $(slideShow + ' span.active');

		if ($active.length == 0) $active = $(slideShow + ' span:last');

		var $next = $active.next().length ? $active.next()
			: $(slideShow + ' span:first');

		$active.addClass('last-active');

		$next.addClass('active')
			.effect("blind",{ direction: "horizontal", mode: "show" }, 1000, function () {
				$active.removeClass('active last-active');
			});
	}
}

