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

		// Selecting only the visible layers:
		var versions = $('.textVersion:visible');
		
		if(versions.length<2){
			// If only one layer is visible, show the other
			$('.textVersion').fadeIn(800);
		}
		else{
			// Hide the upper layer
			versions.eq(0).fadeOut(800);
		}
	},1000);

    // Top-Navigation
    $('#menu li').hover(
        function () {
            //show its submenu
            $('ul', this).slideDown();
            $('ul li ul', this).slideUp(0);
        }, 
        function () {
            //hide its submenu
            $('ul', this).slideUp();
        }
    );
    // Slideshow auf Startseite
    $('.slideshow1').cycle({
        fx: 'scrollDown',
        delay:-6000,
        timeout: 9000,
        speed: 3000,
        prev: '#left-arrow',
        next: '#right-arrow',
    });
    $('.slideshow2').cycle({
        fx: 'scrollUp',
        delay:-6000,
        timeout: 9000,
        speed: 3000,
        prev: '#left-arrow',
        next: '#right-arrow',
    });
});
// Feedback-Fenster
$(function(){
    $('#contact').contactable({
        subject: 'Eine Kontaktanfrage'
    });
});
