	$(document).ready(function() {
		var $slideshow = $('#slideshow'),
			$caption = $('div.caption'),
			$pause = $('#pause'),
			$resume = $('#resume'),
			STOP = 1, RUN = 2, PAUSE = 3;

		function state(state) {
			$pause.attr('hidden', state != RUN);
			$resume.attr('hidden', state != PAUSE);
		}
		state(RUN);

		$pause.click(function() {
				$slideshow.crossSlidePause();
				state(PAUSE);
			});
		
		$resume.click(function() {
			$slideshow.crossSlideResume();
			state(RUN);
		})

		$slideshow.crossSlide({
		fade: 2,
		variant: true,
		easing: 'easeInOutQuad'
		}, [
		{
			src:  'img/slideshow/img1.jpg',
			alt:  'Welcome to the Smokies!',
			from: 'top left 1x',
			to:   '100% 0% 1.6x',
			time: 4
		}, {
			src:  'img/slideshow/img2.jpg',
			alt:  'Come experience. . . ',
			from: '50% 50% 1.5x',
			to:   'bottom right 1x',
			time: 3
		}, {
			src:  'img/slideshow/img3.jpg',
			alt:  'Scenic Beauty. . . ',
			from: 'top left 1x',
			to:   '80% 50% 1.5x',
			time: 2
		}, {
			src:  'img/slideshow/img4.jpg',
			alt:  'Elegant Living. . . ',
			from: '50% 50%',
			to:   '100% 50% 1.5x',
			time: 3
		}, /* {
			src:  'img/slideshow/img5.jpg',
			alt:  'Exquisite Luxury. . . ',
			from: '50% 50% 1.3x',
			to:   '100% 0% 1x',
			time: 2
		}, */ {
			src:  'img/slideshow/img6.jpg',
			alt:  'and Relaxation!',
			from: 'bottom right 1x',
			to:   'top left 1.5x',
			time: 3
		}
		], function(idx, img, idxOut, imgOut) {
		if (idxOut == undefined) {
			$caption.text(img.alt).animate({ opacity: .6 },1000)
		} else {
			$caption.animate({ opacity: 0 },1000)
		}
		});
		$caption.show().css({ opacity: 0 },1000)
	});
