!function(e){if("undefined"==typeof Sarissa)throw"jsTree xml_nested: Sarissa is not included.";e.extend(e.tree.datastores,{xml_nested:function(){return{get:function(t,l,s){var a="";if((t=t&&0!=e(t).size()?e(t):l.container.children("ul").children("li")).size()>1){var n=this;a="<root>";return t.each(function(){s.callback=!0,a+=n.get(this,l,s)}),a+="</root>"}if(!s)s={};s.outer_attrib||(s.outer_attrib=["id","rel","class"]),s.inner_attrib||(s.inner_attrib=[]),s.callback||(a+="<root>"),a+="<item ";for(var r in s.outer_attrib)if(s.outer_attrib.hasOwnProperty(r)){var i="class"==s.outer_attrib[r]?t.attr(s.outer_attrib[r]).replace(/(^| )last( |$)/gi," ").replace(/(^| )(leaf|closed|open)( |$)/gi," "):t.attr(s.outer_attrib[r]);void 0!==i&&i.toString().replace(" ","").length>0&&(a+=" "+s.outer_attrib[r]+'="'+i.toString()+'" '),delete i}if(a+=">",a+="<content>",l.settings.languages.length)for(var r in l.settings.languages)l.settings.languages.hasOwnProperty(r)&&(a+=this.process_inner(t.children("a."+l.settings.languages[r]),l,s,l.settings.languages[r]));else a+=this.process_inner(t.children("a"),l,s);if(a+="</content>",t.children("ul").size()>0){n=this;s.callback=!0,t.children("ul").children("li").each(function(){a+=n.get(this,l,s)}),s.callback=!1}return a+="</item>",s.callback||(a+="</root>"),a},process_inner:function(e,t,l,s){var a="<name ";if(s&&(a+=' lang="'+s+'" '),(l.inner_attrib.length||e.children("ins").get(0).style.backgroundImage.toString().length||e.children("ins").get(0).className.length)&&(e.children("ins").get(0).style.className.length&&(a+=' icon="'+e.children("ins").get(0).style.className+'" '),e.children("ins").get(0).style.backgroundImage.length&&(a+=' icon="'+e.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")+'" '),l.inner_attrib.length))for(var n in l.inner_attrib)if(l.inner_attrib.hasOwnProperty(n)){var r=e.attr(l.inner_attrib[n]);void 0!==r&&r.toString().replace(" ","").length>0&&(a+=" "+l.inner_attrib[n]+'="'+r.toString()+'" '),delete r}return a+="><![CDATA["+t.get_text(e,s)+"]]></name>"},parse:function(t,l,s,a){var n=new XSLTProcessor;n.importStylesheet(e.tree.datastores.xml_nested.xsl);var r=e((new XMLSerializer).serializeToString(n.transformToDocument(t)).replace('<?xml version="1.0"?>',""));r.size()>1&&(r=r.eq(1)),r=r.is("ul")?r.html():r.find("ul:eq(0)").html(),a&&a.call(null,r)},load:function(t,l,s,a){s.static?a.call(null,(new DOMParser).parseFromString(s.static,"text/xml")):e.ajax({type:s.method,url:s.url,data:t,dataType:"xml",success:function(e,t){a.call(null,e)},error:function(e,t,s){a.call(null,!1),l.error(s+" "+t)}})}}}}),e.tree.datastores.xml_nested.xsl=(new DOMParser).parseFromString('<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/"><xsl:call-template name="nodes"><xsl:with-param name="node" select="/root" /></xsl:call-template></xsl:template><xsl:template name="nodes"><xsl:param name="node" /><ul><xsl:for-each select="$node/item"><xsl:variable name="children" select="count(./item) &gt; 0" /><li><xsl:attribute name="class"><xsl:if test="position() = last()"> last </xsl:if><xsl:choose><xsl:when test="@state = \'open\'"> open </xsl:when><xsl:when test="$children or @hasChildren"> closed </xsl:when><xsl:otherwise> leaf </xsl:otherwise></xsl:choose><xsl:value-of select="@class" /></xsl:attribute><xsl:for-each select="@*"><xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:if></xsl:for-each><xsl:for-each select="content/name"><a href=""><xsl:attribute name="class"><xsl:value-of select="@lang" /><xsl:value-of select="@class" /></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute><xsl:for-each select="@*"><xsl:if test="name() != \'style\' and name() != \'class\'"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:if></xsl:for-each><ins><xsl:if test="string-length(attribute::icon) > 0"><xsl:choose><xsl:when test="not(contains(@icon,\'/\'))"><xsl:attribute name="class"><xsl:value-of select="@icon" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="style">background-image:url(<xsl:value-of select="@icon" />);</xsl:attribute></xsl:otherwise></xsl:choose></xsl:if><xsl:text>&#xa0;</xsl:text></ins><xsl:value-of select="current()" /></a></xsl:for-each><xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if></li></xsl:for-each></ul></xsl:template></xsl:stylesheet>',"text/xml")}(jQuery);