function iconControl(){ var m_domElement=document.createElement("span"); m_domElement.setAttribute("class","iconContainer"); return(construct()); function construct(){ m_domElement.addIcon=addIcon; m_domElement.fromXML=fromXML; m_domElement.toXML=toXML; return(m_domElement); } function addIcon(iconName){ var theIconNode=document.createElement("span"); var theImageNode=document.createElement("img"); theImageNode.setAttribute("src",iconName); theIconNode.appendChild(theImageNode); var mi=new Array(); mi[0]=new textMenuItem("Delete",function(){deleteNode(theIconNode);}); theIconNode.contextMenu=new menuControl(mi,1); theIconNode.contextMenu.hide(); theIconNode.onclick=function(event) { theIconNode.contextMenu.toggleVisible(); theIconNode.contextMenu.style.position="absolute"; theIconNode.contextMenu.style.left=(5+theIconNode.offsetLeft) + "px"; theIconNode.contextMenu.style.top=(5+theIconNode.offsetTop) + "px"; event.stopPropagation(); } theIconNode.appendChild(theIconNode.contextMenu); document.addSubscriber(theIconNode.contextMenu.hide,"clicked"); m_domElement.appendChild(theIconNode); } function deleteNode(theIconNode){ theIconNode.parentNode.removeChild(theIconNode); } function fromXML(inXML){ for(var i=0;i