$.fn.xenview=function(a,b){Xenview.call($(this)[0],a,b)};function Xenview(n,a){var k=n?n:{};var j=typeof a=="function"?a:false;var h=k.persist?k.persist:false;var b=k.cookieId?k.cookieId:"treeviewcookie";var l=null;delete k.persist;var m=this;function f(){$(m).treeview(k);e(m);c()}function e(o){$(o).find(".expandable-hitarea").one("click",function(){if(j){j.call($(this).closest("li")[0])}});$(o).find(".hitarea").bind("click",function(){i()})}function i(){if(!h){return}var o="";$(m).find(".hitarea").not($(m).find(".expandable li > .hitarea")).each(function(){o+=$(this).hasClass("collapsable-hitarea")?"1":"0"});$.cookie(b,o,{expires:30})}function c(){if(!h||!$.cookie(b)){return}var o=$.cookie(b).split("");g(0,o)}function g(p,o){if(p>=o.length){return}if(o[p]=="1"){l=function(){g(p+1,o)};$($(m).find(".hitarea")[p]).trigger("click")}else{g(p+1,o)}}function d(p,o){$($(p).find("ul")).replaceWith(o);$(m).treeview({add:o});e(o);i();if(typeof l=="function"){l()}}this.addBranch=d;f()};
