/**
 * http://jonraasch.com/blog/a-simple-jquery-slideshow
 */
function slideSwitch()
{
	var $active = jQuery('#home-header IMG.active');
	
	if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

	var $next =  $active.next().length ? $active.next() : jQuery('#home-header IMG:first');

	$active.addClass('last-active');

	$next.css({
		opacity: 0.0
	})
	.addClass('active')
	.animate({
		opacity: 1.0
	}, 1500, function() {
		slideTitle($next);
		$active.removeClass('active last-active');
	});
}

function slideTitle($active)
{
	var $titleFrame = jQuery('div.active-text').html($active.attr('title'));
	$titleFrame.fadeIn(500);
	$titleFrame.animate({
		left: 0
	},2750, 'linear',function(){
		$titleFrame.fadeOut(2750, function(){
			$titleFrame.css({ left:650})
		});
	});

	if ($active.hasClass("logo"))
	{
		var $logoFrame = jQuery('div.active-logo');
		$logoFrame.fadeIn(500);
		$logoFrame.animate({
			top: 0
		},2750, 'linear',function(){
			if (jQuery.browser.msie)
				$logoFrame.css("background-color","#ffffff");
			$logoFrame.fadeOut(2750, function(){
				$logoFrame.css("background-color","transparent");
				$logoFrame.css({ top:350})
			});
		});
		
	}

}
