function rotate() {
    props.rotCount++;
    if(props.rotCount==parseInt(props.rotArray.length)) {
       div = props.rotArray[0];
       prevDiv = props.rotArray[parseInt(props.rotArray.length)-1];
    } else {
       prevDiv = props.rotArray[props.rotCount-1];
       div = props.rotArray[props.rotCount];
    }
    div.style.display="block";
    if(div != prevDiv && prevDiv !=null) 
        prevDiv.style.display="none";
  
    if(props.rotCount==parseInt(props.rotArray.length)) {
      clearInterval(props.rotIntvl);
      props.rotCount =0;
      props.numRotCounter++;
      if(props.numRotCounter < props.numRot) {
        	props.rotIntvl = self.setInterval('rotate()',props.intvl);
        
      }
    }        
}
function RotatorProperties(numRot,intvl,rotArray) {
    this.rotCount=0;
    this.numRot = numRot;
    this.objectcount = 0;
    this.numRotCounter=0;
    this.intvl=intvl;
    this.rotIntvl;
    this.rotArray=rotArray;
}


function loadPage() {
	exhibits[0]=document.getElementById('home2');
        exhibits[1]=document.getElementById('home3');
        exhibits[2]=document.getElementById('home4');
        exhibits[3]=document.getElementById('home5');
    
	props.rotIntvl = self.setInterval('rotate()',props.intvl);
}

var exhibits = new Array();
var props = new RotatorProperties(2,5500,exhibits);
