// Zeigt den Entsprechenden Content an
function showProductContent(id) {
	// ID in eine Zahl wandeln
	id = id*1;
	
	// Wechselt die Display States
	for(var i = 1; i <= 3; i++) {
		if(i == id) {
			document.getElementById('product_content_'+i).style.display = 'block';
			document.getElementById('product_link_'+i).className = 'active';
		} else {
			document.getElementById('product_content_'+i).style.display = 'none';
			document.getElementById('product_link_'+i).className = '';
		}
	}
	
	// Setzt den passenden Background
	var background;
	switch(id) {
		case 1:
			background = "product_navi_left.png";
			break;
		case 2:
			background = "product_navi_center.png";
			break;
		case 3:
			background = "product_navi_right.png";
			break;
	}
	document.getElementById('product_navi').style.backgroundImage = "url(/templates/banneke/img/"+background+")";
}

function GetParam(param) {
	var url = String(window.location);
	if(window.location.search != "") {
		//Es gibt Parameter
		var undef = url.split("?");
		var args = undef[1].split("&");
		for(i = 0; i < args.length; i++) {
			var a = args[i].split("=");
			if(a) {
				if(a[0] == param) {
				return(a[1]);
				}
			}
		}
	}
}

$(function(){
	if(GetParam('show') == 'review') {
		// 1
		document.getElementById('product_content_1').style.display = 'none';
		document.getElementById('product_link_1').className = '';
		// 2
		document.getElementById('product_content_2').style.display = 'block';
		document.getElementById('product_link_2').className = 'active';
		// 3
		document.getElementById('product_content_3').style.display = 'none';
		document.getElementById('product_link_3').className = '';
		// Grafik setzen
		document.getElementById('product_navi').style.backgroundImage = "url(/templates/banneke/img/product_navi_center.png)";
	}
});

