
function teaserKurzen(){

	var cmt = document.getElementById('TeaserBox');
	
	if(cmt){

		var cmtDivColl = cmt.getElementsByTagName('div');

		// minHeight
		var minHeight = 250;
		var teaserHeight = document.getElementById('TeaserBox').offsetHeight;
		
		var contentHeight = document.getElementById('content').offsetHeight;
		contentHeight  = (contentHeight < 250)?250:contentHeight-250;
		
		
		if(teaserHeight > minHeight || teaserHeight > contentHeight){			
			if(contentHeight > minHeight){minHeight = contentHeight}
			var delta = teaserHeight - minHeight;
		}
		
		

		// get teaserBox heights
		var heightList = new Array();
		var totalHeight = 0;
		var addHeight = 0;
		var abstand = 23;

		for(var i=0; cmtDivColl[i]; i++){	
			
			if(cmtDivColl[i].className.indexOf('teaser')>=0 || cmtDivColl[i].className.indexOf('navigation')>=0){
				totalHeight += cmtDivColl[i].offsetHeight + abstand;
				heightList.push({'div':cmtDivColl[i], 'height': cmtDivColl[i].offsetHeight + abstand});
				//console.log('heightList:'+heightList[heightList.length-1].height);
			}
		}
		
		
	
		var runningHeight = 0;
		var LUT = new Array();
		
		for (i=0; heightList[i]; i++){
		
			currentHeight = heightList[i].height;
			
			if (runningHeight + currentHeight <= minHeight) {
				runningHeight += currentHeight;
				heightList[i].div.style.visibility = "visible";
			}else{
				LUT.push(i);
			}
		}
			
		
		for (i=0; i< LUT.length; i++){
			heightList[LUT[i]].div.style.display = "none";		
		}


	}
}

EventManager.addListener(window,'load', teaserKurzen);