function showProduct(id) {
	$("#productoverview").slideUp(200, function() {$("#product" + id).slideDown(500);});
	/*
	var prodDivs = $('div[class=produkt]');
	for (var i = 0; i < prodDivs.length; i++) {
		prodDivs[i].style.display = 'none';
	}
	var productdiv = document.getElementById("product" + id);
	if (productdiv != null) {
		productdiv.style.display = "block";
	}
	*/
}

function hideProduct(id) {
	$("#product" + id).slideUp(200, function() {$("#productoverview").slideDown(500);});
}

function merklisteAdd(id) {
	showProgressCursor();
	$('#merkliste').load('fileadmin/template/scripts/merklisteajax.php?merklisteaction=add&merkproduct_id=' + id,
						 hideProgressCursor);
}

function merklisteRemove(id) {
	showProgressCursor();
	$('#merkliste').load('fileadmin/template/scripts/merklisteajax.php?merklisteaction=remove&merkproduct_id=' + id,
			 			 hideProgressCursor);
}

function showProgressCursor() {
	$('body').css('cursor', 'progress');
	$('a').css('cursor', 'progress');
}

function hideProgressCursor() {
	$('body').css('cursor', 'auto');
	$('a').css('cursor', 'pointer');
}

jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		if (oldonload) {
			oldonload();
		}
			func();
		}
	}
}


var slidingInterval = false;
function startSlidingPanelInterval() {
	slidingInterval = window.setInterval("nextSlidingPanel()", 2000);
}

function stopSlidingPanelInterval() {
	window.clearInterval(slidingInterval);
}

var slidingCounter = 0;
function nextSlidingPanel() {
	slidingCounter++;
	if (slidingCounter == 5) {
		sp1.showFirstPanel();
		slidingCounter = 0;
	} else {
		sp1.showNextPanel();
	}
}


