		/*** 
			Simple jQuery Slideshow Script
			Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
		***/
		
				
		function paging(elem) {
				var size = $(elem).size();
				for (i=1;i<=size;i++) {
					$('#pager').append('<li>' +i+ '</li>');
			}
		}				
		
		var n = 1;
		function slideSwitch(elem, speed, pager) {			
			var $active = $(elem + '.active');
			if ( $active.length == 0 ) $active = $(elem + ':last');
		
			// use this to pull the images in the order they appear in the markup
			var $next =  $active.next().length ? $active.next()
				: $(elem + ':first');				
				
			$active.addClass('last-active');
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, speed, function() {
					$active.removeClass('active last-active');
					$active.css('opacity', 0);									
				});
				
			/*if (elem == '#deals li') {				
				//$('#pager li').removeClass('pager-active');
				var size = $(elem).size();
				n = (n > size) ? 1 : n;
					for (i=1;i<=size;i++) {						
						$('#pager li').eq(n-1).addClass('pager-active');
						$('#pager li').eq(n-2).removeClass('pager-active');												
				}
				n++;
			}*/
						
		}
		
		$(function() {
			setInterval( "slideSwitch('.flash IMG', 1000, false)", 5000 );
		});
		
		$(function() {
			if ($('#deals li').size() > 1) {
				$('#deals li').not($('#deals li:first')).css('opacity', 0);
				setInterval( "slideSwitch('#deals li', 800, true)", 5000 );
			}
		});
