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