/* Random filter
   Stolen from http://www.pinceladasdaweb.com.br/blog/2008/12/18/jquery-random-filter/
   Usage $('.class:random').click() */
jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"], {
    random: function(a, i, m, r) {
        if (i == 0) {
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
        };
        return i == jQuery.jQueryRandom;
    }
});

/* Cycle through RAB members */

var rabT;
var current;
var target;

function switchRAB() {
  current = $('.rab-front:visible');
  if (current.next().length == 0) {
    target = $('.rab-front:first');
  } else {
    target = current.next();
  }
  current.fadeOut().queue(function () {
    target.fadeIn();
    $(this).dequeue();
  });
/*  Deprecated random order version.
    $('.rab-front:visible').fadeOut().queue(function () {
    $('.rab-front:random').fadeIn();
    $(this).dequeue();
  }); */
  rabT = setTimeout("switchRAB()",10000);
}

$(document).ready(function () {
  setTimeout("switchRAB()",10000);
});

