﻿function AutoHeight(topObj, bottomObj, offset) {
    this.topObj = document.getElementById(topObj);
    this.bottomObj = document.getElementById(bottomObj);
    this.offset = offset;
}

AutoHeight.prototype.setHeight = function() {
    if ((this.topObj.offsetHeight - this.offset - this.bottomObj.offsetHeight) >= 0) {

        this.bottomObj.style.height = (this.topObj.offsetHeight - this.offset) + "px";

    }
    else {
        this.topObj.style.height = (this.bottomObj.offsetHeight + this.offset) + "px";
    }
}

