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 addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
	window.onload = func;
    } else {
	window.onload = function() {
	    if (oldonload) {
	        oldonload();
	    }
	    func();
	}
    }
    
    var oldonresize = window.onresize;
    if (typeof window.onresize != 'function') {
	window.onresize = func;
    } else {
	window.onresize = function() {
	    if (oldonresize) {
	        oldonresize();
	    }
	    func();
	}
    }
}

//should be merged with other flash middle js

addLoadEvent(function() {
	var Padding = (Math.floor((getDocHeight() - document.getElementById("inner").clientHeight) / 2));
	if (Padding < 0) {
		Padding = 0;
	}
	document.getElementById("outer").style.paddingTop = Padding + 'px';
	return false;
})

