
function resizeDivTexte()
{

	var myHeight;
	var oDivTop = document.getElementById("divPositionTop");
	var oDivBottom = document.getElementById("divPositionBottom");
	var oDiv = document.getElementById("divScroll");
	
	
	if (oDiv != null) 
	{
		if (getStyle(oDiv, 'position') == 'relative')
		{
			oDiv.style.height = 1;	
			

			if ((oDivTop != null) &&(oDivBottom != null))
			{
				var offsetY = 7;
				
				if ((document.all) && (oDiv.OFFSET!=null))
				{
					//IE
					offsetY += parseInt(oDiv.OFFSET, 10);
				}
				else if(oDiv.attributes["OFFSET"] != null)
				{
					//Firefox
					offsetY += parseInt(oDiv.attributes["OFFSET"].nodeValue,10)
				}
				
				if (!document.all){offsetY += 12;}			

				/*
				alert(	"ClientHeight: " + (document.body.clientHeight) + 
						"\n Top.Top:" +  oDivTop.offsetTop + 
						"\n Bottom.Top:" +  oDivBottom.offsetTop + 
						"\nBottom.Height : " +  oDivBottom.offsetHeight + 
						"\nOffsetY : " +  offsetY + 
						"\nDiv.Height :" + Math.max(0, document.body.clientHeight - oDivBottom.offsetHeight - oDivTop.offsetTop - offsetY ));
				*/
				
				oDiv.style.posTop = 0;
				oDiv.style.zIndex = 0;
				oDiv.style.height = Math.max(0, document.body.clientHeight - oDivBottom.offsetHeight - oDivTop.offsetTop - offsetY);
			}			
		}
		else
		{
			oDiv.style.height = "auto";
		}
	}
}


function getStyle(el,styleProp)
{
	if (window.getComputedStyle)// Mozilla
		var y = window.getComputedStyle(el,null).getPropertyValue(styleProp);
	else if (el.currentStyle)// Explorer 6
	{
		if (styleProp!='clip')
		{
			while (styleProp.indexOf('-') != -1)
			{
				// clear '-' and UpperCase first next letters : background-color => backgroundColor
				var letter = styleProp.charAt(styleProp.indexOf('-')+1);
				styleProp = styleProp.replace(/-\S{1}/,letter.toUpperCase());
			}
			var y = eval('el.currentStyle.' + styleProp);
		}
		else
		{// Return clip style in mozilla format : rect(top,right,bottom,left)
			ctop=el.currentStyle.clipTop;
			cright=el.currentStyle.clipRight;
			cbottom=el.currentStyle.clipBottom;
			cleft=el.currentStyle.clipLeft;
			y='rect('+ctop+','+cright+','+cbottom+','+cleft+')';
		}
	}
	return y;
}