KISSY.Editor.add("elementpath",function(e){function g(a){var c=h,d=h,k=[];for(a=a;a&&a[0];){if(a[0].nodeType==l.NODE_ELEMENT){if(!this.lastElement)this.lastElement=a;var f=a._4e_name();if(!d){if(!c&&n[f])c=a;if(o[f]){var b;if(b=!c){if(b=f=="div"){a:{b=a;b=b[0]||b;b=b.childNodes;for(var i=0,p=b.length;i<p;i++){var m=b[i];if(m.nodeType==l.NODE_ELEMENT&&q.$block[m.nodeName.toLowerCase()]){b=true;break a}}b=false}b=!b}b=b}if(b)c=a;else d=a}}k.push(a);if(f=="body")break}a=a.parent()}this.block=this.block=
c;this.blockLimit=this.blockLimit=d;this.elements=this.elements=k}var r=KISSY.DOM,q=e.XHTML_DTD,l=e.NODE,h=null,n={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1},o={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1};g.prototype={compare:function(a){var c=this.elements;a=a&&a.elements;if(!a||c.length!=a.length)return false;for(var d=0;d<c.length;d++)if(!r._4e_equals(c[d],a[d]))return false;return true},contains:function(a){for(var c=this.elements,d=0;d<
c.length;d++)if(c[d]._4e_name()in a)return c[d];return h}};e.ElementPath=e.ElementPath=g;var j=g.prototype;e.Utils.extern(j,{compare:j.compare,contains:j.contains})});
