--- ECHO_content/js/hl_lib.js 2004/05/18 22:30:09 1.2 +++ ECHO_content/js/hl_lib.js 2004/12/10 19:33:09 1.5 @@ -14,9 +14,10 @@ You should have received a copy of the G along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -Authors: ROC 6.5.2004 +Authors: ROC 23.11.2004 */ +var hllibVersion = "1.0.1"; var hlAreas = new Object(); var hlTrafos = new Object(); @@ -34,9 +35,9 @@ function addArea(id, target_id, a_x, a_y hlAreas[id] = new Area(id, target_id, a_x, a_y, a_w, a_h, type); } -function parseTrafo(target_id) { +function parseTrafo(target) { // returns Transform for given target picsize - var picsize = getElementRect(getElement(target_id)); + var picsize = getElementRect(target); var trafo = new Transform(); // subtract area offset and size //trafo.concat(getTranslation(new Position(-dlArea.x, -dlArea.y))); @@ -65,20 +66,17 @@ function placeAreas() { pos.y += rect.height * 0.5 - isize.height * 0.5; moveElement(img, pos); if (img.layers) { - // N4 grow layer for border + // N4: grow layer for border img.resizeBy(2,2); } } else { if (img.layers) { - // N4 size transparent image for area + // for N4 we size a transparent image as the area var li = img.document.images[0]; li.width = rect.width; li.height = rect.height; } moveElement(img, rect); - if (browserType.isIEWin) { - highlightPair(area.id, false); - } } } } @@ -142,7 +140,19 @@ function highlightPair(id, highlight) { } function init() { - hlTrafos["overview"] = parseTrafo("overview"); + map_init(); +} + +var elemScaler; +var dlTrafo; + +function map_init() { + // initialise baselib + base_init(); + //alert("huhu4!"); + elemScaler = getElement("overview"); + dlTrafo = parseTrafo(elemScaler); + hlTrafos["overview"] = dlTrafo; placeAreas(); return null; }