﻿/*

function posX(elem) {
return getStyle(elem, "left");
}


function getStyle(elem, name) {
if (arguments.length < 2) return null;

if (elem.style)
return elem.style[name];
else if (elem.currentStyle)
return elem.currentStyle[name];
else
return null;
}

*/

function pageX(elem) {
    // See if we're at the root element, or not
    return elem.offsetParent ?
    // If we can still go up, add the current offset and recurse upwards
elem.offsetLeft + pageX(elem.offsetParent) :
    // Otherwise, just get the current offset
elem.offsetLeft;
}

// Find the Y (Vertical, Top) position of an element
function pageY(elem) {
    // See if we're at the root element, or not
    return elem.offsetParent ?
    // If we can still go up, add the current offset and recurse upwards
elem.offsetTop + pageY(elem.offsetParent) :
    // Otherwise, just get the current offset
elem.offsetTop;
}

function getEventObj(e) {
    return e || window.event;
}

function getEventTarget(e) {
    var e = getEventObj(e);
    return e.target || e.srcElement;
}






