// JavaScript Document
/*
http://tobia.github.com/CrossSlide/
*/

jQuery(document).ready(function(){
	
	$('#bannerAnimation').crossSlide({
		fade: 1
		}, [
			{
			src:  'images/animation/anim_01.jpg',
			alt:  'Fall foliage scenery right around the corner!',
			from: 'top left 1x',
			to:   'bottom right 1x',
			time: 3.5
		  	}, {
			src:  'images/animation/anim_02.jpg',
			alt:  'All experience levels<br />are welcome at Apple Greens.',
			from: 'top right 1x',
			to:   'bottom left 1x',
			time: 3.5
		  	}, {
			src:  'images/animation/anim_03.jpg',
			alt:  'Reward yourself after a round<br />at The Restaurant at Apple Greens.',
			from: 'bottom right 1x',
			to:   'top left 1x',
			time: 3.5
	  		}
		], function(idx, img, idxOut, imgOut) {
			if (idxOut == undefined){
				// starting single image phase, put up caption
				$('#bannerAnimationCaption').html(img.alt).animate({ opacity: 1 },1000);
				}
			else{
				// starting cross-fade phase, take out caption
				$('#bannerAnimationCaption').animate({ opacity: 0 },1000);
			}
		});
	
	});
