function getPosition(e) {
    e = e || window.event;
    var cursor = {x : 0, y : 0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}
function zoomImg(e, name) {
    var position = getPosition(e);
    var img = document.getElementById('zoom');
    img.src = name;
    img.style.top = (position.y - (img.height / 2)) + 'px';
    img.style.left = (position.x - (img.width / 2)) + 'px';
    img.style.display = 'block';
}

