var previousHeight = 0;
var documentHeight = 0;

function performAdjustments()
{
	if (document.getElementById('content_container').offsetHeight < 271)
	{
		if(!document.getElementById('custoemrservices_div'))
			document.getElementById('content_container').style.height = '271px';
	}
	
	if(navigator.appName == "Microsoft Internet Explorer" || navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
	{
		document.getElementById('main_nav').style.marginLeft = '112px';
		document.getElementById('download_box').style.marginTop = '4px';
		document.getElementById('from_country').style.marginBottom = '10px';
		document.getElementById('to_country').style.marginBottom = '10px';
		document.getElementById('calculation_type').style.marginBottom = '10px';
	}
	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		document.getElementById('loginpanelframe').style.width = '272px';
	}
	
	if(navigator.appName == "Microsoft Internet Explorer")
        browserHeight = document.documentElement.clientHeight;
    else
        browserHeight = window.innerHeight;
	wrapHeight = document.getElementById('wrap').offsetHeight;
	
	if(documentHeight == 0)
		documentHeight = wrapHeight;
		
	
	if(browserHeight > documentHeight && previousHeight != browserHeight)
	{
		//alert('adjusting...' + browserHeight + '+' + documentHeight + '=' + Number(browserHeight - documentHeight - 1));
		var needHeight = browserHeight - documentHeight - 1;
		document.getElementById('bottom_spacer').style.height = needHeight + 'px';
		previousHeight = browserHeight;
	}
}

var oldonload = window.onload;
if(typeof oldonload == 'function')
{
	window.onload = function(){
			oldonload();
			performAdjustments();
		}
}
else
{
	performAdjustments();
}

window.onresize = function(){
	setTimeout("performAdjustments()", 500);
};