//--------Constructor-------------------- //document.write('
'); //Constructor for a context menu function ContextMenu() { this.render = ContextMenu_render; this.hide = ContextMenu_hide; this.owner = null; this.contextMenu = document.getElementById("contextMenu"); this.contextMenu.oncontextmenu=new function() {return false;}; this.contextMenu.onmousedown=new function() {return false;}; this.contextMenu.onmouseup=new function() {return false;}; this.nameArray = new Array(); } //Container used by the render method to delimit context menu items function ContextMenuItem(cminame,cmilink) { this.name = cminame; this.link = cmilink; } //---------Method Implementations ------------- //renders the context menu based on the contextMenuItemArray and owner. function ContextMenu_render(contextMenuItemArray,x,y,owner) { // manager.tools.showObject(this.contextMenu); // alert("top = " + this.contextMenu.className); this.owner = owner; var html=''; for (var i=0;i
     ' + contextMenuItemArray[i].name + '
'; } html+=''; html+=''; this.nameArray[this.nameArray.length] = name; } html+='
'; this.contextMenu.innerHTML = html; for (var k=0;k parseInt(this.contextMenu.offsetHeight)) { this.contextMenu.style.top = (y + manager.display.documentElement.scrollTop - this.contextMenu.offsetHeight -1) + "px"; // this.contextMenu.style.top = (y + window.scrollY - this.contextMenu.offsetHeight -1) + "px"; }else { this.contextMenu.style.top = (y + manager.display.documentElement.scrollTop + 3) + "px"; // this.contextMenu.style.top = (y + window.scrollY + 3) + "px"; } this.contextMenu.style.left= (x + manager.display.documentElement.scrollLeft) + "px"; // this.contextMenu.style.left= (x + window.scrollX) + "px"; manager.display.bringToFront(this.contextMenu); //alert(this.contextMenu.style.top); manager.tools.showObject(this.contextMenu); } //hides the context menu function ContextMenu_hide() { for (var k=0;k