var piddivsx="";
var piddivdx="";
var pdasottrarre = 10;

function setHeightDivSxDx(iddivsx, iddivdx)
{
	piddivsx = iddivsx;
	piddivdx = iddivdx;
	pdasottrarre = 10;
	window.setTimeout("DOsetHeightDivSxDx()",300);

}
function setHeightDivSxDxInfoHeight(iddivsx, iddivdx,dasottrarre )
{
	piddivsx = iddivsx;
	piddivdx = iddivdx;
	pdasottrarre = dasottrarre ;
	window.setTimeout("DOsetHeightDivSxDx()",300);

}
function DOsetHeightDivSxDx()
{
	try
	{
		var objdivsx = $(piddivsx);
		var objdivdx = $(piddivdx);
		var objBottom = $$('.PP_Root');
				
		if (objdivsx != null && objdivdx != null)
		{
			var heightsx = 0;
			var heightdx = 0;
				 
			if (document.all)
			{
				heightsx = objdivsx.offsetHeight - pdasottrarre ;
				heightdx = objdivdx.offsetHeight - pdasottrarre ;			
			}
			else
			{
				heightsx = objdivsx.scrollHeight;
				heightdx = objdivdx.scrollHeight;						
			}
	  		
			objdivsx.style.height = Math.max(heightsx, heightdx) + "px";
			objdivdx.style.height = Math.max(heightsx, heightdx) + "px";

			if (objBottom != null)
			{
				objBottom.setStyle('position', "absolute");
				objBottom.setStyle('bottom', 0);
			}
/*
			if (heightsx >= heightdx)
			{
				objdivdx.style.height = heightsx + "px";
				/*
				if (typeof document.body.style.maxHeight != "undefined") {
				  // IE 7, mozilla, safari, opera 9
	  				objdivdx.style.minHeight = heightsx + "px";
				} else {
				  // IE6, older browsers
	  				objdivdx.style.height = heightsx + "px";
				}	
				*
			
			}
			else
			{
				objdivsx.style.height = heightdx + "px";	
				/*
				if (typeof document.body.style.maxHeight != "undefined") {
				  // IE 7, mozilla, safari, opera 9
					objdivsx.style.minHeight = heightdx + "px";	
				} else {
				  // IE6, older browsers			  	
					objdivsx.style.height = heightdx + "px";	
				}
				*
				
								
				if (objBottom != null)
				{
					objBottom.setStyle('position', "absolute");
					objBottom.setStyle('bottom', 0);
				}
				
			}
*/
		}
	}
	catch(e)
	{}
}
function setBackgroundImage(idImgReal, idImgHidden)
{
	try
	{
		$(idImgReal).style.backgroundImage="url('" + 	$(idImgHidden).getElementsByTagName("IMG")[0].src + "')";	
	}
	catch(e)
	{}
}

function ReplaceColorFirstWord(pRootClassName,pTagElement,pNewColor)
{	
	$$(pRootClassName).each(function(panel) 
	{
		try
		{
			var currValue = panel.getElementsByTagName(pTagElement)[0].innerHTML;
			var currValues = currValue.split(" ");
			var OutputValue = "";
			
			for (var i=0;i<=currValues.length-1;i++)
			{
				if (i==0)
				{
					OutputValue += "<span style=\"color:" + pNewColor+ "\">";
				}			
				OutputValue += currValues[i].toString() + "&nbsp";
				if (i==0)
				{
					OutputValue += "</span>";
				}			
			}				
			panel.getElementsByTagName(pTagElement)[0].innerHTML = OutputValue ;			
		}
		catch(e)
		{}		
	});
}


