function slideShow() {
	var $active = $("#Slider div.theslide.active");

	if ( $active.length == 0 ) $active = $("#Slider div:last");

	var $next =  $active.next().length ? $active.next() : $("#Slider div:first");

	$active.addClass("last-active");

	$next.css({opacity: 0.0})
		.addClass("active")
		.animate({opacity: 1.0}, 500, function() {
			$active.removeClass("active last-active");
		});
		
	var $activeControl = $("#SliderControls div a.current");
	if ( $activeControl.length == 0 ) $activeControl = $("#SliderControls div:last a");
	var $nextControl = $activeControl.parent().next().children("a").length ? $activeControl.parent().next().children("a") : $("#SliderControls div:first a");
	$nextControl.addClass("current");
	$activeControl.removeClass("current");
	Cufon.replace(".slidercontrolbox");
} //end slideSwitch

$(function() {    
	$slideshow = setInterval( "slideShow()", 5000 );
//         $("#SliderControls div a").bind('click', function(event) {
//             $("#SliderControls div a").each(function () {
//                 $(this).removeClass("current");
//             });
//             $(this).addClass("current");
//             
//             $("#Slider div").each(function() {
//                 $(this).css("z-index",9).css("opacity",0);
//             });
//             $("#Slider div:eq("+$("#SliderControls div a").index(this)+")").animate({opacity: 1.0}, 1000);
//             
//             clearInterval($slideshow);
//             Cufon.replace($(".slidercontrolbox"));
//             event.preventDefault();
//         });
});

