		$(document).ready(function(){
			
			// add wrapper and UI control elements
			$(".library-scroller").each(function(){
				$(this)
					.wrapInner('<div class="items"></div>')
				;
				var c = $(this).parent().find(".items").children().size();
				if (c > 8) {
					$(this)
						.wrap('<div class="scrollable-wrapper"></div>')
						.addClass('scrollable')
						.parent()
							.prepend('<a class="prevPage browse left"></a>')
							.append('<a class="nextPage browse right"></a>')
					;
				}
			});
			
			// add play buttons and hide
			$(".library-scroller .items a").append('<img class="play-button" src="images/play-button-small.png" alt="" width="45" height="45" />').find(".play-button").hide()
			// hover event
			$(".library-scroller .items a").hover(
				function(){
					// show play button on hover
					$(this).find(".play-button").show();		
				},
				function(){
					$(this).find(".play-button").hide();						
				}
			
			);

			// when page loads simulate a "click" on the first image
			$(".library-scroller .items").each(function(){
				$(this).find("a").filter(":first").click().addClass("active");
			}); 
							
		    // initialize scrollable 
		    $(".library-scroller").each(function(){
				$(this).scrollable({
					clickable: false,
					size: 8,	// number of items in viewable area
					speed: 500,	// speed to scroll
					//interval: 1000,	// auto scroll speed
					easing: "swing",
					beforeSeek: function(){
						$.log("beforeSeek");
						return false;
					}
				});
			}); 
		 
		});

