////////////////////// THE ONEDIVVIEWER CLASS //////////////////////
// This class lets you view div at a time out of the ones passed in on creation
// To show one you need the index of the div in the containing array
function OneDivViewer(cssHandle) {

  this.show = function(index) {
    if( 0 <= index < this.divs.length && index != this.currentlyVisible ) {
      this.divs[index].show();
      this.divs[this.currentlyVisible].hide();
      this.currentlyVisible = index;
      return true;
    } else {
      return false;
    }
  }

  // Properties and Initialisation
  this.divs = $$(cssHandle);

  // The index (of the array ids) of the first currently visible div
  this.currentlyVisible = 0;

  // Hide all divs except the first
  this.divs[0].show();
  for(i = 1; i < this.divs.length; i++){
    this.divs[i].hide();
  }

}

/////////// END OF CYCLEOBJECT CLASS //////////////////
