TWP.Util.ElPosition = {

    getPos : function(obj) {
        return [this.getRealLeft(obj), this.getRealTop(obj)];
    },

    getRealTopByObj : function(obj) {
        yPos = 0;
        if(obj)
        {
            yPos = obj.offsetTop;
            tempEl = obj.offsetParent;
            while(tempEl !== null)
            {
                yPos += tempEl.offsetTop;
                tempEl = tempEl.offsetParent;
            }
        }
        return yPos;
    },

    getRealTop : function(obj){
        yPos = this.getRealTopByObj(obj);
        return yPos;
    },

    getRealLeftByObj : function(obj){
        xPos = 0;
        if(obj)
        {
            xPos = obj.offsetLeft;
            tempEl = obj.offsetParent;
            while(tempEl !== null)
            {
                xPos += tempEl.offsetLeft;
                tempEl = tempEl.offsetParent;
            }
        }
        return xPos;
    },

    getRealLeft : function(obj){
        xPos = this.getRealLeftByObj(obj);
        return xPos;
    }    
};
