function update_height(janela)
{
	var height = janela.document.body.scrollHeight;
	var iframes = document.getElementsByTagName('iframe');
	var i = 0;
	while (iframes[i].contentWindow != janela)
	 {
	  i++;
	 } 	

	if (iframes[i].style.height != height)
	{
		iframes[i].style.height = height;
	}
	else
	{
		return;
	}
	var parent_object = iframes[i].parentNode;
	if (parent_object.tagName == 'DIV')
	 {
		parent_object.style.height = height;			
	 }	 
	 
	 if (window.parent != window)
	 {
	 	update_height_outside();
	 }
}

function update_height_outside()
{
	 if (window.parent != window)
	 {
	 	window.parent.update_height(window);
	 }
	 else if (window.document.body.id != 'index')
	 {
	 	var height = window.document.body.scrollHeight+80;
	 	if (height > window.screen.height - 100) {height = window.screen.height-100;}
	 	var largura = window.document.body.scrollWidth + 10;
	 	window.resizeTo(largura,height);
	 }
}