/* NEWSSHOW */
function Tabber(){
   this.curr = 0;
   this.playing = true;
}
Tabber.prototype.Switch = function(id){
   if(id>=0 && id<=4){
      var pos = "-"+(id * 230)+"px";
      jQuery("div[id*='tb_sw']").removeClass("tb_switch_on").addClass("tb_switch_off");
      jQuery("#tb_sw"+id).removeClass("tb_switch_off").addClass("tb_switch_on")
      jQuery("#tb_strip").animate({top: pos},1000,function(){});
   }
}
Tabber.prototype.Play = function(){
   if(this.playing){
      if(this.curr > 3 || this.curr < 0) { nxt = 0; }
      else { nxt=this.curr+1; }
      this.Switch(nxt);
      this.curr = nxt;
   }
   setTimeout(function(){tabber.Play();},5000);
}
Tabber.prototype.Pause = function(){
   if(this.playing){
      jQuery("#tb_button").removeClass("tb_play").addClass("tb_pause");
      this.playing = false;
   }
   else{
      jQuery("#tb_button").removeClass("tb_pause").addClass("tb_play");
      this.playing = true;
   }
}
var tabber =new Tabber;
jQuery(document).ready(function(){
   setTimeout(function(){ tabber.Play(); },5000);
});



/*
function tb_switch(id){
   if(id>=0 && id<=5){
      var pos = "-"+(id * 110)+"px";
      jQuery("div[id*='tb_sw']").removeClass("tb_switch_on").addClass("tb_switch_off");
      jQuery("#tb_sw"+id).removeClass("tb_switch_off").addClass("tb_switch_on")
      jQuery("#tb_strip").animate({top: pos},1000,function(){});
   }
}*/
