const HEIGHT_COL = 1;
const WIDTH_COL = 2;

jOmnis.callbackObject = {
    height: 0,
    width: 0,
    omnisGetCurrentLine: function() { return 1; },
    omnisSetData: function(dimensions) {
        if (dimensions instanceof omnis_list && dimensions.getRowCount() == 1) {
            this.height = dimensions.getData(HEIGHT_COL,1);
            this.width = dimensions.getData(WIDTH_COL,1);
        }

        this.positionFields();
    },
    omnisOnLoad: function() {
        this.height = 0;
        this.width = 0;
    },
    positionFields: function() {
        mainElement = document.getElementById("main");
        mainElement.style.paddingTop = ((this.height-200)/2) + "px"; /* the offset height appears to fluctuate; setting it to a static 200 prevents this */
        mainElement.style.paddingLeft = ((this.width-mainElement.offsetWidth)/2) + "px";
        mainElement.style.visibility = "visible";
    }
};