function getHeight(elName) {
  var height = document.getElementById(elName).style.height;
  return height;
}

function resize_iframe()
{
  var el = document.getElementById("dokuwiki");
  if(el) {
    // Resize width
    var width = window.innerWidth; // Firefox
    if (document.body.clientWidth) {
      width=document.body.clientWidth; // IE
    }
    el.style.width=parseInt(width-200-20-3)+"px";
    
/*
    try {
      // Resize height according to the iframe pages size
      var oBody = el.contentWindow.document.body;
      el.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
    
    }
    
    //An error is raised if the IFrame domain != its container's domain
    catch(e) {
      window.status =  'Error: ' + e.number + '; ' + e.description;
*/
      
      // Resize height to fit the browser window
      var height = window.innerHeight; // Firefox
      if (document.body.clientHeight) {
        height=document.body.clientHeight; // IE
      }
      
      var offsetTop = el.offsetTop;
      var parentEl = el.offsetParent;
      while (parentEl) {
        offsetTop += parentEl.offsetTop;
        parentEl = parentEl.offsetParent;
      }
    
      var padding = 30;
      el.style.height=parseInt(height-offsetTop-getHeight("footer")-padding-8)+"px";
/*
    }
*/
  }
}

window.onresize=resize_iframe; 


