(function ($) { 
   $.fn.vScroll = function (options) { 
	var defaults = { 
		speed: 500, 
	   	upID: "#up-arrow", 
	   	downID: "#bottom-arrow" 
	}; 
	var options = $.extend(defaults, options);
	// Ken set fixed height for scrolling the div
	var divH = '230'; 
	return this.each(function () { 
		obj = $(this); 
		obj.css("overflow", "hidden"); 
		obj.children().each(function (intIndex) { 
			$(this).addClass("vscroll-" + intIndex); 
	   	});
		var itemCount = 0; 
		var scrolling = 0;	
		$(options.downID).mousedown(function () {
			var nextCount = itemCount + 1; 
			if ($('.vscroll-' + nextCount).length) { 
				// var divH = $('.vscroll-' + itemCount).outerHeight(); 
				itemCount++; 
				$("#vscroller").animate({ top: "-=" + divH + "px" }, options.speed); 
			}
		}); 

			
		$(options.upID).mousedown(function () {
			var prevCount = itemCount - 1; 
			if ($('.vscroll-' + prevCount).length) { 
				itemCount--; 
				// var divH = $('.vscroll-' + itemCount).outerHeight(); 
				$("#vscroller").animate({ top: "+=" + divH + "px" }, options.speed); 
			}
		}); 
		obj.children().wrapAll("<div style='position: relative; top: 0' id='vscroller'></div>");
	});
  };
})
(jQuery);

