homeIntro = function() {
     var currentSet = 1;
     var lastSet = 0;
     var timer = 0;
     var busy = false;
     this.changeSet = function(set,auto) {
          if(set != currentSet && !busy) {
          	busy = true;
               lastSet=currentSet;
               currentSet=set;
               if(!auto) {
                    clearInterval(this.timer);
                    this.timer = setInterval("sh.autoChange()",5000); 
               }
              
               $("#shb"+currentSet+"").animate({left: 23},500);
               if(lastSet > 0) {
                    $("#shb"+lastSet+"").animate({left: -910},500,function(){
					$(this).css("left",910);
					busy = false;
                    });
               } else busy = false;
          }
     }
     this.autoChange = function() {
          if(currentSet < 4) this.changeSet((currentSet+1),true);
          else this.changeSet(1,true);
     }
     this.next = function() {
          if(currentSet < 4) this.changeSet((currentSet+1),false);
          else this.changeSet(1,true);
     }
     this.prev = function() {
          if(currentSet > 1) this.changeSet((currentSet-1),false);
          else this.changeSet(4,true);
     }
     this.start = function() {
          this.timer = setInterval("sh.autoChange()",5000);
     }
}
var sh = new homeIntro;

$(document).ready(function(){
     sh.start();
});

