// JavaScript Document
var p = 1;

jQuery(document).ready(function(){
     
     $("#testimonials").mbScrollable({
        width:940,
        elementsInPage:1,
        elementMargin:0,
        shadow:false,
        height:280,
        slideTimer:600,
        controls:"#control",
        autoscroll:true,
        scrollTimer:10000,
        nextCallback: next,
        prevCallback: prev
      });
   $(".testimonial").each(function(I){
   		var delay = 100+(I*250);
   		
   		$(this).delay(delay).fadeIn(800);
   });
   $('.prev').hide();
      
});

function next() {
     if (p == 1) {
          $('.prev').fadeIn();
     }
     
     p++;
     
     if (p == 4) {
          $('.next').fadeOut();
     }
}

function prev() {
     if (p == 4) {
          $('.next').fadeIn();
     }
     
     p = p - 1;
     
     if (p == 1) {
          $('.prev').fadeOut();
     }
}


