function FrameBreakOut() {
  if(window != top) {
    top.location.href=location.href;
  }
}
function KeepInFrame(frameUrl) {
  if(parent.frames.length == 0) {
    var pageUrl = new String(window.location.pathname);
    pageUrl = pageUrl.substring(pageUrl.lastIndexOf('/')+1);
    window.location.replace(frameUrl+'?content='+pageUrl);
  }
}
// Ensures that the IFrame is sized so that the page scroll takes precendence
// Notes: 1. only does height, width as yet is not required and hence commented out
// 2. The IFrame must have both name and id attributes set for this function to have any effect.
function AdjustIFrameSize( iframeWindow ) {
  if ( iframeWindow.id && iframeWindow.document.height) {
    var iframeElement = parent.document.getElementById(iframeWindow.id);
    iframeElement.style.height = iframeWindow.document.height + 'px';
    //iframeElement.style.width = iframeWindow.document.width + 'px';
  }
  else if(iframeWindow.name && document.all) {
    var iframeElement = parent.document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {
      iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
      //iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
    }
    else {
      iframeElement.style.height = iframeWindow.document.body.scrollHeight + 5 + 'px';
      //iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
    }
  }
}