//--------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='| '
if (contextMenuItemArray[i].link == "") {
html+=contextMenuItemArray[i].name;
}else {
html+=' ' + contextMenuItemArray[i].name + ' ';
}
html+=' | ';
html+='';
this.nameArray[this.nameArray.length] = name;
}
html+='