/* 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);
}
/*

function navRotator(id,t,f,n) {
  t = t || 5000;
  f = f || 1500;
  $('ul#'+id+' li').css( { opacity:0.0 } );//Set the opacity of all items to 0
  $('ul#'+n+' li').make_cold();
  $('ul#'+id+' li:first').css({opacity: 1.0});//Get the first item and display it (gets set to full opacity)
  $('ul#'+n+' li:first').make_warm();
  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.navCurrent = ( $('ul#'+n+' li.show') ? $('ul#'+n+' li.show') : $('ul#'+n+' 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.navNext = ( (this.navCurrent.next().length) ? ( (this.navCurrent.next().hasClass('show')) ? $('ul#'+n+' li:first') : this.navCurrent.next()) : $('ul#'+n+' li:first') );
    this.next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, f );
    this.navNext.make_warm().addClass('show');
    this.current.animate({opacity: 0.0}, f ).removeClass('show');
    this.navCurrent.make_cold().removeClass('show');
  }
  ,t);
}
*/
/*
$(document).ready(function() {theRotator(id,t,f);});  //Load the slideshow
*/

