function theRotator() {
      $('.panOuter .panImg').css({opacity: 0.0});
      $('.descOuter .descWindow').css({opacity: 0.0});
      $('.panOuter .panImg:first').css({opacity: 1.0}).addClass('show');     
      $('.descOuter .descWindow:first').css({opacity: 1.0}).addClass('show');

      $('a.next').click(function(){
        rotate()
        clearInterval(play);
          return false;
      });

      $('a.previous').click(function(){
        var curImg = ($('.panOuter .panImg.show')?  $('.panOuter .panImg.show') : $('.panOuter .panImg:first'));
        var prevImg = ((curImg.prev().length) ? ((curImg.prev().hasClass('show')) ? $('.panOuter .panImg:last') : curImg.prev()) : $('.panOuter .panImg:last'));
        
        var curDesc = ($('.descOuter .descWindow.show')?  $('.descOuter .descWindow.show') : $('.descOuter .descWindow:first'));
        var prevDesc = ((curDesc.prev().length) ? ((curDesc.prev().hasClass('show')) ? $('.descOuter .descWindow:last') :curDesc.prev()) : $('.descOuter .descWindow:last'));   
         
        prevImg.css({opacity: 0.0})
        .addClass('show')
        .animate({opacity: 1.0}, 1000);
        curImg.animate({opacity: 0.0}, 1000)
        .removeClass('show');
        
        prevDesc.css({top:50, opacity: 0.0})
        .addClass('show')
        .animate({top:0, opacity: 1.0}, 1000);
        curDesc.animate({top:50, opacity: 0.0}, 1000)
        .removeClass('show');
        clearInterval(play);

          return false;
      });

      timedRotate()
}

function timedRotate() {
    play = setInterval('rotate()',6000);
};

function rotate() {    
    var curImg = ($('.panOuter .panImg.show')?  $('.panOuter .panImg.show') : $('.panOuter .panImg:first'));
    var nextImg = ((curImg.next().length) ? ((curImg.next().hasClass('show')) ? $('.panOuter .panImg:first') : curImg.next()) : $('.panOuter .panImg:first'));    

    var curDesc = ($('.descOuter .descWindow')?  $('.descOuter .descWindow.show') : $('.descOuter .descWindow:first'));
    var nextDesc = ((curDesc.next().length) ? ((curDesc.next().hasClass('show')) ? $('.descOuter .descWindow:first') :curDesc.next()) : $('.descOuter .descWindow:first'));    

    nextImg.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);
    curImg.animate({opacity: 0.0}, 1000)
    .removeClass('show');

    nextDesc.css({top:50, opacity: 0.0})
    .addClass('show')
    .animate({top:0, opacity: 1.0}, 1000);
    curDesc.animate({top:50, opacity: 0.0}, 1000)
    .removeClass('show');
};
//End Rotator


//Home Page Slider
		//Show the paging and activate its first link
		$(".paging li:first a").addClass("active");
		$(".paging").show();
		$(".img_reel img")
			.show()
			.css({opacity:0.0})
			.animate({opacity: 1.0}, 2000 );
							    	
		//Get size of the image, how many images there are, then determin the size of the image reel.
		var imageWidth = $(".window").width();
		var imageSum = $(".img_reel img").size();
		var imageReelWidth = imageWidth * imageSum;
		
		//Adjust the image reel to its new size
		$(".img_reel").css({'width' : imageReelWidth});
		
		//Paging  and Slider Function
		sliding = function(){
		    var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
		
		    $(".paging a").removeClass('active'); //Remove all active class
		    $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
		    //Slider Animation
		    $(".img_reel")
				.animate({left: -image_reelPosition, opacity: 1.0}, 500 );
			$(".img_reel img")
				.css({opacity:0.0})
				.animate({opacity: 1.0}, 2000 );		    	
		}; 
		
		//Rotation  and Timing Event
		slideSwitch = function(){
		    sliderPlay = setInterval(function(){ //Set timer - this will repeat itself every 7 seconds
		        $active = $('.paging a.active').next(); //Move to the next paging
		        if ( $active.length === 0) { //If paging reaches the end...
		            $active = $('.paging a:first'); //go back to first
		        }
		        sliding(); //Trigger the paging and slider function
		    }, 4000); //Timer speed in milliseconds (7 seconds)
		};
		//On Hover
		$(".img_reel li").mouseenter(function() {
		    clearInterval(sliderPlay); //Stop the rotation
		});
		$(".img_reel li").mouseout(function() {
		    clearInterval(sliderPlay); //Stop the rotation
		    slideSwitch(); //Resume rotation timer
		});
		
		//On Click
		$(".paging a").click(function() {
		    $active = $(this); //Activate the clicked paging
		    //Reset Timer
		    clearInterval(sliderPlay); //Stop the rotation
		    sliding(); //Trigger rotation immediately
		    //slideSwitch(); // Resume rotation timer
		    return false; //Prevent browser jump to link anchor
		});
//End Home Page Slider


