﻿
	var commentAreaStartHeight=0;
	var scrollPixel=6;
	function resizeCommentArea(caID){
		caTimer="caTimer" + caID;
		try{
		clearInterval(caTimer);
		}
		catch(e){}
		caC=document.getElementById("derKommentarVorhang" + caID);
		ca=document.getElementById("derKommentar" + caID);
		cTheArrow=document.getElementById("kommentarPfeil" + caID);
	
		if(commentAreaStartHeight==0){commentAreaStartHeight=parseInt(caC.style.height);}
		
		if (parseInt(caC.style.height) > commentAreaStartHeight){
			fromHeight=parseInt(caC.style.height);
			toHeight=commentAreaStartHeight;
			
		}
		else{
			fromHeight=commentAreaStartHeight;
			toHeight=ca.offsetHeight;
			
		}
		
		caTimer = setInterval(function callFunc() { doResize(caTimer,ca,caC,fromHeight,toHeight); }, 10);
		/*doResize(caTimer,ca,caC,fromHeight,toHeight);*/
	}
	function doResize(caTimer,ca,caC,fromHeight,toHeight){
		if (fromHeight < toHeight){
			try{cTheArrow.src="/images/pfeilUp.png";}catch(e){}
			if (parseInt(caC.style.height) < toHeight){
				dummyHeight=parseInt(caC.style.height) + scrollPixel;
				caC.style.height=dummyHeight + "px";
				window.scrollBy(0,scrollPixel);
			}
			else{
				clearInterval(caTimer);
			}
		}
		else{
			try{cTheArrow.src="/images/pfeilDown.png";}catch(e){}
			if (parseInt(caC.style.height) > toHeight){
				dummyHeight=parseInt(caC.style.height) - scrollPixel;
				caC.style.height=dummyHeight + "px";
				window.scrollBy(0,- scrollPixel);						
			}
			else{
				clearInterval(caTimer);
			}
		}
	
	}
	
	function checkForArrow(caID){
		caC=document.getElementById("derKommentarVorhang" + caID);
		ca=document.getElementById("derKommentar" + caID);
		cTheArrow=document.getElementById("kommentarPfeil" + caID);
		if(caC.offsetHeight > ca.offsetHeight){
			try{cTheArrow.src="/img/1x1.gif";}catch(e){}
		}
		
	}
	
	
/*
<div style="float:left; width:455px;" onClick="resizeCommentArea(#currentrow#);">
	<div id="derKommentarVorhang#currentrow#" style="height:43px; overflow-y:hidden; background-color:##FFF;">
		<div id="derKommentar#currentrow#" style="text-align:justify; padding:6px">#derKommentarNoMoz#</div>
		
	</div>
	<div id="derKommentarButton#currentrow#" style="height:14px; background-color:##FFF; text-align:center; padding:2px 0px 2px 0px"><img id="kommentarPfeil" src="/images/pfeilDown.png" border="0" /></div>
</div>

*/
