// Menuinfobox nach unten verlagern - noch nicht optimal!!!
$(document).ready(function() {
	var contentheight = $('#contentwrap').height();
	var teaserHeight = $('.infoboxfoot').height();
	var teaserHeight2 = $('#infobox2').height();
	var menuh = $('#menu').height();
	var menuheight = contentheight-teaserHeight-menuh-209;
	
	if((menuheight > teaserHeight2)) {
		$('#infobox2').css('height', menuheight + 'px');
	}
});

// Toggle
$(document).ready(function(){
	$(".toggle_container1").hide();
	$("#toggle1").click(function(){
		$(".toggle_container1").slideToggle("slow,");
	});
	
	$(".toggle_container2").hide();
	$("#toggle2").click(function(){
		$(".toggle_container2").slideToggle("slow,");
	});
	
	$(".toggle_container3").hide();
	$("#toggle3").click(function(){
		$(".toggle_container3").slideToggle("slow,");
	});
});

// Anmeldungsfehler (Toggleboxen show!)
$(document).ready(function(){
	var url = document.URL
	if(url.match(/\bpage_action=login\w*/gi))
	{
		var string = $(".info_error").wrap('<li class="infoError">').children().html();
		if(string.match(/\bLogin fehlgeschlagen\w*/gi) || string.match(/\bfalschen Benutzernamen\w*/gi))
			$(".toggle_container1").show();	
		if(string.match(/\bBitte geben\w*/gi))
			$(".toggle_container2").show();
	}
});

// Breite für Seitenanzahl
$(document).ready(function(){
	var pagelinksw = $('#pagelinks').width();
	var productw = $('#product_listing').width();
	var leftpadding = ((productw - pagelinksw)/2);
	$('#pagelinks').css('margin-left',leftpadding+'px');
});

