/* * Stretch an object out to fill its parent. Give space for siblings * If Mozilla didn't have a funky bug, we could *maybe* do this without JavaScript * * A more robust stretchObject() replacement */ function fitToParent(el, tweakVal) { if(typeof el == "string") { var elName = el; el = document.getElementById(el); if(!el) /*throw("fitToParent: Can't find element '" + elName + "'")*/ return; } var height = getFittingHeight(el, tweakVal) + 'px'; el.style.height = height; } function getFittingHeight(el, tweakVal, ignoreElements) { if(typeof el == "string") el = document.getElementById(el); // we set overflow = hidden so that large children don't muck things up if(el.parentNode && el.parentNode != document.body) { if(getDimension(el.parentNode,'overflow',true) != 'auto') el.parentNode.style.overflow = 'hidden'; } var otherHeight = 0; var notAComment; if(el.parentNode) { for(var i=0;i