$(document).ready(function() {
$("#browsable").scrollable({
 keyboard: false,
 onBeforeSeek: function(event, i){
 var scrollnum = this.getSize();
 var size = 3;
 $("#monitor2").text("index " + i);
 if (i == (scrollnum - size)){
 $("a.next").removeClass("browse");
 } else if (i == (scrollnum - (size+1 ))) {
 $("a.next").addClass("browse");
 }
 }
 });
});
