if (!labs) {
    var labs = {
        getControl: function(controls, id) {
            for (var i = 0; i < controls.length; i++) {
                var control = controls[i];
                if (control.id != null && control.id != "undefined") {
                    if (control.id.indexOf(id) >= 0) {
                        return control;
                    }
                }
            }

            return null;
        },

        getLeft: function(element) {
            var left = 0;

            var parent = element.offsetParent;
            while (parent != null) {
                left += parseInt(parent.offsetLeft);
                parent = parent.offsetParent;
            }

            if (document.all) {
                left += this.parseValue(element.currentStyle.borderLeftWidth);
                left += this.parseValue(element.currentStyle.marginLeft);
                left += this.parseValue(element.currentStyle.paddingLeft);
            } else {
                left += this.parseValue(element.style.borderLeftWidth);
                left += this.parseValue(element.style.marginLeft);
                left += this.parseValue(element.style.paddingLeft);
            }

            left += this.parseValue(element.offsetLeft);

            return left;
        },

        getMouseLeft: function(event) {

            var posx = 0;

            if (event.pageX) {
                posx = event.pageX;
            } else if (event.clientX) {
                posx = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;

            }

            return posx;

        },

        getTop: function(element) {
            var top = 0;

            var parent = element.offsetParent;
            while (parent != null) {
                top += parseInt(parent.offsetTop);
                parent = parent.offsetParent;
            }

            if (document.all) {
                top += this.parseValue(element.currentStyle.borderTopWidth);
                top += this.parseValue(element.currentStyle.marginTop);
                top += this.parseValue(element.currentStyle.paddingTop);
            } else {
                top += this.parseValue(element.style.borderTopWidth);
                top += this.parseValue(element.style.marginTop);
                top += this.parseValue(element.style.paddingTop);
            }

            top += this.parseValue(element.offsetTop);

            return top;
        },


        getMouseTop: function(event) {
            var posy = 0;

            if (event.pageY) {
                posy = event.pageY;
            } else if (event.clientY) {
                posy = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
            }

            return posy;
        },


        getHeight: function(element) {
            var height = 0;

            height += this.parseValue(element.clientHeight);

            if (document.all) {
                height -= this.parseValue(element.currentStyle.borderTopWidth);
                height -= this.parseValue(element.currentStyle.borderBottomWidth);
            } else {
                height -= this.parseValue(element.style.borderTopWidth);
                height -= this.parseValue(element.style.borderBottomWidth);
            }
            return height;
        },

        getWidth: function(element) {
            var width = 0;

            width += this.parseValue(element.clientWidth);

            if (document.all) {
                width -= this.parseValue(element.currentStyle.borderLeftWidth);
                width -= this.parseValue(element.currentStyle.borderRightWidth);
            } else {
                width -= this.parseValue(element.style.borderLeftWidth);
                width -= this.parseValue(element.style.borderRightWidth);
            }

            return width;
        },

        parseValue: function(value) {
            var intValue = parseInt(value);
            if (isNaN(intValue)) {
                return 0;
            } else {
                return intValue;
            }
        },

        getText: function(control) {
            if (document.all) {
                return control.innerText;
            } else {
                return control.textContent;
            }
        },

        setText: function(control, value) {
            if (document.all) {
                control.innerText = value;
            } else {
                control.textContent = value;
            }
        },

        getSourceElement: function(event) {
            if (document.all) {
                return event.srcElement;
            } else {
                return event.target;
            }
        },

        fireClickEvent: function(control) {
            if (document.all) {
                control.fireEvent("onclick");
            } else {
                var clickEvent = window.document.createEvent("MouseEvent");
                clickEvent.initEvent("click", false, true);
                control.dispatchEvent(clickEvent);
            }
        },


        getWindowHeight: function() {

            if (document.all) {
                return document.body.offsetHeight;
            } else {
                return window.innerHeight;
            }
        },

        getWindowWidth: function() {

            if (document.all) {
                return document.body.offsetWidth;
            } else {
                return window.innerWidth;
            }
        }
    };
}
