function $id(id){ if (typeof id == 'string') return document.getElementById(id); return id }
// get window size
function windowHeight() { return self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0 }

// get pixel position of an object
function getY(o){ var y = 0
	if (o.offsetParent) while (o.offsetParent) { y += o.offsetTop; o = o.offsetParent }
	return y
}

//composition effect, calls Opacity and (Width and/or Height) alltogether
function footer() {
	var h = windowHeight(), footer = $id('pageFooter'), bottom = getY($id('bottom'))
	var fh = footer.clientHeight || footer.offsetHeight // todo: why does IE report 0 for clientHeight?	
	if (bottom != 0) {
		if (bottom < h - fh) footer.style.marginTop = ((h - fh)-bottom-$id('bottom').offsetHeight)+'px'
		else footer.style.marginTop = 0
	}
	footer.parentNode.style.visibility = 'visible'
	
}

