foswiki.HTML={setHtmlOfElementWithId:function(e,t){var n=document.getElementById(e);return foswiki.HTML.setHtmlOfElement(n,t)},setHtmlOfElement:function(e,t){return e&&null!=t?(e.innerHTML=t,e):null},getHtmlOfElementWithId:function(e){var t=document.getElementById(e);return foswiki.HTML.getHtmlOfElement(t)},getHtmlOfElement:function(e){return e?e.innerHTML:null},clearElementWithId:function(e){var t=document.getElementById(e);return foswiki.HTML.clearElement(t)},clearElement:function(e){return e?(foswiki.HTML.setHtmlOfElement(e,""),e):null},deleteElementWithId:function(e){var t=document.getElementById(e);return foswiki.HTML.deleteElement(t)},deleteElement:function(e){return e?(e.parentNode.removeChild(e),e):null},insertAfterElement:function(e,t,n,l){if(!e||!t)return null;var r=foswiki.HTML._createElementWithTypeAndContents(t,n,l);return r?(e.appendChild(r),r):null},insertBeforeElement:function(e,t,n,l){if(!e||!t)return null;var r=foswiki.HTML._createElementWithTypeAndContents(t,n,l);return r?(e.parentNode.insertBefore(r,e),r):null},replaceElement:function(e,t,n,l){if(!e||!t)return null;var r=foswiki.HTML._createElementWithTypeAndContents(t,n,l);return r?(e.parentNode.replaceChild(r,e),r):null},_createElementWithTypeAndContents:function(e,t,n){var l=document.createElement(e);return null!=t&&(l.innerHTML=t),null!=n&&foswiki.HTML.setElementAttributes(l,n),l},setNodeAttributesInList:function(e,t){if(e){var n,l=e.length;for(n=0;n<l;++n){var r=e[n];foswiki.HTML.setElementAttributes(r,t)}}},setElementAttributes:function(e,t){for(var n in t)if("style"==n){var l=t[n];for(var r in l)e.style[r]=l[r]}else e[n]=t[n]}};
