/* ROTATOR JS - REQUIRES JQUERY 
* FROM HERE : http://www.alohatechsupport.net/webdesignmaui/maui-web-site-design/easy_jquery_auto_image_rotator.html
*/

function theRotator(id,t,f) {
  t = t || 5000;
  f = f || 1500;
  $('ul#'+id+' li').css( { opacity:0.0 } );//Set the opacity of all items to 0
  $('ul#'+id+' li:first').css({opacity: 1.0});//Get the first item and display it (gets set to full opacity)
  this.rotateInterval = setInterval(function() { //Call the rotator function to run the slideshow, 6000 = change to next item after 6 seconds
    this.current = ( $('ul#'+id+' li.show') ?  $('ul#'+id+' li.show') : $('ul#'+id+' li:first') );
    this.next = ( (this.current.next().length) ? ( (this.current.next().hasClass('show')) ? $('ul#'+id+' li:first') : this.current.next()) : $('ul#'+id+' li:first') ); 
    this.next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, f );
    this.current.animate({opacity: 0.0}, f ).removeClass('show');
  }
  ,t);
}

/*
$(document).ready(function() {theRotator(id,t,f);});  //Load the slideshow
*/

