﻿function inherit(objidParent, objidChild, objidGrandchild1, objidGrandchild2) {
    if (document.layers) { alert('sorry, no pretty layouts for netscape 4'); }
    else if (document.getElementById) {

        Parent = document.getElementById(objidParent);
        Child = document.getElementById(objidChild);

        if (document.getElementById(objidGrandchild1) && document.getElementById(objidGrandchild2)) {

            Grandchild1 = document.getElementById(objidGrandchild1);
            Grandchild2 = document.getElementById(objidGrandchild2);

            Grandchild = (Grandchild1.offsetHeight.valueOf() >= Grandchild2.offsetHeight.valueOf()) ? Grandchild1 : Grandchild2;


            if (Grandchild.offsetHeight.valueOf() <= 280) {
                Grandchild1.style.height = Grandchild2.style.height = '280px';
                Child.style.height = Grandchild.offsetHeight + 'px';
                Parent.style.height = Child.offsetHeight + 'px';
                Grandchild.style.display = 'block';
            }
            else {
                Grandchild1.style.height = Grandchild2.style.height = Grandchild.offsetHeight + 'px';
                Child.style.height = Grandchild.offsetHeight + 'px';
                Parent.style.height = Child.offsetHeight + 'px';
                Grandchild.style.display = 'block';
            }
            return true;

        }

    }
}

function forceinherit(objidParent, objidChild, objidGrandchild1, objidGrandchild2) {
    if (document.layers) { alert('sorry, no pretty layouts for netscape 4'); }
    else if (document.getElementById) {

        Parent = document.getElementById(objidParent);
        Child = document.getElementById(objidChild);

        if (document.getElementById(objidGrandchild1) && document.getElementById(objidGrandchild2)) {

            Grandchild1 = document.getElementById(objidGrandchild1);
            Grandchild2 = document.getElementById(objidGrandchild2);

            Grandchild = Grandchild1;


            if (Grandchild.offsetHeight.valueOf() <= 280) {
                Grandchild1.style.height = Grandchild2.style.height = '280px';
                Child.style.height = Grandchild.offsetHeight + 'px';
                Parent.style.height = Child.offsetHeight + 'px';
                Grandchild.style.display = 'block';
            }
            else {
                Grandchild1.style.height = Grandchild2.style.height = Grandchild.offsetHeight + 'px';
                Child.style.height = Grandchild.offsetHeight + 'px';
                Parent.style.height = Child.offsetHeight + 'px';
                Grandchild.style.display = 'block';
            }
            return true;

        }

    }
} 
