/* Author: 
	Jukka Timonen and Mika Alapuranen
*/

/****************************** 
             
            CYCLE 

******************************/
$(document).ready(function() {
    $('.slideshow').cycle({
		easing: "easeOutExpo",
		fx: 'scrollHorz',
		timeout: 12000,
        speed: 3000,
		before: onBefore,
		after: onAfter,
		prev:    '.prev-slide',
                next:    '.next-slide',
                cleartype:       1,
                cleartypeNoBg:   true
	});
	function onBefore() { 
	    $('#slide-info-1')			
			.animate({'bottom':'-50px'},100);
            $('#slide-info-2')			
			.animate({'bottom':'-50px'},100);
            $('#slide-info-3')			
			.animate({'bottom':'-50px'},100);
	}
	function onAfter() { 
	    $('#slide-info-1')
			.animate({'bottom':'0'},300);
            $('#slide-info-2')
			.animate({'bottom':'0'},300);
            $('#slide-info-3')
			.animate({'bottom':'0'},300);
	}
});


/* KUVASHOW */
$(document).ready(function() {
    $('.kuvashow').cycle({
		easing: "easeOutExpo",
		fx: 'fade',
		timeout: 4000,
        speed: 2000,
	});
});


/* FANCYBOX */
jQuery(document).ready(function() {

$("a[rel=group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
});

});


