﻿$(function () {

	//Animate homepage case study images
	setInterval("slideSwitch2('#caseStudies')", 2000);

});

function slideSwitch2(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.css({ opacity: 0.0 })
			.addClass('active')
			.animate({ opacity: 1.0 }, 1000, function () {
				$active.removeClass('active last-active');
			});
	}
}

