function slideSwitch() {
	var $active = $('#slideshow IMG.active');
	if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
	var $next =  $active.next().length ? $active.next() : $('#slideshow IMG:first');

	// uncomment the 3 lines below to pull the images in random order
	// var $sibs  = $active.siblings();
	// var rndNum = Math.floor(Math.random() * $sibs.length );
	// var $next  = $( $sibs[ rndNum ] );

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

$(document).ready(function() { 

	// Figure out what browser is being used
	var userAgent = navigator.userAgent.toLowerCase();
	jQuery.browser = {
		version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1],
		chrome: /chrome/.test( userAgent ),
		safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
		opera: /opera/.test( userAgent ),
		msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
		mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
		ios: /(iphone|ipod|ipad)/.test( userAgent )
	};
	
	$('#navigation img').bind('mouseover', function() {
		if($(this).attr('src').match(/off/)) $(this).attr('src',$(this).attr('src').replace(/_off/, '_roll'));
	}).bind('mouseout', function() {
		if($(this).attr('src').match(/roll/)) $(this).attr('src',$(this).attr('src').replace(/_roll/, '_off'));
	});

	if($.browser.ios || $.browser.safari) 
		$(".flash_movie").remove();
	else
		$(".html5_movie").remove();

	if($('#slideshow')) setInterval( "slideSwitch()", 3000 );

});

