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

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

function RelocateContacts(e)
{
	var Elems = [$('Entry'), $('Submenu'), $('Blog'), $('News')];
	var MaxPos = 0;

	for (var i = 0, Elem; (Elem = Elems[i] || i < Elems.length); i++)
	{
		if (Elem && Elem.id)
		{
			var tempmax = Element.positionedOffset(Elem)[1] + Element.getHeight(Elem);
			if (tempmax > MaxPos)
			{
				MaxPos = tempmax;
			}
		}
	}

	if (MaxPos < document.viewport.getHeight() - 50)
	{
		MaxPos = document.viewport.getHeight() - 50;
	}

	$('Contact').style.bottom = 'auto';
	$('Contact').style.top = (MaxPos) + 'px';

	$('e950').style.bottom = 'auto';
	$('e950').style.top = (MaxPos - 10) + 'px';

	var body = document.getElementsByTagName('body')[0];
	body.style.height = (MaxPos + 50) + 'px';
}
