function toggleFontSize(targetElementID, fontSize, lineHeight)
{
	var target = $(targetElementID);
	
	// do this, only if the element exists
	if(target)
	{
		target.descendants().each
		(
			function(child)
			{
				if(child.tagName.toLowerCase() == "p")
				{
					child.style.fontSize = fontSize;
					child.style.lineHeight = lineHeight
					
				}
			}
		);
	}
}

function updateTextSizeLinkStates(lnkActiveID)
{
	var lnkActive = $(lnkActiveID);
	
	if(lnkActive)
	{	
		lnkActive.blur();
		lnkActive.addClassName("active");
		
		lnkActive.siblings().each
		(
			function(sibling)
			{
				if(sibling.tagName.toLowerCase() == "a")
					sibling.removeClassName("active");
			}
		);	
	}
}

function popupImage(imgPath)
{
    imgWinOptions = "width=275,height=200,scrollbars=0,left=50,top=50,screenx=50,screeny=50,resizable=no,toolbar=no,status=no,location=no";
    var imgWin = window.open(imgPath,"imageView", imgWinOptions);
    imgWin.focus();
}

function trim(str)
{
    if(str && typeof(str) == "string")
        str = str.replace(/^\s+/, "").replace(/\s+$/, "");
        
    return str;
}