jQuery(document).ready(function($) {

//GATES ANIMATIONS
/*
	var posGatetext = $(".gatetext").first().css("top");
	var posGateicon = $(".gateicon").first().css("top");
	var posGatecontents = $(".gatecontents").first().css("top");
	var gatesHeight = $("#gates").css("height");
	var gatesWidth = $("#gates").css("width");
	var easeType = "easeInExpo";
	var easeType2 = "easeInOutBack";
	var easeTime = 350;
	var easeTime2 = 500;
	var easeTimeText = 1000;

	var currentOpenGate=null;
	var currentLeaveGate=null;
	var overGates = false;
	
	var gateZIndex = 0;
	
	function animateGateEnter(gate) {
		if(overGates){
			gate.css("z-index",gateZIndex+=1);
			//gate.topZIndex();
			//Inhalte einblenden
			if ( $.browser.msie ) {
				$(".gatetext").stop();
				gate.find(".gatetext").stop();
			 } else {
				$(".gatetext").stop().animate({opacity: 0.5},easeTime, easeType);
				gate.find(".gatetext").stop().animate({opacity: 1},easeTime, easeType);
			};
			gate.find(".gatecontentsbox").stop().animate({width: gatesWidth, left: "-"+gate.css("left")},easeTime, easeType, function(){
				gate.find(".gatecontents").stop().animate({top: 0},easeTime2, easeType2);
			});
		}
	}
	function animateGateLeave(callback) {
		//Inhalte wieder ausblenden
		$(".gatecontents").stop().animate({top: posGatecontents},easeTime, easeType, function(){
			$(".gatecontentsbox").stop().animate({width: 0, left: 0},easeTime, easeType, callback);
		});
	}
	function animateGatesEnter(callback) {
		//text nach oben, icon nach unten schieben
		$(".gatetext").stop().animate({top: 0},easeTime, easeType2);
		if ( $.browser.msie ) {
			$(".gateicon").stop().animate({top: gatesHeight},easeTime2, easeType2);
			$(".gateicon").last().stop().animate({top: gatesHeight},easeTime2, easeType2, callback);
		 } else {
			$(".gateicon").stop().animate({top: gatesHeight, opacity: 0},easeTime2, easeType2);
			$(".gateicon").last().stop().animate({top: gatesHeight, opacity: 0},easeTime2, easeType2, callback);
		};
		$(".gatelink").css("height", "80px");
	}
	function animateGatesLeave() {
		//text und icon wieder an Ausgangsposition schieben
		$(".gatetext").stop().animate({top: posGatetext},easeTime2, easeType2);
		if ( $.browser.msie ) {
			$(".gateicon").stop().animate({top: posGateicon},easeTime2, easeType2,function(){
				$(".gatetext").stop();
			});
		 } else {
			$(".gateicon").stop().animate({top: posGateicon, opacity: 1},easeTime2, easeType2,function(){
				$(".gatetext").stop().animate({opacity: 1},easeTime, easeType);
			});
		};
		$(".gatelink").css("height", "100%");
		currentOpenGate=null;
		currentLeaveGate=null;
	}

	$(".gatewrapper").mouseenter(function(){
		overGates = true;
		if (currentOpenGate==null) {
			currentOpenGate=$(this);
			animateGatesEnter(function() {
				animateGateEnter(currentOpenGate);
			})
		}
		else {
			currentLeaveGate=$(this);
			animateGateLeave(function() {
				animateGateEnter(currentLeaveGate);
			});
		}
    });
	
	$("#gates").mouseleave(function(){
		overGates = false;
		animateGateLeave(function() {
			animateGatesLeave();
		});
	});
*/

//NEWS SLIDER

	$(".news-list-container").each(function(index){
		$(this).wrap("<div id='slider"+index+"' class='sliderwrapper'></div>");
	});
	
	$(".sliderwrapper").slides({
		container: 'news-list-container',
		generateNextPrev: true,
		generatePagination: true,
		play: 4500
	});
});
