


function slideSwitch() {
    var $active = $('#userSlideshow IMG.active');

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

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

    $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 );
});





function slideSwitch2() {
    var $active2 = $('#userSlideshow2 IMG.active2');

    if ( $active2.length == 0 ) $active2 = $('#userSlideshow2 IMG:last');

    var $next =  $active2.next().length ? $active2.next()
        : $('#userSlideshow2 IMG:first');

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

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

$(function() {
    setInterval( "slideSwitch2()", 4000 );
});





function slideSwitch3() {
    var $active3 = $('#userSlideshow3 IMG.active3');

    if ( $active3.length == 0 ) $active3 = $('#userSlideshow3 IMG:last');

    var $next =  $active3.next().length ? $active3.next()
        : $('#userSlideshow3 IMG:first');

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

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

$(function() {
    setInterval( "slideSwitch3()", 3000 );
});


$(document).ready(function(){

	$("#directions").click(function() {
		$("#map").slideToggle({opacity: "show", top: "75"}, "slow");
	})

});

