	window.addEvent('domready', function() {
		thumbs = $$('.page', 'thumbnails');
		var thumbscrolly = new Pager(thumbs, {height: 320, width: 120, duration: 300, direction: 'vert', start: 0, prevBtn: $('up'), nextBtn: $('down')});

		var count = 0;
		var counting = true;
		var numslides = $$('.slide').length;
		new CNETcarousel('gallery', {
			rotateAction: 'click', 
			slideInterval: 5000,
			onShowSlide: function() {
				$$('#thumbnails img').each(function(button, index) {
					button.setStyle('opacity', 1);
				});
				$$('#thumbnails a.selected').each(function(button, index) {
					button.getFirst().setStyle('opacity', 0.5);
					if ((count % 4 == 0 && count != 0))
						thumbscrolly.next();
					if (counting == true)
						count++;
					if (counting == true && count != 1 && count % numslides == 1) {
						thumbscrolly.next();
						count = 0;
					}
					$$('#fulls img').src = button.getFirst().getAttribute('src').replace('_thumb', '');
				});
			},
			onStop: function() {
				counting = false;
			}
		});
	});