export module HTMLUtil {
    export function getElementXinParent(elem: HTMLElement, parent: HTMLElement): number {
        let styleLeft = elem.style.left;
        if (0 === styleLeft.length) {
            return parent.offsetLeft;
        } else {
            return parent.offsetLeft+parseInt(styleLeft);
        }
    }

    export function getElementYInParent(elem: HTMLElement, parent: HTMLElement): number {
        let styleTop = elem.style.top;
        if (0 === styleTop.length) {
            return parent.offsetTop;
        } else {
            return parent.offsetTop + parseInt(styleTop);
        }
    }

}