
/* To resize the parent's iframe with the size information of this sub page */
function UpdateParentFrameHeight()
{
  /* This function is called out of a html page which is displayed in an iframe. If this page is the top page (with a deep link) the parent should be opened
    with this page loaded in the iframe */
  if(top == self)
  {  // This site is part of a frameset
    top.location.href = "index.html";
  }

  // alert("document.body.clientHeight = " + document.body.clientHeight + "\ndocument.documentElement.clientHeight = " + document.documentElement.clientHeight + "\nwindow.innerHeight = " + window.innerHeight + "\ndocument.body.scrollHeight" + document.body.scrollHeight);
  if(document.documentElement.clientHeight > 0)
  {
    if(document.body.scrollHeight > 0)
    {
      parent.SetHeightOfElement("DataArea", document.documentElement.clientHeight < document.body.scrollHeight ? document.documentElement.clientHeight + 5: document.body.scrollHeight + 5);
    }
    else
    {
      parent.SetHeightOfElement("DataArea", document.documentElement.clientHeight + 5);
    }
  }
  else
  {
    if(document.body.scrollHeight > 0)
    {
      parent.SetHeightOfElement("DataArea", document.body.scrollHeight + 5);
    }
    else
    {
      parent.SetHeightOfElement("DataArea", 10000);
    }
  }
}

function SetParentFrameHeightDefault()
{
  parent.SetHeightOfElement("DataArea", 5000);
}


/* To get the parent page (index.html) displayed with the desired iframe contents */
function SetHeightOfElement(ElementId, NewHeight)
{
  document.getElementById(ElementId).style.height = NewHeight;
}



