var transBckgObj = null;
var infoBoxObj = null;

function initInfoBox()
{
    transBckgObj = getRef('transBckg');
    infoBoxObj = getRef('infoBox');
    
    window.onresize = Window_OnChange;
    window.onscroll = Window_OnChange;
        
    PositionBox();
}

function HideInfoBox()
{
    if (infoBoxObj && transBckgObj)
    {
        infoBoxObj.style.display = 'none';
        transBckgObj.style.display = 'none';
    }
    
    //window.onresize = null;
    //window.onscroll = null;
}

function Window_OnChange(e)
{
    PositionBox();
}

function PositionBox()
{    
    if (infoBoxObj && transBckgObj)
    {
        transBckgObj.style.width = document.documentElement['clientWidth'] + 'px';
        transBckgObj.style.height = document.documentElement['scrollHeight'] + 'px';     
        
		if (document.documentElement['clientHeight']/2 - infoBoxObj.offsetHeight/2 + document.documentElement['scrollTop'] < 0)
		{
			infoBoxObj.style.top = 20 + 'px'
		}
		else infoBoxObj.style.top = document.documentElement['clientHeight']/2 - infoBoxObj.offsetHeight/2 + document.documentElement['scrollTop'] + 'px';   

        infoBoxObj.style.left = document.documentElement['clientWidth']/2 - infoBoxObj.offsetWidth/2 + 'px';               
    }
}
