
// AUFKLAPPEN VON ZULANGEN LISTEN
function CheckForLimitDIVs() {
	//$(".limit_box").each(LimitDIV);

	$(".limit_box").each(function(){ $(this).truncate(100, {trail: ["<a href='#' class='truncate_show'>+ mehr</a>", "<a href='#' class='truncate_hide'>- weniger</a>"]}); });
}
	function LimitDIV()
	{
		var rel = $(this).attr("rel");
		var regEx = /maxheight\:([0-9]+)/;
		regEx.exec(rel);
		var maxHeight = RegExp.$1;
		
		
		// adding Code after DIV
		if( $(this).height() > maxHeight )
		{
			$(this).height(maxHeight + "px");
			$(this).after("<div class=\"limit_height_more\"><a style=\"display: block; padding: 2px; border-top: 1px dotted #dedede; text-align: right\" href=\"javascript: \" onclick=\"LimitDIVClap(this);\">+ komplete Liste</a></div>");
		}
	}
	
	function LimitDIVClap(ele) 
	{
		
		$div = $(ele).parent().parent().find(".limit_box");		
		var divVars = $div.attr("rel");
		var divReg = /maxheight\:([0-9]+)/;
		divReg.exec(divVars);
		var divMaxHeight = RegExp.$1;
		var divHeight = $div.height();
		$divContent = $div.find("p");
		if( divHeight == divMaxHeight )
		{
			$div.animate({height: $divContent.height() + "px" }, 1000);
			$(ele).html("- Anzeige reduzieren");
		} else {
			$div.animate({height: divMaxHeight + "px" }, 1000);
			$(ele).html("+ komplette Liste");
		}
	}