/*                                                          */
/*                     C a n | V I Z  ?                     */
/*                                                          */
/*               The  multi-media 3D viewer                 */
/*                     www.caniviz.com                      */
/*                                                          */
/*         Copyright 2002 to 2009 by ANDEOR SARL            */
/*                   All Rights Reserved                    */
/*                                                          */
/* This file is owned  by ANDEOR, SARL and cannot be used   */
/* for any purpose without an explicit license agreement,   */
/* contract, or any written document.                       */
/*                                                          */
/* -------------------------------------------------------  */
/* $Author: gdw $ */
/* $Date: 2009-01-06 18:40:57 +0100 (Tue, 06 Jan 2009) $ */
/* $Id: copyright.txt 8597 2009-01-06 17:40:57Z gdw $ */
/*  */
/* -*-header-*- */
function getElement (aID) {
  return (document.getElementById)
  ? document.getElementById(aID)
  : document.all[aID];
}

function getIFrameDocument (aID) { 
  var rv = null; 
  var frame=getElement(aID);
  // if contentDocument exists, W3C compliant (e.g. Mozilla) 
  
  if (frame.contentDocument) {
    rv = frame.contentDocument;
  }
  else {
    // bad IE  ;)
    rv = document.frames[aID].document;
  }
  return rv;
}

function adjustIFrameHeight(id) {
  var frame    = getElement (id);
  var frameDoc = getIFrameDocument (id);
  frame.height = frameDoc.body.offsetHeight + 50;
}
