jQuery(document).ready(function(){

	// preload header images
	var kraumePreloader = new html5Preloader();
	var basepath = "http://hype-media.de/clients/kraume/wp-content/themes/kraume/images/content/teaser/";
	kraumePreloader.addFiles(
		basepath+'aktuelles.png',
		basepath+'catering.png',
		basepath+'cafes.png',
		basepath+'default.jpg',
		basepath+'events.png',
		basepath+'fruchtaufstrich.png',
		basepath+'fruehstueck.jpg',
		basepath+'fruehstueck.png',
		basepath+'Individuelles.png',
		basepath+'kaffeehaus.jpg',
		basepath+'kontakt.png',
		basepath+'pralinen.png',
		basepath+'produkte.png',
		basepath+'produktion_2.jpg',
		basepath+'schokolade.png',
		basepath+'torten_2.jpg',
		basepath+'torten.jpg',
		basepath+'aktuelles.png',
		basepath+'aktuelles.png',
		basepath+'aktuelles.png'
	);

	// Superfish für's Menu!
	jQuery("#main-navigation").superfish({
		delay:         1000,                 
	    animation:     {height:'toggle'},    
	    speed:         250,         
	    autoArrows:    false,   
	});

	// Animiere die drei Laschen in der oberen rechten Ecke
	jQuery("#laschen li").each(function () {
		jQuery(this).hide();
	});
	jQuery("#laschen li").each(function() {
		jQuery(this).delay(1000).show(450);
	});
	
	// Header-Image Gimmick
	var sliderContainer = jQuery("#slider-container");
	var sliderContainerHoverConfig = {
		over: function(){
			sliderContainer.animate({
				height: '600px'
			}, 450, 'swing');
		},
		out: function(){
			sliderContainer.animate({
				height: '390px'
			}, 450, 'swing');
		},
		timeout: 500,
		sensitivity: 5,
		interval: 750
	};
	sliderContainer.hoverIntent(sliderContainerHoverConfig);
});
