var parentHeight;

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function resize() 
{
    var parentHeight = $('#content-cont').height();
    $('#content').css('height',parentHeight);
    $('#content').scrollbar({arrows: false});
}

function resizeBackground() 
{
    //console.log(parentHeight);
    var bgHeight = $('#background').height();
    //console.log(bgHeight);
    if(parentHeight < bgHeight) {
	var my = parseInt(((bgHeight - parentHeight)/2));
	$('#background').css('top',-my);
    } else {
	$('#background').css('top','');
    }
}

//$('document').ready(function(){

    $(window).load(function(){
	parentHeight = getDocHeight();
	resize();
	resizeBackground();
	$('body').hide();
	$('body').css('visibility','visible');
	$('body').fadeIn('slow');
    });
//});
