 // initialize scrollable together with the autoscroll plugin
$(document).ready(function(){


var root = $(".scrollable").scrollable({circular: true}).autoscroll({ autoplay:true, interval:6000, autopause: true});

// provide scrollable API for the action buttons
window.api = root.data("scrollable");
ppbtn = $('#playpause');
ppbtn.click(toggleplay)

});

function toggleplay(){
  $t = $(this)
  if($t.hasClass('paused')){
    $t.removeClass('paused');
    //alert('play')
    api.play();
    api.next();
  }else{
    $t.addClass('paused');
    //alert('pause')
    api.stop()
  }
}
