//iframe automatic height adjuster!

function getBody (iframeWindow){
     return (iframeWindow.document.compatMode && iframeWindow.document.compatMode == "CSS1Compat") ? iframeWindow.document.documentElement : iframeWindow.document.body || null;
}

function determineHeight(iframeWindow){
     if (typeof iframeWindow.document.height != 'undefined')
       return iframeWindow.document.height;
     else
     {
       var obj = getBody(iframeWindow);
       return obj.scrollHeight;
     }
}

function adjustIFrameSize (iframeWindow) {

  height = determineHeight(iframeWindow);

  if (height) {
    var iframeElement = document.getElementById(iframeWindow.name);
    if(height <= 420){
    iframeElement.style.height = 418+'px';
    } else {
        iframeElement.style.height = height + 10 + 'px';
    }
  }
  else if (document.all) {
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat')
    {
        if(iframeWindow.document.documentElement.scrollHeight <= 420){
    iframeElement.style.height = 418+'px';
    } else {
      iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
    }


    }
    else {
         if(iframeWindow.document.body.scrollHeight <= 420){
    iframeElement.style.height = 418+'px';
    } else {
      iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
    }

    }
  }
}


