function slideRight()
{

  //select current active image
  var $active = $('#rotatingimages a.active');
  
  //select last active image if none active
  if ( $active.length == 0 ) $active = $('#rotatingimages a:last');

  //select first image if no image next
  var $next = $active.next().length ? $active.next() : $('#rotatingimages a:first');
  
  $active.addClass('last-active');
  
  $next.css({opacity:0.0})
    //add class to new active image
    .addClass('active')
    .animate({opacity:1.0},1000,function(){
      //remove class from old active image
      $active.removeClass('active last-active');
    });
}

function slideLeft()
{

    //select current active image
  var $active = $('#rotatingimages a.active');
  
  //select last active image if none active
  if ( $active.length == 0 ) $active = $('#rotatingimages a:first');

  //select first image if no image next
  var $prev = $active.prev().length ? $active.prev() : $('#rotatingimages a:last');
  
  $active.addClass('last-active');
  
  $prev.css({opacity:0.0})
    //add class to new active image
    .addClass('active')
    .animate({opacity:1.0},1000,function(){
      //remove class from old active image
      $active.removeClass('active last-active');
    });
}