function SetGlobalOnLoad(f)
{
	var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;
	if (root)
	{
		if(root.addEventListener)
		{
			root.addEventListener("load", f, false);
		}
		else if(root.attachEvent)
		{
			root.attachEvent("onload", f);
		}
	}
	else
	{
		if(typeof window.onload == 'function')
		{
			var existing = window.onload;
			window.onload = function()
			{
				existing();
				f();
			}
		}
		else
		{
			window.onload = f;
		}
	}
}

var oldSize=0;
window.onresize = nailFooterDown;
function nailFooterDown()
{
	var myHeight = 0;
	if( typeof( window.innerHeight ) == 'number' )
	{
		//Non-IE
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}

	var filler=document.getElementById('filler');
//	var contentHeight = document.body.scrollHeight;
	var contentHeight = document.getElementById('bodywrapper').scrollHeight;
	if((contentHeight<myHeight)&&(oldSize!=myHeight))
	{
		oldSize=myHeight;
		filler.style.display='block';
		filler.style.height=(myHeight-contentHeight)+'px';
	}
	else if(oldSize!=myHeight)
	{
		oldSize=myHeight;
		filler.style.display='none';
	}
}
SetGlobalOnLoad(nailFooterDown);
