// JavaScript Document
	var timer;
	var index = -1;
	var index2 = null;
	var max = 0;
	
	function toggleProduct()
	{
		$("#produkts").fadeOut(300, function() {
			$("#produkts div").each(function(event, obj)
			{
				if (event == index) {
					$("#deteilnavi_startseite ul a:eq(" + index + ")").css('background-position', '-183px 0');
					$(obj).show();
				} else {
					$("#deteilnavi_startseite ul a:eq(" + index2 + ")").css('background-position', '0 0');
					$(obj).hide(); 
				}
			});
			$("#produkts").fadeIn(2000);
		});
		
		index++;
		index2 = index - 1;
		if (index >= max) {
			index = 0;
			index2 = max-1;
		}
		
		timer=setTimeout("toggleProduct()", 10000);
	}
	
	function showProduct(product)
	{
		$("#produkts div").each(function(event, obj)
		{
			if ($(obj).attr("class") == product) {
				$(obj).show();
			} else {
				$(obj).hide(); 
			}
		});
	}
	
	$(document).ready(function()
	{
		max = $("#produkts div").length;
		showProduct(null);
		
		toggleProduct();
		//showProduct("light");
		
		$("#deteilnavi_startseite ul li").mouseover(function(event, obj)
		{
			$("#deteilnavi_startseite ul a").css('background-position', '');
			clearTimeout(timer);
			
			var $target = $(event.target);
			$target.css('background-position', '-183px 0');
			id = $target.attr("class").substring(6);
			showProduct(id);
		});
	});