var superOffer = {
  marker : 1,
  pause : false,
  timeoutId : '',
  timersArr:[],
  count : 0,
  init : function(count){
	this.count = count;
    this.loop(0);
  },
  bringToFront : function(key){
    for( var i = 0 ; i < this.count ; i++ ){
      if( i != key ){
        $("#superOffer_" + i ).hide();
        $("#superOfferItemMarker_" + i).removeClass('superOfferItemMarkerAlt');
        $("#superOfferItemMarker_" + i).addClass('superOfferItemMarker');
      }else{
        $("#superOffer_" + i ).show();
        $("#superOfferItemMarker_" + i).removeClass('superOfferItemMarker');
        $("#superOfferItemMarker_" + i).addClass('superOfferItemMarkerAlt');
      }
    }
  },
  loop : function(key){
    if( this.pause ) return;
    if( key == this.count ) key = 0;
    this.bringToFront(key);
    this.timersArr.push(setTimeout( "superOffer.loop(" + ( key + 1 ) + ")" , 3000 ));
  },
  pauseIt : function(){
    this.pause = true;
    for( var key in this.timersArr ){
      clearTimeout(this.timersArr[key]);
    }
    this.timersArr = [];
  },
  unpauseIt : function(key){
    this.pause = false;
    this.loop(key);
  }
};
