var pnlResults = this.get_pnlResults();var itemDiv = document.createElement('div');itemDiv.id = pnlResults.id + UNIQUE KEY;//using '/_/g' replaces ALL occurrances of '_' instead of just the first oneitemDiv.name = itemDiv.id.replace(/_/g, "$");itemDiv.innerHTML = SOME TEXT; var itemTextDiv = document.createElement('div');itemTextDiv.innerHTML = SOME TEXT;itemDiv.appendChild(itemTextDiv); pnlResults.appendChild(itemDiv); var mouseOverHandler = Function.createDelegate(this, this.onMouseOver); var mouseOutHandler = Function.createDelegate(this, this.onMouseOut); $addHandlers(itemDiv, {mouseover:mouseOverHandler, mouseout:mouseOutHandler}, this);