  $(document).ready(function(){
		
		// Hauptnavigation (Droppy)
    $("#nav").droppy({speed: 300});
	
		// Sub-Navigation (Droppy)
    $("#subnav").droppy({speed: 200});
	
		// Slideshow (Cycle)
		$("#slides").cycle({ 
	    fx:    "fade", 
			speed:  800, 
	    pause:  3
		
		});
		
			
		// Tabs 
		$("#tabs").tabs({
			collapsible: true
		});
	
		// Color Box (Lightbox)
		$.fn.colorbox.settings.transition = "elastic";
		$.fn.colorbox.settings.bgOpacity = "0.45";
		$.fn.colorbox.settings.overlayClose = true;
		$.fn.colorbox.settings.contentCurrent = "Bild {current} von {total}";
		$(".cpModal").colorbox({transition:"elastic", opacity:0.6, fixedWidth: "690px", fixedHeight:"580px", current:"Bild {current} von {total}"});
		//	$(".cpModal").colorbox({fixedWidth: "700px", fixedHeight:"580px"});

		$("#kurs").colorbox({fixedWidth:"660px", fixedHeight:"700px", contentAjax:true});
		$("#season").colorbox({fixedWidth:"650px", fixedHeight:"400px", contentAjax:true});
		$("#gallery").colorbox({fixedWidth:"650px", fixedHeight:"540px", contentAjax:true});
		$("#team").colorbox({fixedWidth:"660px", fixedHeight:"90%", contentAjax:true});
		$("#flash").colorbox({fixedWidth:"560px",fixedHeight:"460px"});
		$("#newslettersb").colorbox({fixedWidth:"700px", fixedHeight:"640px", iframe:true});
		$("#newslettersn").colorbox({fixedWidth:"700px", fixedHeight:"640px", iframe:true});
		$("#newsletter").colorbox({fixedWidth:"700px", fixedHeight:"640px", iframe:true});
		$("#catalog").colorbox({fixedWidth:"50%", fixedHeight:"500px", contentAjax:true});
		$("#recommend").colorbox({fixedWidth:"50%", fixedHeight:"360px", iframe:true});
		$("#emailcon").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#flugzeug").colorbox({fixedWidth:"650px", fixedHeight:"750px", iframe:true});
		$("#bus").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#auto").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#sixt").colorbox({fixedWidth:"650px", fixedHeight:"70%", contentAjax:true});
		$("#caravan").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#mobilhome").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#chalet").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#asl").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#tent").colorbox({fixedWidth:"650px", fixedHeight:"50%", contentAjax:true});
		$("#advent").colorbox({fixedWidth:"865px", fixedHeight:"700px", iframe:true});
		
		
		// Random Sponsor Image
		var randomImage = ["/wellenreiten/images_tmpl/wt_footer_sport2.png","/wellenreiten/images_tmpl/wt_footer_epic.png"];
		var randomLink = ["http://www.sport2.de","http://www.epicsurf.de"];
		var rndNum = Math.ceil(Math.random() * randomImage.length-1);
		$(".myImage").attr("src",randomImage[rndNum]);
		$(".myAnchor").attr("href",randomLink[rndNum]);

		// ToggleMe
	    $(".toggle").click(function () {
			$("#togglediv").slideToggle("fast");
		});
	
               // ToggleMe2
	    $(".toggle2").click(function () {
			$("#togglediv2").slideToggle("fast");
		});
		
		// Random TeaserBoxen
		var randomImage = ["/wellenreiten/home/images/school1.jpg","/wellenreiten/home/images/school2.jpg"];
		var rndNum = Math.ceil(Math.random() * randomImage.length);
		$(".schoolteaser").attr("src",randomImage[rndNum]);

                var randomImage = ["/wellenreiten/home/images/travel1.jpg","/wellenreiten/home/images/travel2.jpg"];
		var rndNum = Math.ceil(Math.random() * randomImage.length);
		$(".travelteaser").attr("src",randomImage[rndNum]);

		var randomImage = ["/wellenreiten/home/images/kids1.jpg","/wellenreiten/home/images/kids2.jpg"];
		var rndNum = Math.ceil(Math.random() * randomImage.length);
		$(".kidsteaser").attr("src",randomImage[rndNum]);

		var randomImage = ["/wellenreiten/home/images/beachhouse1.jpg","/wellenreiten/home/images/beachhouse2.jpg"];
		var rndNum = Math.ceil(Math.random() * randomImage.length);
		$(".beachhouse").attr("src",randomImage[rndNum]);
		
		// Change the image of hoverable images
		$(".imgHoverable").hover( function() {
		    var hoverImg = HoverImgOf($(this).attr("src"));
		    $(this).attr("src", hoverImg);
		  }, function() {
		    var normalImg = NormalImgOf($(this).attr("src"));
		    $(this).attr("src", normalImg);
		  }
		);
	
	  });
	
	  function HoverImgOf(filename)	{
	   var re = new RegExp("(.+)\\.(gif|png|jpg)", "g");
	   return filename.replace(re, "$1_hover.$2");
	  }
	
	  function NormalImgOf(filename) {
	   var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
	   return filename.replace(re, "$1.$2");
	  }