/*
function displayNewsItem(str_divID)
{
	var bol_changed = false;
	for (i=1; i<4;i++)
	{
		if ((document.getElementById(str_divID + i) != null) && !bol_changed && (document.getElementById(str_divID + i).style.display == 'none') )
		{
			document.getElementById(str_divID + i).style.display = 'block';
			bol_changed = true;
		}
	}
	
}

function hideNewsItem(str_divID)
{
	var bol_changed = false;
	for (i=3; i>0;i--)
	{
		if ((document.getElementById(str_divID + i) != null) && (document.getElementById(str_divID + i).style.display == 'block') && !bol_changed)
		{
			document.getElementById(str_divID + i).style.display = 'none';
			bol_changed = true;
		}
	}
}
*/
function displayNewsItem(str_divID,bol_Show) {
	var bol_changed = false;
	var targetStyle = (bol_Show)?'block':'none';
	var lastShown = 0;
	
	for (i=1;i<4;i++) if ($(str_divID + i)&& $(str_divID + i).style.display == 'block') lastShown = i;
	if (bol_Show) {
		lastShown++;
		/* display the minus graphic */
		$(str_divID + 'Minus').innerHTML = '<a href="" onclick="displayNewsItem(\''+str_divID+'\',false);return false;"><img src="/images/widgets/minus.png" align="absmiddle" border="0" style="width:21px;height:21px;float:right;border:none;position:relative;right:0px;" /></a>';
	}
	if ((!bol_Show) && (lastShown == 1)) {
		/* hide the minus graphic */
		$(str_divID + 'Minus').innerHTML = '<img src="/images/spacer.gif" align="absmiddle" border="0" style="width:21px;height:21px;float:right;border:none;position:relative;right:0px;" />';
	}
	if ($(str_divID + lastShown)) $(str_divID + lastShown).style.display = targetStyle;
	
	expandTableHeight();
}


var tableOriginalHeight = false;
Event.observe(window,'load',function(){tableOriginalHeight = $('mainFrame').offsetHeight;});
function expandTableHeight() {
	var newTableHeight = $('mainFrame').offsetHeight;
	if (newTableHeight-tableOriginalHeight>0) {
		if (!$('expandable_placeholder')) {
			// Need to find and assign an assignable placeholder
			var blank_spacers = $('mainFrame').select('.blank_spacer');
			if (blank_spacers.length > 0) {
				// Set the first
				blank_spacers[0].id = 'expandable_placeholder';
				tableOriginalHeight -= blank_spacers[0].offsetHeight;
			}
		}
		if ($('expandable_placeholder')) $('expandable_placeholder').style.height = (newTableHeight-tableOriginalHeight)+'px';
	}
}