$(document).ready(function() {

	/* Umschalter fuer die Listenansicht */
	
	$("#ButtonDisplayItems").click(function() {
		$("#List").removeClass("displayList");
		$("#List").addClass("displayItem");
	});
	$("#ButtonDisplayList").click(function() {
		$("#List").removeClass("displayItem");
		$("#List").addClass("displayList");
	});

	/* Produktboxen */
	
	/* Beim Start alle verstecken */
	
	$(".itemBox").removeClass("productboxshow").addClass("productboxhide");

	/* Wenn wir über einem Cover sind: Anzeigen */
	
	$(".itemImage").hover(function() { 
		/* Nur in Item-Ansicht relevant */
		if ($("#List").hasClass("displayItem")) {
			$(".itemBox").removeClass("productboxshow").addClass("productboxhide");
			$(this).parents(".listItem").children(".itemBox").removeClass("productboxhide").addClass("productboxshow");
		}
   	}, function(){});

	/* Wenn wir die Box wieder verlassen: Ausblenden */
	
   	$(".itemBox").hover(function(){}, function() {
		/* Nur in der Item-Ansicht wieder verstecken! */
		if ($("#product-list").hasClass("displayItem")) {
			$(this).removeClass("productboxshow").addClass("productboxhide");
		}
   	});
	
	/* Die Close-Buttons schliessen ebenfalls die Produktboxen */
	
	$(".btnCloseItems").click( function() {
		$(this).parents(".itemBox").removeClass("productboxshow").addClass("productboxhide");	
	});
	
});

