$(document).ready(function() {
//Slider Function
rotate = function(){
    var triggerID = $active.attr("rel") - 1; //Get number of times to slide

	$(".active").slideUp(1750)
 	$("[id^=slider]").removeClass('active'); //Remove all active class
	$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
	$(".active").slideDown(1750);
}; 

//Rotation  and Timing Event
rotateSwitch = function(){
    play = setInterval(function(){ //Set timer - this will repeat itself 
        $active = $('[id^=slider].active').next(); //Move to the next div
        if ( $active.length === 0) { //If counter reaches the end, go back to first
            $active = $('[id^=slider]:first'); 
        }
        rotate(); //Trigger the slider function
    }, 7000); //Timer speed 
};

rotateSwitch(); //Run function on launch

});
