	$(document).ready(function() {
	    $('#stage').cycle({ });
	    $('#stage-txt').cycle({ cleartype:  1 });
					
	    $("#nav-store").hover(function() {
				     $("#subnav").html("&rsaquo; Das Gesch&auml;ft - Heute & Damals");
					}, function() {
					     $("#subnav").html("&nbsp;");
					});

	    $("#nav-contact").hover(function() {
				     $("#subnav").html("&rsaquo; Anfragen &amp; Anfahrt");
					}, function() {
					     $("#subnav").html("&nbsp;");
					});
					
	    $("#nav-brands").hover(function() {
				     $("#subnav").html("&rsaquo; Lieferanten &amp; Hersteller");
					}, function() {
					     $("#subnav").html("&nbsp;");
					});
					
	    $("#nav-assortment").hover(function() {
				     $("#subnav").html("&rsaquo; Produkt und Entwurf");
					}, function() {
					     $("#subnav").html("&nbsp;");
					});
					
	});
	
	$(window).bind("load", function() {
    var activeOpacity   = 1.0,
        inactiveOpacity = 0.3,
        fadeTime = 450,
        clickedClass = "selected",
        thumbs = "#mosaik ul img";

    $(thumbs).hover(
        function(){
            $(this).fadeTo(fadeTime, activeOpacity);
        },
        function(){
            // Only fade out if the user hasn't clicked the thumb
            if(!$(this).hasClass(clickedClass)) {
                $(this).fadeTo(fadeTime, inactiveOpacity);
            }
        });
     $(thumbs).click(function() {
         // Remove selected class from any elements other than this
         var previous = $(thumbs + '.' + clickedClass).eq();
         var clicked = $(this);
         if(clicked !== previous) {
             previous.removeClass(clickedClass);
         }
         clicked.addClass(clickedClass).fadeTo(fadeTime, activeOpacity);
         var img = $(this).attr("code");
         var title = $(this).attr("txt");
         $("#float").html("<img src='img/showcase/"+img+".jpg'>");
         $("#sortimentheader").html(title);
         $("#float").slideDown();
     });
     
     
     	$('#float').click(function() { $("#float").slideUp(); $("#sortimentheader").html("Sortiment"); });
     
});