/*
Datei zur Steuerung der Startseitenanimation (englisch)
benötigt jQuery (http://www.jquery.com) 
und jQuery Cycle-Plugin (http://malsup.com/jquery/cycle/)

Erklärung der Cycle-Optionen unter http://malsup.com/jquery/cycle/options.html
*/


$(document).ready(function() {
	/* Animation des großen Bildes einmal starten */
	$("#ani_button").hide();
	$("#ani_top").cycle({
		timeout:4500,
		speed:2000,
		end: function() { $("#ani_button").show(); },
		autostop: 1
	});
	
	/* Animation der kleinen Bilder initialisieren und pausieren */
	$(".ani_bottom").cycle({
		timeout:4500,
		speed:2000
	});
	$(".ani_bottom").cycle('pause');
	
	/* Bei Mouseover über kleine Bilder Animation abspielen, Animationen der anderen kleinen Bilder stoppen */
	$(".ani_bottom").hover(
		function() { 					/* MOUSEOVER */
			$(".ani_bottom").cycle('pause');
			$(this).cycle('resume',true);
		},  
		function() {}					/* MOUSEOUT */
	);
	
	/* Klickfunktion für "play again"  */
	$("#ani_button").click(function() {
		$(this).hide();
		$("#ani_top").cycle({
			timeout:4500,
			speed:2000,
			end: function() { $("#ani_button").show(); },
			autostop: 1
		});
	});
});
