$(function() {
    $('#pause').click(function() { $('#slides').cycle('pause'); return false; });
    $('#play').click(function() { $('#slides').cycle('resume'); return false; });
    
    $('#slideshow').hover(
        function() { $('#controls').fadeIn(); },
        function() { $('#controls').fadeOut(); }
    );
    
    $('#slides').cycle({
        fx:     'fade',
        speed:   1000,
        timeout: 6000,
        next:   '#next',
        prev:   '#prev'
    });
	
    $('#contents .welcome .details .item a').hover(
        function() { $(this).children('span').fadeIn('fast'); },
        function() { $(this).children('span').fadeOut('fast'); }
    );
	
	$('#contents .level2right .details .item a').hover(
        function() { $(this).children('span').fadeIn('fast'); },
        function() { $(this).children('span').fadeOut('fast'); }
    );
	
	var $run1 = $('#run1'), $run2 = $('#run2'), $run3 = $('#run3'), $pause = $('#pause'), $resume = $('#resume'), $freeze = $('#freeze'), $stop = $('#stop'), $restart = $('#restart'), STOP = 1, RUN = 2, PAUSE = 3;
    $run1.crossSlide({
		sleep: 3,
		fade: 1,
	}, [ { src: '/images/1.jpg', href:'#' }, { src: '/images/2.jpg', href:'#' }, { src: '/images/3.jpg', href:'#' } ]);
	$run2.crossSlide({
		sleep: 3,
		fade: 1,
	}, [ { src: '/images/4.jpg', href:'#' }, { src: '/images/5.jpg', href:'#' }, { src: '/images/6.jpg', href:'#' } ]);
	$run3.crossSlide({
		sleep: 3,
		fade: 1,
	}, [ { src: '/images/7.jpg', href:'#' }, { src: '/images/8.jpg', href:'#' }, { src: '/images/9.jpg', href:'#' } ]);
});

