var origHeight;

function resizeDiv(valorStr) {
	var alvo=document.getElementById('container');
	if(document.body.offsetHeight <= valorStr){
		alvo.style.height=valorStr+'px';
		//alert(valorStr);
	} else {
		alvo.style.height='100%'; // tem de ser definido aki senaum naum funfa
		//alert("else "+origHeight);
		//origHeight = document.body.offsetHeight;
	}
	origHeight = document.body.offsetHeight;
}

function resizeJanela() {
	var alvo=document.getElementById('container');
	if(alvo.style.height != '100%'){
		var temp = alvo.style.height; 
		alturaGeral = temp.substring(-1,temp.length - 2); 
		if((document.body.offsetHeight) >= (parseInt(alturaGeral)) ){
			alvo.style.height='100%';
			origHeight = document.body.offsetHeight;
			//alert("passou");
		} 
	} else { //### ESTAVA EM 100% ####
		//alert("estava em 100%");
		var temp = alvo.style.height; 
		alturaGeral = temp.substring(-1,temp.length - 2); 
		if((document.body.offsetHeight) >= (parseInt(alturaGeral)) ){
			alvo.style.height = origHeight;
			//alert("passou");
		} 
	}
}
window.onresize = resizeJanela;

