$(document).ready(function(){

	//Blur Links (Prevents Outline)
	$('a.floorplan').click(function() {
		this.blur();
	});

	//Hide all item descriptions in the info box
	$("#floorplan-infobox > div").css("display", "none");

	//Call in the info box
	$(".floorplan-more a").click(function(){
		$("#floorplan-infobox").animate({bottom: '235px' }, 300);
		return false;
	});
	
	//Expand more info button on hover
	$(".floorplan-more").hover(function(){
		$(this).stop().animate({width: '18px'}, 200).css({'z-index' : '10'}); //Change the width increase caption size
	}, function () {
		$(this).stop().animate({width: '18px' }, 200).css({'z-index' : '1'});
	});
	

//Wohnzimmer1
    $('.grundriss1').hide();
	$("#wohnzimmer1").hover(
	function() {
	$(this).next(".grundriss1:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss1:first:visible").fadeOut("fast"); }, 1);
	});
//Wohnzimmer1

//Wohnzimmer2
    $('.grundriss1').hide();
	$("#wohnzimmer2").hover(
	function() {
	$(this).next(".grundriss1:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss1:first:visible").fadeOut("fast"); }, 1);
	});
//Wohnzimmer2

//Wohnzimmer3
    $('.grundriss1').hide();
	$("#wohnzimmer3").hover(
	function() {
	$(this).next(".grundriss1:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss1:first:visible").fadeOut("fast"); }, 1);
	});
//Wohnzimmer3


//Wintergarten1
    $('.grundriss2').hide();
	$("#wintergarten1").hover(
	function() {
	$(this).next(".grundriss2:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss2:first:visible").fadeOut("fast"); }, 1);
	});
//Wintergarten1

//Wintergarten2
    $('.grundriss2').hide();
	$("#wintergarten2").hover(
	function() {
	$(this).next(".grundriss2:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss2:first:visible").fadeOut("fast"); }, 1);
	});
//Wintergarten2

	
//Club1
    $('.grundriss3').hide();
	$("#club1").hover(
	function() {
	$(this).next(".grundriss3:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss3:first:visible").fadeOut("fast"); }, 1);
	});
//Club1

//Club2
    $('.grundriss3').hide();
	$("#club2").hover(
	function() {
	$(this).next(".grundriss3:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss3:first:visible").fadeOut("fast"); }, 1);
	});
//Club2

//Club3
    $('.grundriss3').hide();
	$("#club3").hover(
	function() {
	$(this).next(".grundriss3:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss3:first:visible").fadeOut("fast"); }, 1);
	});
//Club3

//Biergarten1
    $('.grundriss4').hide();
	$("#biergarten1").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten1

//Biergarten2
    $('.grundriss4').hide();
	$("#biergarten2").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten2

//Biergarten3
    $('.grundriss4').hide();
	$("#biergarten3").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten3

//Biergarten4
    $('.grundriss4').hide();
	$("#biergarten4").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten4

//Biergarten5
    $('.grundriss4').hide();
	$("#biergarten5").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten5

//Biergarten6
    $('.grundriss4').hide();
	$("#biergarten6").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten6

//Biergarten7
    $('.grundriss4').hide();
	$("#biergarten7").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten7

//Biergarten8
    $('.grundriss4').hide();
	$("#biergarten8").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten8

//Biergarten9
    $('.grundriss4').hide();
	$("#biergarten9").hover(
	function() {
	$(this).next(".grundriss4:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss4:first:visible").fadeOut("fast"); }, 1);
	});
//Biergarten9


//Sommergarten1
    $('.grundriss5').hide();
	$("#sommergarten1").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});

//Sommergarten1

//Sommergarten2
    $('.grundriss5').hide();
	$("#sommergarten2").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten2

//Sommergarten3
    $('.grundriss5').hide();
	$("#sommergarten3").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten3


//Sommergarten4
    $('.grundriss5').hide();
	$("#sommergarten4").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten4


//Sommergarten5
    $('.grundriss5').hide();
	$("#sommergarten5").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},
		
	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten5

//Sommergarten6
    $('.grundriss5').hide();
	$("#sommergarten6").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},

	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten6

//Sommergarten7
    $('.grundriss5').hide();
	$("#sommergarten7").hover(
	function() {
	$(this).next(".grundriss5:first:hidden").fadeIn("fast");
	},

	function() {
	var element = $(this);
	window.setTimeout(function() {
	element.next(".grundriss5:first:visible").fadeOut("fast"); }, 1);
	});
//Sommergarten7

						
	//Remove background, info box and hide all descriptions
	$("#floorplan-fade_bg, .floorplan-close").click(function(){
		$("#floorplan-fade_bg").fadeOut();
		$("#floorplan-infobox").animate({bottom: '-300px' }, 300, function() {
			$("#floorplan-infobox > div").css("display", "none");
		});
		return false;
	});

}); 

