$(document).ready(function(){
  //
  // ticker functions
  //
  var rotateTicker = function()
  {
    $('#fp_scoreticker_items li:first').animate({
        opacity: 0
      },
      500,
      function(){
        $(this).animate({
            width:0
          },
          300,
          function(){
            $(this).appendTo('#fp_scoreticker_items');
            $(this).css({'width':'145px','opacity':'1'});
          }
        );
      }
    );
  };
  
  var tickerUpdater = $.interval(function() {
    rotateTicker();
  }, 10000);

  //
  //carousel functions
  //
  function carousel_initCallback(carousel)
  {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
      carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
      carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
      }, function() {
        carousel.startAuto();
      }
    );
  };

  $('#fp_carousel').jcarousel({
    scroll:1,
    visible:1,
    wrap:'both',
    easing:'easeInOutCubic',
    auto:8,
    initCallback: carousel_initCallback
  });



});
