// JavaScript Document function getStyleObject(objectId) { if(document.getElementById && document.getElementById(objectId)) { /* W3C DOM*/ return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { /* MSIE 4 DOM*/ return document.all(objectId).style; } else if (document.layers && document.layers[objectId]) { /* NN 4 DOM.. note: this won't find nested layers*/ return document.layers[objectId]; } else { return false; } } function setRelLayerPos(objectId,xOffset,yOffset,e) { // get the mouse x & y coordinate relative to the dosument; not the screen // reposition the layer (objectId) to these coordinates with xOffset,yOffset var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft; posy = e.clientY + document.body.scrollTop; } var layer = getStyleObject(objectId); if(layer) { layer.left = (posx + xOffset) + "px"; layer.top = (posy + yOffset) + "px"; } else { return false; } } function showItem(itemId, xOffset, yOffset, e) { setRelLayerPos(itemId,xOffset,yOffset,e); document.getElementById(itemId).style.visibility = "visible"; return true; } function hideItem(itemId) { document.getElementById(itemId).style.visibility = "hidden"; return true; } function focusWindow() { window.focus(); }