function slideSwitch() {
	var $active = $('#slideshow DIV.active');

	if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

	// use this to pull the divs in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow DIV:first');

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

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

var playSlideshow =  setInterval( "slideSwitch()", 6000 );

$(document).ready(function() {
	
	$('#slideshow img').hover(
		function() { 
			clearInterval(playSlideshow); 
			$(this).stop(true, true).animate({ opacity: 0.7 }, 200, function() {}); 
		},
		function() { 
			$(this).stop(true, true).animate({ opacity: 1 }, 600, function() {});
			playSlideshow =  setInterval( "slideSwitch()", 6000 ); 
		}
	);
	
	// Hovers
	$("a").hover(
		function () { 
			$(this).stop(true, true).animate({ opacity: 0.4 }, 200, function() {}); 
			$(this).addClass('pointer'); 
		},
		
		function () { 
			$(this).stop(true, true).animate({ opacity: 1 }, 600, function() {});
		}
	);
	
	$("#login_form_toggle").hover(
		function () { $(this).stop(true, true).animate({ opacity: 0.4 }, 200, function() {}); $(this).addClass('pointer'); },
		function () { $(this).stop(true, true).animate({ opacity: 1 }, 600, function() {}); }
	);
	
	// Show / Hide Login Form DIV
	$('#login_form_toggle').click(function() {
		$('#login_form').slideToggle(100);
		return false;
	});

});
