var fluid_1_1=fluid_1_1||{};(function($,fluid){fluid.dom=fluid.dom||{};var getNextNode=function(iterator){if(iterator.node.firstChild){iterator.node=iterator.node.firstChild;iterator.depth+=1;return iterator}while(iterator.node){if(iterator.node.nextSibling){iterator.node=iterator.node.nextSibling;return iterator}iterator.node=iterator.node.parentNode;iterator.depth-=1}return iterator};fluid.dom.iterateDom=function(node,acceptor,allNodes){var currentNode={node:node,depth:0};var prevNode=node;var condition;while(currentNode.node!==null&&currentNode.depth>=0&&currentNode.depth<fluid.dom.iterateDom.DOM_BAIL_DEPTH){condition=null;if(currentNode.node.nodeType===1||allNodes){condition=acceptor(currentNode.node,currentNode.depth)}if(condition){if(condition==="delete"){currentNode.node.parentNode.removeChild(currentNode.node);currentNode.node=prevNode}else{if(condition==="stop"){return currentNode.node}}}prevNode=currentNode.node;currentNode=getNextNode(currentNode)}};fluid.dom.iterateDom.DOM_BAIL_DEPTH=256;fluid.dom.computeAbsolutePosition=function(element){var curleft=0,curtop=0;if(element.offsetParent){do{curleft+=element.offsetLeft;curtop+=element.offsetTop;element=element.offsetParent}while(element);return[curleft,curtop]}};fluid.dom.isContainer=function(container,containee){for(;containee;containee=containee.parentNode){if(container===containee){return true}}return false};fluid.dom.insertAfter=function(newChild,refChild){var nextSib=refChild.nextSibling;if(!nextSib){refChild.parentNode.appendChild(newChild)}else{refChild.parentNode.insertBefore(newChild,nextSib)}};fluid.dom.isWhitespaceNode=function(node){return !(/[^\t\n\r ]/.test(node.data))};fluid.dom.isIgnorableNode=function(node){return(node.nodeType===8)||((node.nodeType===3)&&fluid.dom.isWhitespaceNode(node))};fluid.dom.getElementText=function(element){var nodes=element.childNodes;var text="";for(var i=0;i<nodes.length;++i){var child=nodes[i];if(child.nodeType==3){text=text+child.nodeValue}}return text};fluid.dom.cleanseScripts=function(element){var cleansed=$.data(element,fluid.dom.cleanseScripts.MARKER);if(!cleansed){fluid.dom.iterateDom(element,function(node){return node.tagName.toLowerCase()==="script"?"delete":null});$.data(element,fluid.dom.cleanseScripts.MARKER,true)}};fluid.dom.cleanseScripts.MARKER="fluid-scripts-cleansed"})(jQuery,fluid_1_1);