var origHeight;
function resizeDiv(valorStr) {
  var alvo=document.getElementById('flashContent');
  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;// uma saida seria gravar um cookie com este valor
}


function resizeJanela() {
  var alvo=document.getElementById('flashContent');
  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%");
    //resizeDiv(document.body.offsetHeight);
    var temp = alvo.style.height;
    alturaGeral = temp.substring(-1,temp.length - 2);
    if((document.body.offsetHeight) >= (parseInt(alturaGeral)) ){
      alvo.style.height = origHeight; //talvez recuperar cookie gravado
      //alert("passou");
    }
  }
}
window.onresize = resizeJanela;