
  $.getScript('scripts/hoppaOffers.js');

  var hoppaOffers = new function() {

    var intervalId = null;
    var intervalMilliseconds = 1;

    this.init = function() {

      $('DIV.scrollingItem').clone().appendTo('#innerLeftMainBoxContent')
      scroll();
    }

    /**
    * Scrolls the content DIV
    */
    function scroll() {

      var scrollingItem = $('DIV.scrollingItem:first-child');

      if(scrollingItem.height() >  $('#innerLeftMainBoxContent').height()) {

        /* Calculate final position to move to */
        var t = scrollingItem.position().top + scrollingItem.height();

        function animationFrame() {

          var m = parseInt(scrollingItem.css('marginTop').replace('px', ''), 10);

          if(Math.abs(m) < t) {
            scrollingItem.css('margin-top',  m-1 + 'px');
          }
          else {
            scrollingItem.css('margin-top', '9px');
            //window.clearInterval(intervalId);
          }
        }

        intervalId = window.setInterval(animationFrame, intervalMilliseconds);
      }
    }

    /*
    function animationComplete() {
      $(this).css('top', $('#innerLeftMainBoxContent').height());
      scroll();
    }
    */
  }

  //$(document).ready(hoppaOffers.init);