function getLayerTop(layer) {
    if (layer.pageY) return layer.pageY;
    if (layer.style.top) return parseInt(layer.style.top);
    return -1;
}