$(function() {
	var $test3 = $('#test3'),
		$caption = $('div.slide_caption'),
		$pause = $('#pause'),
		$resume = $('#resume'),
		$freeze = $('#freeze'),
		$stop = $('#stop'),
		$restart = $('#restart'),
		STOP = 1, RUN = 2, PAUSE = 3;



	$test3.crossSlide({
		fade: 1
	}, [
		{
			src:  'img/f_index_1.jpg',
			alt:  'Naturaleza, relax y "Doñana"',
			from: 'top left',
			to: 'top left',
			time: 4
		},{
			src:  'img/f_index_0.jpg',
			alt:  'descubre nuestro nuevo beach club',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  'img/f_index_2.jpg',
			alt:  'los niños se divierten, usted disfruta',
			from: 'top left',
			to: 'top left',
			time: 4
		}
	], function(idx, img, idxOut, imgOut) {
		if (idxOut == undefined) {
			$caption.text(img.alt).animate({ opacity: .77 })
		} else {
			$caption.animate({ opacity: 0 })
		}
	});
	$caption.show().css({ opacity: 0 })
	$caption.show().css({ z_index: 10000 })

	function state(state) {
		$pause.attr('disabled', state != RUN);
		$resume.attr('disabled', state != PAUSE);
		$freeze.attr('disabled', state == STOP);
		$stop.attr('disabled', state == STOP);
	}
	state(RUN);

	$pause.click(function() {
		$test3.crossSlidePause();
		state(PAUSE);
	});

	$resume.click(function() {
		$test3.crossSlideResume();
		state(RUN);
	})

	$freeze.click(function() {
		$test3.crossSlideFreeze();
		state(STOP);
	});

	$stop.click(function() {
		$test3.crossSlideStop();
		$caption.css({ opacity: 0 })
		state(STOP);
	});

	$restart.click(function() {
		$test3.crossSlideRestart();
		state(RUN);
	});

	
});

$(function() {
	var $test_golf = $('#test_golf'),
		$pause = $('#pause'),
		$resume = $('#resume'),
		$freeze = $('#freeze'),
		$stop = $('#stop'),
		$restart = $('#restart'),
		STOP = 1, RUN = 2, PAUSE = 3;



	$test_golf.crossSlide({
		fade: 1 }, [
		{
			src:  'img/golf1.jpg',
			
			from: 'top left',
			to: 'top left',
			time: 4
		},{
			src:  'img/golf2.jpg',
			
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  'img/golf3.jpg',
			
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  'img/golf4.jpg',
			
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  'img/golf5.jpg',
			
			from: 'top left',
			to: 'top left',
			time: 4
		}
		
	]);
	

	function state(state) {
		$pause.attr('disabled', state != RUN);
		$resume.attr('disabled', state != PAUSE);
		$freeze.attr('disabled', state == STOP);
		$stop.attr('disabled', state == STOP);
	}
	state(RUN);

	$pause.click(function() {
		$test_golf.crossSlidePause();
		state(PAUSE);
	});

	$resume.click(function() {
		$test_golf.crossSlideResume();
		state(RUN);
	})

	$freeze.click(function() {
		$test_golf.crossSlideFreeze();
		state(STOP);
	});

	$stop.click(function() {
		$test_golf.crossSlideStop();
		state(STOP);
	});

	$restart.click(function() {
		$test_golf.crossSlideRestart();
		state(RUN);
	});

	
});

