		var loadInitialItems = function(type, args) {

			var start = args[0];
			var last = args[1]; 
			var alreadyCached = args[2]; 
				
			load(this, start, last);	

			brightenOrDim(this);

			$('a[@rel*=lightbox]').lightBox();

		};

		/**
		 * Custom load next handler. Called when the carousel loads the next
		 * set of data items. Specified to the carousel as the configuration
		 * parameter: loadNextHandler
		 **/
		var loadNextItems = function(type, args) {	

			var start = args[0];
			var last = args[1]; 
			var alreadyCached = args[2];
			
			if(!alreadyCached) {
				load(this, start, last);
			}

			brightenOrDim(this);
	
			$('a[@rel*=lightbox]').lightBox();

		};

		/**
		 * Custom load previous handler. Called when the carousel loads the previous
		 * set of data items. Specified to the carousel as the configuration
		 * parameter: loadPrevHandler
		 **/
		var loadPrevItems = function(type, args) {
			var start = args[0];
			var last = args[1]; 
			var alreadyCached = args[2];
			
			if(!alreadyCached) {
				load(this, start, last);
			}
			
			brightenOrDim(this);
		
			$('a[@rel*=lightbox]').lightBox();
		
		};

		var brightenOrDim = function(carousel) {
			var firstItemRevealed=carousel.getFirstItemRevealed();
			var lastItemRevealed=carousel.getLastItemRevealed();
			var firstVisible = carousel.getProperty("firstVisible");
			var lastVisible = carousel.getLastVisible();
				
			var first = (firstItemRevealed == -1) ? firstVisible : firstItemRevealed;
			var last = (lastItemRevealed == -1) ? lastVisible : lastItemRevealed;
			
			for(var i=first; i<=last; i++) {
				var li = carousel.getItem(i);
				if(li) {
					if(i == firstItemRevealed || i==lastItemRevealed) {
						YAHOO.util.Dom.replaceClass(li, "bright", "dim");
					} else {
						YAHOO.util.Dom.replaceClass(li, "dim", "bright");
					}
				}
			}
			
		};
