Event.observe(window, 'load', SetupsIFR);
Event.observe(window, 'load', SetupIE);

function SetupIE()
{
	try
	{
		document.execCommand('BackgroundImageCache', false, true);
	}
	catch(e)
	{
	}
}

function SetupsIFR()
{
	if (window.ActiveXObject)
	{
		verOffset=navigator.userAgent.indexOf("MSIE");
		fullVersion  = parseFloat(navigator.userAgent.substring(verOffset+5));
		majorVersion = parseInt(''+fullVersion);
		if (majorVersion < 7)
		{
			return false;
		}
	}

	if (typeof sIFR == 'function')
	{
		sIFR.replaceElement('h3', named({sFlashSrc: '/Library/sIFR/sifr-meta.swf', sColor: '#000', sCase: 'upper'}));
		sIFR.replaceElement('h4', named({sFlashSrc: '/Library/sIFR/sifr-meta.swf', sColor: '#000'}));
		sIFR.replaceElement('h5', named({sFlashSrc: '/Library/sIFR/sifr-meta.swf', sColor: '#a80e18', sCase: 'upper'}));
	};
}

Event.observe(window, 'load', SetupContentHeight);
Event.observe(window, 'load', SetupAsideHeight);

function SetupAsideHeight()
{
	if (!$('Aside1-Other'))
	{
		return false;
	}

	var h = $('Container').offsetHeight - $('Aside1-Nav').offsetHeight - 20;
	if (h >= 0)
	{
		$('Aside1-Other').style.height = h + 'px';
	}
}

function SetupContentHeight()
{
	if (!$('Container'))
	{
		return false;
	}

	var ContentElem = $('Container').select('div.Content')[0];

	if (!$('Entry'))
	{
		return false;
	}

	var current_h = $('Entry').offsetHeight;

	if (current_h < $('Container').offsetHeight - 50)
	{
		$('Entry').style.height = ($('Container').offsetHeight - 87) + 'px';
	}
}
