function eventBox(sumHit) {
   
   this.globalActualPage = 1;
   //this.autoPaging = autoPaging;
   this.lock = 0;
   
  /* this.startAutoPaging = function() {
      if (this.autoPaging > 0) {
         this.next(1,this.autoPaging);
         var eto=setTimeout("eventBox.startAutoPaging()",this.autoPaging+1);
      }
   };
   */
   this.next = function(rotate) {
      if (timeOutLocker == 1) { return; } else { timeOutLocker = 1; }
		if (eventBox.lock != 1 && ((this.globalActualPage != sumHit && rotate === 0) || (rotate == 1)) ) {
      /*if (autoPagingStop == 1) {
         this.autoPaging = 0;
      }*/
      actualPage = this.globalActualPage;
      
         eventBox.lock = 1;
         $("div#eventBoxPage_"+actualPage).fadeOut(100,function() {
            if (actualPage == sumHit && rotate == 1) { actualPage = 0; eventBox.globalActualPage = 0; }
            $("div#eventBoxPage_"+(actualPage+1)).fadeIn(100,function() {
               if (rotate == 1 && actualPage === 0) {
                  $("img#eventBoxPageSquare_"+sumHit).attr('class','squareInActive');
               } else {
                  $("img#eventBoxPageSquare_"+actualPage).attr('class','squareInActive');
               }
               $("img#eventBoxPageSquare_"+(actualPage+1)).attr('class','squareActive');
                  eventBox.globalActualPage++;
                  
               if (this.globalActualPage == sumHit && rotate === 0) {
                  $("input#eventBoxNextBtn").attr("disabled",true);
                  $("input#eventBoxPrevBtn").removeAttr("disabled");
               } else {
                  $("input#eventBoxPrevBtn").removeAttr("disabled");
                  $("input#eventBoxNextBtn").removeAttr("disabled");
               }
               eventBox.lock = 0;
               timeOutLocker = 0;
            });
         });
      } else { return false; }
   };
   
   this.prev = function(rotate) {
		if (eventBox.lock != 1 && ((this.globalActualPage != 1 && rotate === 0) || (rotate == 1)) ) {
      /*if (autoPagingStop == 1) {
         this.autoPaging = 0;
      }*/
      actualPage = this.globalActualPage;
      
         eventBox.lock = 1;
         
         $("div#eventBoxPage_"+actualPage).fadeOut(100,function() {
            if (actualPage == 1 && rotate == 1) { actualPage = sumHit+1; eventBox.globalActualPage = sumHit+1; }
            $("div#eventBoxPage_"+(actualPage-1)).fadeIn(100,function() {
               
               if (rotate == 1 && actualPage == sumHit+1) {
                  $("img#eventBoxPageSquare_"+1).attr('class','squareInActive');
               } else {
                  $("img#eventBoxPageSquare_"+actualPage).attr('class','squareInActive');
               }
               $("img#eventBoxPageSquare_"+(actualPage-1)).attr('class','squareActive');
               
                  eventBox.globalActualPage--;
                  
               if (this.globalActualPage == 1 && rotate === 0) {
                  $("input#eventBoxNextBtn").attr("disabled",true);
                  $("input#eventBoxPrevBtn").removeAttr("disabled");
               } else {
                  $("input#eventBoxPrevBtn").removeAttr("disabled");
                  $("input#eventBoxNextBtn").removeAttr("disabled");
               }
               eventBox.lock = 0;
            });
         });
      } else { return false; }
   };
   
}
