

function center(){
    // ustawienia
    
    var contentName = 'center'; // Element który ma być wyśrodkowany pionowo
    // zmienne
    bodyHeight = document.body.offsetHeight;
    bodyWidth = document.body.offsetWidth;
    content = document.getElementById(contentName);
    contentHeight = content.offsetHeight;
    contentMargin = '';
    contentHeight = contentHeight / 2;
    bodyHeight = bodyHeight / 2;
    contentMargin = bodyHeight - contentHeight;
    if (contentHeight < bodyHeight) {
        content.style.top = contentMargin + 'px';
    } else if (contentHeight > bodyHeight) {
		content.style.top = contentMargin + 100 + 'px';
	}
}
