﻿/* Code snippet that I found as a work-around
patch for an Infragistic scripting bug that appears on newer version if firefox (3.6)
the web grid scripts were using an obsolete DOM function getBoxObjectFor() which was removed. 
This implementation came from a forum answer that I found. Note that infragistcs was talking about 
a service release for 9.2 or  later (we are using  8.3)
*/
if (!document.getBoxObjectFor) {
    document.getBoxObjectFor = function(el) {
        var pos = {};

        pos.x = el.offsetLeft;
        pos.y = el.offsetTop;
        parent = el.offsetParent;
        if (parent != el) {
            while (parent) {
                pos.x += parent.offsetLeft;
                pos.y += parent.offsetTop;
                parent = parent.offsetParent;
            }
        }

        parent = el.offsetParent;
        while (parent && parent != document.body) {
            pos.x -= parent.scrollLeft;
            if (parent.tagName != 'TR') {
                pos.y -= parent.scrollTop;
            }
            parent = parent.offsetParent;
        }

        return pos;
    };
}
