$(document).ready(function() {  
  
  // load Jackpots.
  JPload();
  // refresh Jackpots every 10 sec
  var refreshId = setInterval(JPload, 10000);
  //Jackpots function load
  function JPload() {
    $("#pjdisplay").load("/include/progjackpots.php?d=" + 1*new Date());
  }
  
  /* @Payment Scroll@ */
  
  // set element 
   var elSrcoll = $('#paymentScroll');  
  // speed in milliseconds
  var scrollSpeed = 70;   
  // set the default position
  var current = 0;  
  // set the direction
  var direction = 'h';
  
  // the interval id global var outside the scope  
  var bgScrollInt;
  
  // Calls the scrolling function repeatedly 
  scrollInt();
  
  elSrcoll.hover(function(){
      // stop scrolling on hover
      clearInterval(bgScrollInt);
  }, function(){
      // keep scrolling on mouseout
      scrollInt();          
  });  
    
  function bgscroll(){  
    // 1 pixel row at a time
    current -= 1;  
    // move the background with backgrond-position css properties
    elSrcoll.css("backgroundPosition", (direction == 'h') ? current+"px 0" : "0 " + current+"px");  
  }
  
  // the loop function
  function scrollInt() {    
    bgScrollInt = setInterval(bgscroll, scrollSpeed);
  }  

});
