
/* SCRIPT PARA AJUSTE DO FOOTER
---------------------------------------------- */
function footer() {
	var h = windowHeight(), footer = $id('footer'), bottom = getY($id('bottom')), sidebar = $id('sidebar')
	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-3)+'px'
		else footer.style.marginTop = 0
	}
	footer.parentNode.style.visibility = 'visible';
}
/* FUNCAO PARA PEGAR O TAMANHO DA JANELA */
function windowHeight() {
	return self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0
}
function $id(id){ 
	if (typeof id == 'string') return document.getElementById(id); 
	return id;
}
/* GET PIXWL POSITION OF AN OBJECT */
function getY(o){ 
	var y = 0
	if (o.offsetParent) while (o.offsetParent) { y += o.offsetTop; o = o.offsetParent }
	return y;
}
