function slideSwitch()
{
	var $active = $('.window IMG.active');
	var $hsactive = $('.homeslide IMG.active');
	
	if ($active.length == 0 ) $active = $('.window IMG:last');
	if ($hsactive.length == 0 ) $hsactive = $('.homeslide IMG:last');
	
	var $next = $active.next().length ? $active.next() : $('.window IMG:first');
	var $hsnext = $hsactive.next().length ? $hsactive.next() : $('.homeslide IMG:first');
	
	$active.addClass('last-active');
	$hsactive.addClass('last-active');
	
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function()
		{
			$active.removeClass('active last-active');
		});
		
	$hsnext.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function()
		{
			$hsactive.removeClass('active last-active');
		});
}

$(function() {
	setInterval( "slideSwitch()", 5500 );
});
