function StartMenuAnimation(){
	var currentItem = 0;
	var aktiv;
    this.init = function(){
    	(function($) {
    		if($('body').hasClass('Start')){
	    		$('#HeaderNavigationScroller').css('margin-top', '0px');
	    		currentItem = 1;
	    		mtop = 0;
	    		aktiv = window.setTimeout("startMenuAnimation.showNextItem()", 5000);
	    		
	    		$('.headerTitle').bind("mouseover",function(e){
	    			startMenuAnimation.costumMouseOver(e);
	    		});
	    		
	    		$('.headerTitle').bind("mouseout",startMenuAnimation.costumMouseOut);
    		}
    		else {
    			h2Height = $('.headerNavigation').children('h2').height();
    			pTop = ($('.headerNavigation').height() - h2Height) / 2
    			$('.headerNavigation').children('h2').css('padding-top', pTop);
    			
    		}
    	})(jQuery);
    }
    
    this.showNextItem = function() {
    	(function($) {
    		if(currentItem == 4)
    			currentItem = 1;
    		else {
    			currentItem++;
    			
    		}
    		mtop = $("#HeaderNavigationScroller").height() * (currentItem -1);
    		
    		/* animation Scroller */
    		$("#HeaderNavigationScroller").animate({marginTop: mtop},1000, function(){});
    		$("#HeaderArrow").animate({marginTop: mtop},1000, function(){});
    		
    		/* animation Image and Text */
    		$(".headerImage").not($("#headerImage_pos_" + currentItem)).fadeOut(2000);
    		$("#headerImage_pos_" + currentItem).fadeIn(2000);
    		$(".headerText").not($("#headerText_pos_" + currentItem)).fadeOut(2000);
    		$("#headerText_pos_" + currentItem).fadeIn(2000);
    		
			aktiv = window.setTimeout("startMenuAnimation.showNextItem()",5000);
    	})(jQuery);
    }
    
    this.costumMouseOver = function(e){
    	(function($) {
    		aktiv = window.clearTimeout(aktiv);
    		$("#HeaderNavigationScroller").stop();
    		$("#HeaderArrow").stop();
    		
    		arr = $(e.currentTarget).attr('id').split("_");
    		currentItem = arr[2];
    		
    		
    		mtop = $("#HeaderNavigationScroller").height() * (currentItem -1);
    		
    		/* animation Scroller */
    		$("#HeaderNavigationScroller").animate({marginTop: mtop},250, function(){});
    		$("#HeaderArrow").animate({marginTop: mtop},250, function(){});
    		
    		/* animation Image and Text */
    		$(".headerImage").not($("#headerImage_pos_" + currentItem)).fadeOut(250);
    		$("#headerImage_pos_" + currentItem).fadeIn(250);
    		
    		$(".headerText").not($("#headerText_pos_" + currentItem)).fadeOut(250);
    		$("#headerText_pos_" + currentItem).fadeIn(250);
    		
    		
    		
       	})(jQuery);
    }
    
    this.costumMouseOut = function(){
    	(function($) {
    		aktiv = window.setTimeout("startMenuAnimation.showNextItem()", 1000);
       	})(jQuery);
    }
    
    
    
    var self = this;
}

var startMenuAnimation = new StartMenuAnimation();

(function($) {
	$(document).ready(function(){
		startMenuAnimation.init();
	});

})(jQuery);
