$(function(){
  
  if($('#swap').length > 0) {
    //setInterval('swap()', 5000);
  }
  
});


function swap(id){
  
  if(id == null) {
    id = '#swap';
  }
  var $active = $(id + ' .active');
  var $next = ($(id + ' .active').next().length > 0) ? $(id + ' .active').next() : $(id + ' div:first');
  
  if(!$next.hasClass('active')) {
    $active.fadeOut(function(){
      $active.removeClass('active');
      $next.fadeIn().addClass('active');
    });
  }
  
}



/*

(function( $ ){

	 $.fn.rotate =  function(options, callback){
    alert(this.id);
    return;
    $('.rotateImages').each(function() {
            rotateImages[rotateCounter] = $(this).attr('src');
            rotateCounter++;
        });
        rotateTotal = rotateCounter;
        rotateCounter = 0;
        setInterval("rotate()", 7000);
  };
   
});
*/
