function slideSwitch() {

    var $active = $('#slideshow IMG.active');
//    var $active-link  = $('#slideshow-links A.active');

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

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

//	var $next-link = $active-link.next().length ? $active-link.next()
//	        : $('#slideshow-links A:first');
	
	
    $active.addClass('last-active');
	

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

function slide3() {
//	alert("slide3");
    var $active = $('#slideshow IMG.active');

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

//this line dictates whats next. That is determined by a CSS class on the link itself or by its order
    var $next = $('#slideshow IMG.three');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slide2() {
//	alert("slide3");
    var $active = $('#slideshow IMG.active');

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

//this line dictates whats next. That is determined by a CSS class on the link itself or by its order
    var $next = $('#slideshow IMG.two');

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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slide1() {
    var $active = $('#slideshow IMG.active');

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

//this line dictates whats next. That is determined by a CSS class on the link itself or by its order
    var $next = $('#slideshow IMG.one');

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

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


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