jQuery.noConflict();

var animationState = true;
var animationTimeout = 7000;
var animationDelay = 600;
var animationSpeed = 400;
var animationFx = 'fade';

//set hyperlink href & description
function changeAnimationContent(title, headline, link, link_desc){
	jQuery('#animationLink').attr('href',link).html(link_desc);
	jQuery('#animationHeadline').html(headline);
}

function stopAnimation(){
	jQuery('#animationBox').cycle('pause');
	jQuery('#animationPauseButton').attr('src', '/data/icons/pause_animation_orange.gif');
	jQuery('#animationPauseButton').attr('title', 'resume');
	this.animationState =false;
}

function toggleAnimation(){
	if(this.animationState==true){
		this.stopAnimation();
	}else{
		jQuery('#animationBox').cycle('resume');
		jQuery('#animationPauseButton').attr('src', '/data/icons/pause_animation_grey.gif');
		jQuery('#animationPauseButton').attr('title', 'stop');
		this.animationState =true;
	}
}

function nextImage(){
	this.stopAnimation();
	jQuery('#animationBox').cycle('next');
}

function prevImage(){
	this.stopAnimation();
	jQuery('#animationBox').cycle('prev');
}

//set animationstate(Flag) true & start the timeout
function startAnimation(){
	jQuery('#animationImages').cycle('resume');
	this.animationState=true;
}

jQuery(function() {

	var $container = jQuery('#animationBox').cycle({fx: animationFx, speed: animationSpeed, timeout: animationTimeout});

	$container.children().each(function(i) {
	    // create input
		var tmpAr = jQuery('.animationTbumbnail');
		var tmp = tmpAr[i];
		var tmpImg = jQuery(tmp).find('img');
		tmpImg.mouseover(function(){
			$container.cycle(i);
			return false;
		});
	});

	//jQuery('.animationTbumbnail')

});

