DD_roundies.addRule('.startProductBoxBig .product', '6px');
DD_roundies.addRule('#wrapper', '6px');
DD_roundies.addRule('.detailImages', '6px');
DD_roundies.addRule('.subnavBox', '0 0 6px 6px');
DD_roundies.addRule('.aktuellesBox', '0 0 6px 6px');


this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 10;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$(".inlay2 a, a.tooltip").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = ($('img',this).attr('alt') != "") ? "<br/>" + $('img',this).attr('alt') : "";
		$("body").append("<p id='preview'><img src='"+ this.t +"' alt='Image preview' />"+ c +"</p>");
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$(".inlay2 a").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
};
/**
 * JS functions
 */
$(document).ready(function(){	
    /*
    $(".z").easyTooltip({
        useElement: "zoomy"	
    });
    */
    $('.tt').each(function(){
        $(this).wrap('<a class="tooltip" href="" title="' + $(this).attr('alt') + '" onclick="return false;"></a>')
    });

    imagePreview();

	var $sSpeed = $('#keyvisuals').attr('time_to_change');
	var $sTimeout = $('#keyvisuals').attr('time_change2change');
	
	$sSpeed = parseInt($sSpeed);
	$sTimeout = parseInt($sTimeout);
	
	$('#keyvisuals').innerfade({ 			
		speed: $sSpeed, 
		timeout: $sTimeout, 
		type: 'sequence', 
		containerheight: '300px' 
	});
	
	
	var $sSpeedBildw = $('#bildwechselfrm').attr('time_to_change');
	var $sTimeoutBildw = $('#bildwechselfrm').attr('time_change2change');
	
	$sSpeedBildw = parseInt($sSpeedBildw);
	$sTimeoutBildw = parseInt($sTimeoutBildw);
	
	$('#bildwechselfrm').innerfade({ 			
		speed: $sSpeedBildw, 
		timeout: $sTimeoutBildw, 
		type: 'sequence', 
		containerheight: '300px' 
	});

	
	$("#jsStartNavNew").click(function (){
		
		$("#jsStartNavNew").removeClass("active");
		$("#jsStartNavPrice").removeClass("active");
		$("#jsStartNavBest").removeClass("active");
		$("#jsStartNavNew").addClass("active");
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");

		$(".jsStartProductBoxBestPrice").addClass("hide");
		$(".jsStartProductBoxBestseller").addClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("show");
		$iNewHeight = $(".jsStartProductBoxNewest").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});
	
	$("#jsStartNavPrice").click(function (){
		
		$("#jsStartNavNew").removeClass("active");
		$("#jsStartNavPrice").removeClass("active");
		$("#jsStartNavBest").removeClass("active");
		$("#jsStartNavPrice").addClass("active");
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("hide");
		$(".jsStartProductBoxBestseller").addClass("hide");
		
		$(".jsStartProductBoxBestPrice").addClass("show");
		$iNewHeight = $(".jsStartProductBoxBestPrice").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});
	
	$("#jsStartNavBest").click(function (){
		
		$("#jsStartNavNew").removeClass("active");
		$("#jsStartNavPrice").removeClass("active");
		$("#jsStartNavBest").removeClass("active");
		$("#jsStartNavBest").addClass("active");
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("hide");
		$(".jsStartProductBoxBestPrice").addClass("hide");		
		
		$(".jsStartProductBoxBestseller").addClass("show");
		$iNewHeight = $(".jsStartProductBoxBestseller").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});

	$("#jsStartNavNewRendered").click(function (){
		$("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsover'));
		$("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsout'));
		$("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsout'));
		
		$("#jsStartNavNewImageRendered").hover(
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsover')) }
		);
		$("#jsStartNavPriceImageRendered").hover(
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsout')) }
		);
		$("#jsStartNavBestImageRendered").hover(
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsout')) }
		);
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");

		$(".jsStartProductBoxBestPrice").addClass("hide");
		$(".jsStartProductBoxBestseller").addClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("show");
		$iNewHeight = $(".jsStartProductBoxNewest").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});
	
	$("#jsStartNavPriceRendered").click(function (){
		$("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsout'));
		$("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsover'));
		$("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsout'));
		
		$("#jsStartNavNewImageRendered").hover(
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsout')) }
		);
		$("#jsStartNavPriceImageRendered").hover(
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsover')) }
		);
		$("#jsStartNavBestImageRendered").hover(
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsout')) }
		);
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("hide");
		$(".jsStartProductBoxBestseller").addClass("hide");
		
		$(".jsStartProductBoxBestPrice").addClass("show");
		$iNewHeight = $(".jsStartProductBoxBestPrice").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});
	
	$("#jsStartNavBestRendered").click(function (){
		$("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsout'));
		$("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsout'));
		$("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsover'));
		
		$("#jsStartNavNewImageRendered").hover(
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavNewImageRendered").attr('src', $("#jsStartNavNewImageRendered").attr('nxsout')) }
		);
		$("#jsStartNavPriceImageRendered").hover(
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavPriceImageRendered").attr('src', $("#jsStartNavPriceImageRendered").attr('nxsout')) }
		);
		$("#jsStartNavBestImageRendered").hover(
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsover')) },
			function () { $("#jsStartNavBestImageRendered").attr('src', $("#jsStartNavBestImageRendered").attr('nxsover')) }
		);
		
		$(".jsStartProductBoxNewest").removeClass("show");
		$(".jsStartProductBoxBestPrice").removeClass("show");
		$(".jsStartProductBoxBestseller").removeClass("show");
		$(".jsStartProductBoxNewest").removeClass("hide");
		$(".jsStartProductBoxBestPrice").removeClass("hide");
		$(".jsStartProductBoxBestseller").removeClass("hide");
		
		$(".jsStartProductBoxNewest").addClass("hide");
		$(".jsStartProductBoxBestPrice").addClass("hide");		
		
		$(".jsStartProductBoxBestseller").addClass("show");
		$iNewHeight = $(".jsStartProductBoxBestseller").attr('iUsedHeight');
		$("#jsStartFrame").css( 'height', $iNewHeight+"px" );
	});
	
	
	
	
	
	
	
	$("#jsDetailNavDescription").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout')) }
		);
		
		$("#jsDetailNavDescriptionBox").show();
		$("#jsDetailNavVideoBox").hide();
		$("#jsDetailNavBewertungBox").hide();
	});
	
	$("#jsDetailNavVideo").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout')) }
		);
		
		$("#jsDetailNavDescriptionBox").hide();
		$("#jsDetailNavVideoBox").show();
		$("#jsDetailNavBewertungBox").hide();
	});
	
	$("#jsDetailNavVideoRight").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsout')) }
		);
		
		$("#jsDetailNavDescriptionBox").hide();
		$("#jsDetailNavVideoBox").show();
		$("#jsDetailNavBewertungBox").hide();
	});
	
	$("#jsDetailNavBewertung").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) }
		);
		
		$("#jsDetailNavDescriptionBox").hide();
		$("#jsDetailNavVideoBox").hide();
		$("#jsDetailNavBewertungBox").show();
	});	
	
	$("#jsDetailNavBewertungTopRight").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) }
		);
		
		$("#jsDetailNavDescriptionBox").hide();
		$("#jsDetailNavVideoBox").hide();
		$("#jsDetailNavBewertungBox").show();
	});
	
	$("#jsDetailNavBewertungTopRight2").click(function (){
		$("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout'));
		$("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout'));
		$("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover'));
		
		$("#jsDetailNavDescriptionImage").hover(
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsover')) },
			function () { $("#jsDetailNavDescriptionImage").attr('src', $("#jsDetailNavDescriptionImage").attr('nxsout')) }
		);
		$("#jsDetailNavVideoImage").hover(
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsover')) },
			function () { $("#jsDetailNavVideoImage").attr('src', $("#jsDetailNavVideoImage").attr('nxsout')) }
		);
		$("#jsDetailNavBewertungImage").hover(
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) },
			function () { $("#jsDetailNavBewertungImage").attr('src', $("#jsDetailNavBewertungImage").attr('nxsover')) }
		);
		
		$("#jsDetailNavDescriptionBox").hide();
		$("#jsDetailNavVideoBox").hide();
		$("#jsDetailNavBewertungBox").show();
	});		

	$("img").each(function (i){
		if ($(this).attr("nxsover") && $(this).attr("nxsover") != "")
		{
			preloadOver = new Image();
			preloadOver.src = $(this).attr('nxsover');
			if (!$(this).attr("nxsout") || $(this).attr("nxsout") == "") {
				$(this).attr('nxsout', $(this).attr('src'));
				$(this).hover(
					function () { $(this).attr('src', $(this).attr('nxsover')) },
					function () { $(this).attr('src', $(this).attr('nxsout')) }
				);
			}
			else
			{
				if ($(this).attr('src') != $(this).attr('nxsover'))
				{
					$(this).hover(
						function () { $(this).attr('src', $(this).attr('nxsover')) },
						function () { $(this).attr('src', $(this).attr('nxsout')) }
					);
				}
				else
				{
					$(this).hover(
						function () { $(this).attr('src', $(this).attr('nxsover')) },
						function () { $(this).attr('src', $(this).attr('nxsover')) }
					);
				}
			}
			preloadOut = new Image();
			preloadOut.src = $(this).attr('nxsout');			
		}
	});
	
});

