(function(b){b.fn.bgIframe=b.fn.bgiframe=function(a){if(b.browser.msie&&/6.0/.test(navigator.userAgent)){a=b.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},a||{});var c=function(f){return f&&f.constructor==Number?f+"px":f},e='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+a.src+'"style="display:block;position:absolute;z-index:-1;'+(a.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(a.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":
c(a.top))+";left:"+(a.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":c(a.left))+";width:"+(a.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":c(a.width))+";height:"+(a.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":c(a.height))+';"/>';return this.each(function(){b("> iframe.bgiframe",this).length==0&&this.insertBefore(document.createElement(e),this.firstChild)})}return this}})(jQuery);(function(b){var a={reNumbers:/(-?\$?)(\d+(,\d{3})*(\.\d{1,})?|\.\d{1,})/g,cleanseNumber:function(e){return e.replace(/[^0-9.\-]/g,"")},useFieldPlugin:!!b.fn.getValue,onParseError:null,onParseClear:null,cbFormat:function(e){return e.toString()}};b.Calculation={version:"0.4.09",setDefaults:function(e){b.extend(a,e)}};b.fn.parseNumber=function(e){var f=[];e=b.extend(e,a);this.each(function(){var i=b(this),d=i.is(":input")?a.useFieldPlugin?"getValue":"val":"text",g=b.trim(i[d]()).match(a.reNumbers,"");
if(g==null||g==""){g=0;jQuery.isFunction(e.onParseError)&&e.onParseError.apply(i,[d]);b.data(i[0],"calcParseError",true)}else{g=e.cleanseNumber.apply(this,[g[0]]);if(b.data(i[0],"calcParseError")&&jQuery.isFunction(e.onParseClear)){e.onParseClear.apply(i,[d]);b.data(i[0],"calcParseError",false)}if(g=="")g=0}f.push(parseFloat(g,10))});return f};b.fn.calc=function(e,f,i,d){var g=this,h="",j=0,l,k={},m,n,p=false;for(var o in f){e=e.replace(RegExp("("+o+")","g"),"_.$1");k[o]=f[o]&&f[o].jquery?f[o].parseNumber():
f[o]}this.each(function(q){var s;l=b(this);m=l.is(":input")?a.useFieldPlugin?"setValue":"val":"text";n={};for(var r in k){if(typeof k[r]=="number")n[r]=k[r];else if(typeof k[r]=="string")n[r]=parseFloat(k[r],10);else if(k[r]&&k[r]instanceof Array){t=k[r].length==g.length?q:0;n[r]=k[r][t]}if(isNaN(n[r]))n[r]=0;s=(s=n[r].toString().match(/\.\d+$/gi))?s[0].length-1:0;if(s>j)j=s}try{h=eval(e);if(j)h=Number(h.toFixed(Math.max(j,4)));if(jQuery.isFunction(i)){var t=i.apply(this,[h]);if(t)h=t}}catch(u){h=
u;p=true}l[m](h.toString());l.is(":input")&&l.trigger("change")});jQuery.isFunction(d)&&d.apply(this,[this]);return this};b.each(["sum","avg","min","max","diff"],function(e,f){b.fn[f]=function(i,d){if(arguments.length==0)return c[f](this.parseNumber());var g=d&&d.constructor==Object&&!(d instanceof jQuery),h=i&&i.constructor==Object?i:{bind:i||"keyup",selector:!g?d:null,oncalc:null,format:null};if(g)h=jQuery.extend(h,d);if(h.selector)h.selector=b(h.selector);if(!h.format)h.format=a.cbFormat;var j=
this,l;g=function(){var k=c[f](j.parseNumber(h));if(h.selector){l=h.selector.is(":input")?a.useFieldPlugin?"setValue":"val":"text";h.selector[l](h.format(k));h.selector.is(":input")&&h.selector.trigger("change")}jQuery.isFunction(h.oncalc)&&h.oncalc.apply(j,[k,h])};g();return j.bind(h.bind,g)}});var c={sum:function(e){var f=0,i=0;b.each(e,function(d,g){var h=g.toString().match(/\.\d+$/gi);h=h?h[0].length-1:0;if(h>i)i=h;f+=g});if(i)f=Number(f.toFixed(i));return f},diff:function(e){var f=0,i=0;b.each(e,
function(d,g){var h=g.toString().match(/\.\d+$/gi);h=h?h[0].length-1:0;if(h>i)i=h;f+=(d>0?-1:1)*g});if(i)f=Number(f.toFixed(i));return f},avg:function(e){return c.sum(e)/e.length},min:function(e){return Math.min.apply(Math,e)},max:function(e){return Math.max.apply(Math,e)}}})(jQuery);(function(b){b.vakata={};b.vakata.css={get_css:function(a,c,e){a=a.toLowerCase();var f=e.cssRules||e.rules,i=0;do{if(f.length&&i>f.length+5)return false;if(f[i].selectorText&&f[i].selectorText.toLowerCase()==a)if(c===true){e.removeRule&&e.removeRule(i);e.deleteRule&&e.deleteRule(i);return true}else return f[i]}while(f[++i]);return false},add_css:function(a,c){if(b.jstree.css.get_css(a,false,c))return false;c.insertRule?c.insertRule(a+" { }",0):c.addRule(a,null,0);return b.vakata.css.get_css(a)},remove_css:function(a,
c){return b.vakata.css.get_css(a,true,c)},add_sheet:function(a){var c;if(a.str){c=document.createElement("style");c.setAttribute("type","text/css");if(c.styleSheet){document.getElementsByTagName("head")[0].appendChild(c);c.styleSheet.cssText=a.str}else{c.appendChild(document.createTextNode(a.str));document.getElementsByTagName("head")[0].appendChild(c)}return c.sheet||c.styleSheet}if(a.url)if(document.createStyleSheet)try{document.createStyleSheet(a.url)}catch(e){}else{c=document.createElement("link");
c.rel="stylesheet";c.type="text/css";c.media="all";c.href=a.url;document.getElementsByTagName("head")[0].appendChild(c);return c.styleSheet}}}})(jQuery);
(function(b){var a=[],c=-1,e={},f={},i=false;b.fn.jstree=function(d){var g=typeof d=="string",h=Array.prototype.slice.call(arguments,1),j=this;!g&&b.meta&&h.push(b.metadata.get(this).jstree);d=!g&&h.length?b.extend.apply(null,[true,d].concat(h)):d;if(g&&d.substring(0,1)=="_")return j;g?this.each(function(){var l=a[b.data(this,"jstree-instance-id")];l=l&&b.isFunction(l[d])?l[d].apply(l,h):l;if(typeof l!=="undefined"&&(d.indexOf("is_"===0)||l!==true&&l!==false)){j=l;return false}}):this.each(function(){var l=
b.data(this,"jstree-instance-id"),k=false;typeof l!=="undefined"&&a[l]&&a[l].destroy();l=parseInt(a.push({}),10)-1;b.data(this,"jstree-instance-id",l);d||(d={});d.plugins=b.isArray(d.plugins)?d.plugins:b.jstree.defaults.plugins;b.inArray("core",d.plugins)===-1&&d.plugins.unshift("core");k=b.extend(true,{},b.jstree.defaults,d);k.plugins=d.plugins;b.each(e,function(m){if(b.inArray(m,k.plugins)===-1){k[m]=null;delete k[m]}});a[l]=new b.jstree._instance(l,b(this).addClass("jstree jstree-"+l),k);b.each(a[l]._get_settings().plugins,
function(m,n){a[l].data[n]={}});b.each(a[l]._get_settings().plugins,function(m,n){e[n]&&e[n].__init.apply(a[l])});a[l].init()});return j};b.jstree={defaults:{plugins:[]},_focused:function(){return a[c]||null},_reference:function(d){if(a[d])return a[d];var g=b(d);if(!g.length&&typeof d==="string")g=b("#"+d);if(!g.length)return null;return a[g.closest(".jstree").data("jstree-instance-id")]||null},_instance:function(d,g,h){this.data={core:{}};this.get_settings=function(){return b.extend(true,{},h)};
this._get_settings=function(){return h};this.get_index=function(){return d};this.get_container=function(){return g};this._set_settings=function(j){h=b.extend(true,{},h,j)}},_fn:{},plugin:function(d,g){g=b.extend({},{__init:b.noop,__destroy:b.noop,_fn:{},defaults:false},g);e[d]=g;b.jstree.defaults[d]=g.defaults;b.each(g._fn,function(h,j){j.plugin=d;j.old=b.jstree._fn[h];b.jstree._fn[h]=function(){var l,k=j,m=Array.prototype.slice.call(arguments);l=new b.Event("before.jstree");var n=false;do{if(k&&
k.plugin&&b.inArray(k.plugin,this._get_settings().plugins)!==-1)break;k=k.old}while(k);if(k){l=this.get_container().triggerHandler(l,{func:h,inst:this,args:m});if(l!==false){if(typeof l!=="undefined")m=l;return l=h.indexOf("_")===0?k.apply(this,m):k.apply(b.extend({},this,{__callback:function(p){this.get_container().triggerHandler(h+".jstree",{inst:this,args:m,rslt:p,rlbk:n})},__rollback:function(){return n=this.get_rollback()},__call_old:function(p){return k.old.apply(this,p?Array.prototype.slice.call(arguments,
1):m)}}),m)}}};b.jstree._fn[h].old=j.old;b.jstree._fn[h].plugin=d})},rollback:function(d){if(d){b.isArray(d)||(d=[d]);b.each(d,function(g,h){a[h.i].set_rollback(h.h,h.d)})}}};b.jstree._fn=b.jstree._instance.prototype={};b(function(){var d=navigator.userAgent.toLowerCase(),g=(d.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],h=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; margin-left:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:block; float:left; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:block; line-height:16px; padding:1px 2px; margin:0; } .jstree span { display:block; line-height:16px; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";
if(/msie/.test(d)&&parseInt(g,10)==6){i=true;h+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(d)&&
parseInt(g,10)==7)h+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } ";b.vakata.css.add_sheet({str:h})});b.jstree.plugin("core",{__init:function(){this.data.core.to_open=b.map(b.makeArray(this.get_settings().core.initially_open),function(d){return"#"+d.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/")})},defaults:{html_titles:false,animation:500,initially_open:[],rtl:false,strings:{loading:"Loading ...",new_node:"New node"}},_fn:{init:function(){this.set_focus();
this._get_settings().core.rtl&&this.get_container().addClass("jstree-rtl").css("direction","rtl");this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+this._get_settings().core.strings.loading+"</a></li></ul>");this.data.core.li_height=this.get_container().find("ul li.jstree-closed, ul li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",b.proxy(function(d){var g=
b(d.target);g.is("ins")&&d.pageY-g.offset().top<this.data.core.li_height&&this.toggle_node(g)},this)).bind("mousedown.jstree",b.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(){var d;if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){d=window.getSelection();try{d.removeAllRanges();d.collapse()}catch(g){}}});this.__callback();this.load_node(-1,function(){this.loaded();this.reopen()})},destroy:function(){var d,g=this.get_index(),
h=this._get_settings(),j=this;b.each(h.plugins,function(l,k){try{e[k].__destroy.apply(j)}catch(m){}});this.__callback();if(this.is_focused())for(d in a)if(a.hasOwnProperty(d)&&d!=g){a[d].set_focus();break}if(g===c)c=-1;this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree-instance-id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});a[g]=null;delete a[g]},save_opened:function(){var d=this;this.data.core.to_open=
[];this.get_container().find(".jstree-open").each(function(){d.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/"))});this.__callback(d.data.core.to_open)},reopen:function(d){var g=this,h=true,j=[],l=[];if(!d){this.data.core.reopen=false;this.data.core.refreshing=true}if(this.data.core.to_open.length){b.each(this.data.core.to_open,function(k,m){if(m=="#")return true;b(m).length&&b(m).is(".jstree-closed")?j.push(m):l.push(m)});if(j.length){this.data.core.to_open=
l;b.each(j,function(k,m){g.open_node(m,function(){g.reopen(true)},true)});h=false}}if(h){this.data.core.reopen&&clearTimeout(this.data.core.reopen);this.data.core.reopen=setTimeout(function(){g.__callback({},g)},50);this.data.core.refreshing=false}},refresh:function(d){var g=this;this.save_opened();d||(d=-1);(d=this._get_node(d))||(d=-1);d!==-1&&d.children("UL").remove();this.load_node(d,function(){g.__callback({obj:d});g.reopen()})},loaded:function(){this.__callback()},set_focus:function(){var d=
b.jstree._focused();d&&d!==this&&d.get_container().removeClass("jstree-focused");if(d!==this){this.get_container().addClass("jstree-focused");c=this.get_index()}this.__callback()},is_focused:function(){return c==this.get_index()},_get_node:function(d){var g=b(d,this.get_container());if(g.is(".jstree")||d==-1)return-1;g=g.closest("li",this.get_container());return g.length?g:false},_get_next:function(d,g){d=this._get_node(d);if(d===-1)return this.get_container().find("> ul > li:first-child");if(!d.length)return false;
if(g)return d.nextAll("li").size()>0?d.nextAll("li:eq(0)"):false;return d.hasClass("jstree-open")?d.find("li:eq(0)"):d.nextAll("li").size()>0?d.nextAll("li:eq(0)"):d.parentsUntil(".jstree","li").next("li").eq(0)},_get_prev:function(d,g){d=this._get_node(d);if(d===-1)return this.get_container().find("> ul > li:last-child");if(!d.length)return false;if(g)return d.prevAll("li").length>0?d.prevAll("li:eq(0)"):false;if(d.prev("li").length){for(d=d.prev("li").eq(0);d.hasClass("jstree-open");)d=d.children("ul:eq(0)").children("li:last");
return d}else{var h=d.parentsUntil(".jstree","li:eq(0)");return h.length?h:false}},_get_parent:function(d){d=this._get_node(d);if(d==-1||!d.length)return false;d=d.parentsUntil(".jstree","li:eq(0)");return d.length?d:-1},_get_children:function(d){d=this._get_node(d);if(d===-1)return this.get_container().children("ul:eq(0)").children("li");if(!d.length)return false;return d.children("ul:eq(0)").children("li")},get_path:function(d,g){var h=[],j=this;d=this._get_node(d);if(d===-1||!d||!d.length)return false;
d.parentsUntil(".jstree","li").each(function(){h.push(g?this.id:j.get_text(this))});h.reverse();h.push(g?d.attr("id"):this.get_text(d));return h},is_open:function(d){return(d=this._get_node(d))&&d!==-1&&d.hasClass("jstree-open")},is_closed:function(d){return(d=this._get_node(d))&&d!==-1&&d.hasClass("jstree-closed")},is_leaf:function(d){return(d=this._get_node(d))&&d!==-1&&d.hasClass("jstree-leaf")},open_node:function(d,g,h){d=this._get_node(d);if(!d.length)return false;if(!d.hasClass("jstree-closed")){g&&
g.call();return false}var j=h||i?0:this._get_settings().core.animation,l=this;if(this._is_loaded(d)){j&&d.children("ul").css("display","none");d.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");j&&d.children("ul").stop(true).slideDown(j,function(){this.style.display=""});this.__callback({obj:d});g&&g.call()}else{d.children("a").addClass("jstree-loading");this.load_node(d,function(){l.open_node(d,g,h)},g)}},close_node:function(d,g){d=this._get_node(d);
var h=g||i?0:this._get_settings().core.animation;if(!d.length||!d.hasClass("jstree-open"))return false;h&&d.children("ul").attr("style","display:block !important");d.removeClass("jstree-open").addClass("jstree-closed");h&&d.children("ul").stop(true).slideUp(h,function(){this.style.display=""});this.__callback({obj:d})},toggle_node:function(d){d=this._get_node(d);if(d.hasClass("jstree-closed"))return this.open_node(d);if(d.hasClass("jstree-open"))return this.close_node(d)},open_all:function(d,g){d=
d?this._get_node(d):this.get_container();if(!d||d===-1)d=this.get_container();if(g)d=d.find("li.jstree-closed");else{g=d;d=d.is(".jstree-closed")?d.find("li.jstree-closed").andSelf():d.find("li.jstree-closed")}var h=this;d.each(function(){var j=this;h._is_loaded(this)?h.open_node(this,false,true):h.open_node(this,function(){h.open_all(j,g)},true)});g.find("li.jstree-closed").length===0&&this.__callback({obj:g})},close_all:function(d){var g=this;d=d?this._get_node(d):this.get_container();if(!d||d===
-1)d=this.get_container();d.find("li.jstree-open").andSelf().each(function(){g.close_node(this)});this.__callback({obj:d})},clean_node:function(d){d=d&&d!=-1?b(d):this.get_container();d=d.is("li")?d.find("li").andSelf():d.find("li");d.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");d.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:d})},
get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(d,g){this.get_container().empty().append(d);this.data=g;this.__callback()},load_node:function(d){this.__callback({obj:d})},_is_loaded:function(){return true},create_node:function(d,g,h,j,l){d=this._get_node(d);g=typeof g==="undefined"?"last":g;var k=b("<li>"),m=this._get_settings().core,n;if(d!==-1&&!d.length)return false;if(!l&&!this._is_loaded(d)){this.load_node(d,
function(){this.create_node(d,g,h,j,true)});return false}this.__rollback();if(typeof h==="string")h={data:h};h||(h={});h.attr&&k.attr(h.attr);h.state&&k.addClass("jstree-"+h.state);if(!h.data)h.data=m.strings.new_node;if(!b.isArray(h.data)){n=h.data;h.data=[];h.data.push(n)}b.each(h.data,function(p,o){n=b("<a>");if(b.isFunction(o))o=o.call(this,h);if(typeof o=="string")n.attr("href","#")[m.html_titles?"html":"text"](o);else{if(!o.attr)o.attr={};if(!o.attr.href)o.attr.href="#";n.attr(o.attr)[m.html_titles?
"html":"text"](o.title);o.language&&n.addClass(o.language)}n.prepend("<ins class='jstree-icon'>&#160;</ins>");if(o.icon)o.icon.indexOf("/")===-1?n.children("ins").addClass(o.icon):n.children("ins").css("background","url('"+o.icon+"') center center no-repeat");k.append(n)});k.prepend("<ins class='jstree-icon'>&#160;</ins>");if(d===-1){d=this.get_container();if(g==="before")g="first";if(g==="after")g="last"}switch(g){case "before":d.before(k);n=this._get_parent(d);break;case "after":d.after(k);n=this._get_parent(d);
break;case "inside":case "first":d.children("ul").length||d.append("<ul>");d.children("ul").prepend(k);n=d;break;case "last":d.children("ul").length||d.append("<ul>");d.children("ul").append(k);n=d;break;default:d.children("ul").length||d.append("<ul>");g||(g=0);n=d.children("ul").children("li").eq(g);n.length?n.before(k):d.children("ul").append(k);n=d;break}if(n===-1||n.get(0)===this.get_container().get(0))n=-1;this.clean_node(n);this.__callback({obj:k,parent:n});j&&j.call(this,k);return k},get_text:function(d){d=
this._get_node(d);if(!d.length)return false;var g=this._get_settings().core.html_titles;d=d.children("a:eq(0)");if(g){d=d.clone();d.children("INS").remove();return d.html()}else{d=d.contents().filter(function(){return this.nodeType==3})[0];return d.nodeValue}},set_text:function(d,g){d=this._get_node(d);if(!d.length)return false;d=d.children("a:eq(0)");if(this._get_settings().core.html_titles){var h=d.children("INS").clone();d.html(g).prepend(h);this.__callback({obj:d,name:g});return true}else{d=d.contents().filter(function(){return this.nodeType==
3})[0];this.__callback({obj:d,name:g});return d.nodeValue=g}},rename_node:function(d,g){d=this._get_node(d);this.__rollback();d&&d.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))&&this.__callback({obj:d,name:g})},delete_node:function(d){d=this._get_node(d);if(!d.length)return false;this.__rollback();var g=this._get_parent(d),h=this._get_prev(d);d=d.remove();g!==-1&&g.find("> ul > li").length===0&&g.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");this.clean_node(g);
this.__callback({obj:d,prev:h});return d},prepare_move:function(d,g,h,j,l){var k={};k.ot=b.jstree._reference(k.o)||this;k.o=k.ot._get_node(d);k.r=g===-1?-1:this._get_node(g);k.p=typeof k==="undefined"?"last":h;if(!(!l&&f.o&&f.o[0]===k.o[0]&&f.r[0]===k.r[0]&&f.p===k.p)){k.ot=b.jstree._reference(k.o)||this;k.rt=g===-1?k.ot:b.jstree._reference(k.r)||this;if(k.r===-1){k.cr=-1;switch(k.p){case "first":case "before":case "inside":k.cp=0;break;case "after":case "last":k.cp=k.rt.get_container().find(" > ul > li").length;
break;default:k.cp=k.p;break}}else{if(!/^(before|after)$/.test(k.p)&&!this._is_loaded(k.r))return this.load_node(k.r,function(){this.prepare_move(d,g,h,j,true)});switch(k.p){case "before":k.cp=k.r.index();k.cr=k.rt._get_parent(k.r);break;case "after":k.cp=k.r.index()+1;k.cr=k.rt._get_parent(k.r);break;case "inside":case "first":k.cp=0;k.cr=k.r;break;case "last":k.cp=k.r.find(" > ul > li").length;k.cr=k.r;break;default:k.cp=k.p;k.cr=k.r;break}}k.np=k.cr==-1?k.rt.get_container():k.cr;k.op=k.ot._get_parent(k.o);
k.or=k.np.find(" > ul > li:nth-child("+(k.cp+1)+")");f=k}this.__callback(f);j&&j.call(this,f)},check_move:function(){var d=f,g=true;if(d.or[0]===d.o[0])return false;d.o.each(function(){if(d.r.parentsUntil(".jstree").andSelf().filter("li").index(this)!==-1)return g=false});return g},move_node:function(d,g,h,j,l,k){if(!l)return this.prepare_move(d,g,h,function(n){this.move_node(n,false,false,j,true,k)});if(!k&&!this.check_move())return false;this.__rollback();g=false;if(j){g=d.o.clone();g.find("*[id]").andSelf().each(function(){if(this.id)this.id=
"copy_"+this.id})}else g=d.o;if(d.or.length)d.or.before(g);else{d.np.children("ul").length||b("<ul>").appendTo(d.np);d.np.children("ul:eq(0)").append(g)}try{d.ot.clean_node(d.op);d.rt.clean_node(d.np);d.op.find("> ul > li").length||d.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(m){}if(j){f.cy=true;f.oc=g}this.__callback(f);return f},_get_move:function(){return f}}})})(jQuery);
(function(b){b.jstree.plugin("ui",{__init:function(){this.data.ui.selected=b();this.data.ui.last_selected=false;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",b.proxy(function(a){a.preventDefault();this.select_node(a.currentTarget,true,a)},this)).delegate("a","mouseenter.jstree",b.proxy(function(a){this.hover_node(a.target)},this)).delegate("a","mouseleave.jstree",b.proxy(function(a){this.dehover_node(a.target)},
this)).bind("reopen.jstree",b.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",b.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",b.proxy(function(){this.reselect()},this)).bind("close_node.jstree",b.proxy(function(a,c){var e=this._get_settings().ui,f=this._get_node(c.rslt.obj),i=f&&f.length?f.children("ul").find(".jstree-clicked"):b(),d=this;e.selected_parent_close===false||!i.length||i.each(function(){d.deselect_node(this);e.selected_parent_close===
"select_parent"&&d.select_node(f)})},this)).bind("delete_node.jstree",b.proxy(function(a,c){var e=this._get_settings().ui.select_prev_on_delete,f=this._get_node(c.rslt.obj);f=f&&f.length?f.find(".jstree-clicked"):[];var i=this;f.each(function(){i.deselect_node(this)});e&&f.length&&this.select_node(c.rslt.prev)},this)).bind("move_node.jstree",b.proxy(function(a,c){c.rslt.cy&&c.rslt.oc.find(".jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",
selected_parent_close:"select_parent",select_prev_on_delete:true,disable_selecting_children:false,initially_select:[]},_fn:{_get_node:function(a,c){if(typeof a==="undefined"||a===null)return c?this.data.ui.selected:this.data.ui.last_selected;var e=b(a,this.get_container());if(e.is(".jstree")||a==-1)return-1;e=e.closest("li",this.get_container());return e.length?e:false},save_selected:function(){var a=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){a.data.ui.to_select.push("#"+
this.id.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/"))});this.__callback(this.data.ui.to_select)},reselect:function(){var a=this,c=this.data.ui.to_select;c=b.map(b.makeArray(c),function(e){return"#"+e.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/")});this.deselect_all();b.each(c,function(e,f){f&&f!=="#"&&a.select_node(f)});this.__callback()},refresh:function(){this.save_selected();return this.__call_old()},hover_node:function(a){a=this._get_node(a);if(!a.length)return false;
a.hasClass("jstree-hovered")||this.dehover_node();this.data.ui.hovered=a.children("a").addClass("jstree-hovered").parent();this.__callback({obj:a})},dehover_node:function(){var a=this.data.ui.hovered;if(!a||!a.length)return false;if(this.data.ui.hovered[0]===a.children("a").removeClass("jstree-hovered").parent()[0])this.data.ui.hovered=null;this.__callback({obj:a})},select_node:function(a,c,e){a=this._get_node(a);if(a==-1||!a||!a.length)return false;var f=this._get_settings().ui;e=f.select_multiple_modifier==
"on"||f.select_multiple_modifier!==false&&e&&e[f.select_multiple_modifier+"Key"];var i=this.is_selected(a),d=true;if(c){if(f.disable_selecting_children&&e&&a.parents("li",this.get_container()).children(".jstree-clicked").length)return false;d=false;switch(true){case i&&!e:this.deselect_all();i=false;d=true;break;case !i&&!e:if(f.select_limit==-1||f.select_limit>0){this.deselect_all();d=true}break;case i&&e:this.deselect_node(a);break;case !i&&e:if(f.select_limit==-1||this.data.ui.selected.length+
1<=f.select_limit)d=true;break}}if(d&&!i){a.children("a").addClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.add(a);this.data.ui.last_selected=a;this.__callback({obj:a})}},deselect_node:function(a){a=this._get_node(a);if(!a.length)return false;if(this.is_selected(a)){a.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(a);if(this.data.ui.last_selected.get(0)===a.get(0))this.data.ui.last_selected=this.data.ui.selected.eq(0);this.__callback({obj:a})}},
toggle_select:function(a){a=this._get_node(a);if(!a.length)return false;this.is_selected(a)?this.deselect_node(a):this.select_node(a)},is_selected:function(a){return this.data.ui.selected.index(this._get_node(a))>=0},get_selected:function(a){return a?b(a).find(".jstree-clicked").parent():this.data.ui.selected},deselect_all:function(a){a?b(a).find(".jstree-clicked").removeClass("jstree-clicked"):this.get_container().find(".jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=b([]);
this.data.ui.last_selected=false;this.__callback()}}});b.jstree.defaults.plugins.push("ui")})(jQuery);
(function(b){b.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",b.proxy(function(a,c){if(this._get_settings().crrm.move.open_onmove){var e=this;c.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){e.open_node(this,false,true)})}},this))},defaults:{input_width_limit:200,move:{always_copy:false,open_onmove:true,default_position:"last",check_move:function(){return true}}},_fn:{_show_input:function(a,c){a=this._get_node(a);var e=this._get_settings().core.rtl,
f=this._get_settings().crrm.input_width_limit,i=a.children("ins").width(),d=a.find("> a:visible > ins").width()*a.find("> a:visible > ins").length,g=this.get_text(a),h=b("<div>",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),j=a.css("position","relative").append(b("<input>",{value:g,css:{padding:"0",border:"1px solid silver",position:"absolute",left:e?"auto":i+d+4+"px",right:e?i+d+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",
lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:b.proxy(function(){var l=a.children("input"),k=l.val();if(k==="")k=g;l.remove();this.set_text(a,g);this.rename_node(a,k);c.call(this,a,k,g);a.css("position","")},this),keyup:function(l){l=l.keyCode||l.which;if(l==27){this.value=g;this.blur()}else l==13?this.blur():j.width(Math.min(h.text("pW"+this.value).width(),f))}})).children("input");this.set_text(a,"");h.css({fontFamily:j.css("fontFamily")||"",fontSize:j.css("fontSize")||"",fontWeight:j.css("fontWeight")||
"",fontStyle:j.css("fontStyle")||"",fontStretch:j.css("fontStretch")||"",fontVariant:j.css("fontVariant")||"",letterSpacing:j.css("letterSpacing")||"",wordSpacing:j.css("wordSpacing")||""});j.width(Math.min(h.text("pW"+j[0].value).width(),f))[0].select()},rename:function(a){a=this._get_node(a);this.__rollback();var c=this.__callback;this._show_input(a,function(e,f,i){c.call(this,{obj:e,new_name:f,old_name:i})})},create:function(a,c,e,f,i){var d=this;(a=this._get_node(a))||(a=-1);this.__rollback();
return this.create_node(a,c,e,function(g){var h=this._get_parent(g),j=b(g).index();f&&f.call(this,g);h.length&&h.hasClass("jstree-closed")&&this.open_node(h,false,true);i?d.__callback({obj:g,name:this.get_text(g),parent:h,position:j}):this._show_input(g,function(l,k){d.__callback({obj:l,name:k,parent:h,position:j})})})},remove:function(a){a=this._get_node(a,true);this.__rollback();this.delete_node(a);this.__callback({obj:a})},check_move:function(){if(!this.__call_old())return false;if(!this._get_settings().crrm.move.check_move.call(this,
this._get_move()))return false;return true},move_node:function(a,c,e,f,i,d){var g=this._get_settings().crrm.move;if(!i){if(!e)e=g.default_position;if(e==="inside"&&!g.default_position.match(/^(before|after)$/))e=g.default_position;return this.__call_old(true,a,c,e,f,false,d)}if(g.always_copy===true||g.always_copy==="multitree"&&a.rt.get_index()!==a.ot.get_index())f=true;this.__call_old(true,a,c,e,f,true,d)},cut:function(a){a=this._get_node(a);this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=
false;if(!a||!a.length)return false;this.data.crrm.ct_nodes=a},copy:function(a){a=this._get_node(a);this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=false;if(!a||!a.length)return false;this.data.crrm.cp_nodes=a},paste:function(a){a=this._get_node(a);if(!a||!a.length)return false;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes)return false;this.data.crrm.ct_nodes&&this.move_node(this.data.crrm.ct_nodes,a);this.data.crrm.cp_nodes&&this.move_node(this.data.crrm.cp_nodes,a,false,true);this.data.crrm.cp_nodes=
false;this.data.crrm.ct_nodes=false}}});b.jstree.defaults.plugins.push("crrm")})(jQuery);
(function(b){var a=[];b.jstree._themes=false;b.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",b.proxy(function(){var c=this._get_settings().themes;this.data.themes.dots=c.dots;this.data.themes.icons=c.icons;this.set_theme(c.theme,c.url)},this)).bind("loaded.jstree",b.proxy(function(){this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons()},this))},defaults:{theme:"default",url:false,dots:true,icons:true},
_fn:{set_theme:function(c,e){if(!c)return false;e||(e=b.jstree._themes+c+"/style.css");if(b.inArray(e,a)==-1){b.vakata.css.add_sheet({url:e,rel:"jstree"});a.push(e)}if(this.data.themes.theme!=c){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=c}this.get_container().addClass("jstree-"+c);this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons();this.__callback()},get_theme:function(){return this.data.themes.theme},
show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this.data.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},
toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()}}});b(function(){b.jstree._themes===false&&b("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){b.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}});if(b.jstree._themes===false)b.jstree._themes="/js/themes/"});b.jstree.defaults.plugins.push("themes")})(jQuery);
(function(b){var a=[];b.jstree.plugin("hotkeys",{__init:function(){if(typeof b.hotkeys==="undefined")throw"jsTree hotkeys: jQuery hotkeys plugin not included.";if(!this.data.ui)throw"jsTree hotkeys: jsTree UI plugin not included.";b.each(this._get_settings().hotkeys,function(c){if(b.inArray(c,a)==-1){b(document).bind("keydown",c,function(e){var f;var i=b.jstree._focused(),d;if(i&&i.data&&i.data.hotkeys&&i.data.hotkeys.enabled)if(d=i._get_settings().hotkeys[c])f=d.call(i,e);return f});a.push(c)}});
this.enable_hotkeys()},defaults:{up:function(){this.hover_node(this._get_prev(this.data.ui.hovered||this.data.ui.last_selected||-1));return false},down:function(){this.hover_node(this._get_next(this.data.ui.hovered||this.data.ui.last_selected||-1));return false},left:function(){var c=this.data.ui.hovered||this.data.ui.last_selected;if(c)c.hasClass("jstree-open")?this.close_node(c):this.hover_node(this._get_prev(c));return false},right:function(){var c=this.data.ui.hovered||this.data.ui.last_selected;
if(c&&c.length)c.hasClass("jstree-closed")?this.open_node(c):this.hover_node(this._get_next(c));return false},space:function(){this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").click();return false},"ctrl+space":function(c){c.type="click";this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(c);return false},f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=
true},disable_hotkeys:function(){this.data.hotkeys.enabled=false}}})})(jQuery);
(function(b){b.jstree.plugin("json_data",{defaults:{data:false,ajax:false,correct_state:true,progressive_render:false},_fn:{load_node:function(a,c,e){var f=this;this.load_node_json(a,function(){f.__callback({obj:a});c.call(this)},e)},_is_loaded:function(a){var c=this._get_settings().json_data;if((a=this._get_node(a))&&a!==-1&&c.progressive_render&&!a.is(".jstree-open, .jstree-leaf")&&a.children("ul").children("li").length===0&&a.data("jstree-children")){if(c=this._parse_json(a.data("jstree-children"))){a.append(c);
b.removeData(a,"jstree-children")}this.clean_node(a);return true}return a==-1||!a||!c.ajax||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").size()>0},load_node_json:function(a,c,e){var f=this.get_settings().json_data,i,d=function(){};i=function(){};if((a=this._get_node(a))&&a!==-1)if(a.data("jstree-is-loading"))return;else a.data("jstree-is-loading",true);switch(true){case !f.data&&!f.ajax:throw"Neither data nor ajax settings supplied.";case !!f.data&&!f.ajax||!!f.data&&!!f.ajax&&
(!a||a===-1):if(!a||a==-1)if(i=this._parse_json(f.data)){this.get_container().children("ul").empty().append(i.children());this.clean_node()}else f.correct_state&&this.get_container().children("ul").empty();c&&c.call(this);break;case !f.data&&!!f.ajax||!!f.data&&!!f.ajax&&a&&a!==-1:d=function(g,h,j){var l=this.get_settings().json_data.ajax.error;l&&l.call(this,g,h,j);if(a!=-1&&a.length){a.children(".jstree-loading").removeClass("jstree-loading");a.data("jstree-is-loading",false);h==="success"&&f.correct_state&&
a.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}else h==="success"&&f.correct_state&&this.get_container().children("ul").empty();e&&e.call(this)};i=function(g,h,j){var l=this.get_settings().json_data.ajax.success;if(l)g=l.call(this,g,h,j)||g;if(g===""||!b.isArray(g)&&!b.isPlainObject(g))return d.call(this,j,h,"");if(g=this._parse_json(g)){if(a===-1||!a)this.get_container().children("ul").empty().append(g.children());else{a.append(g).children(".jstree-loading").removeClass("jstree-loading");
a.data("jstree-is-loading",false)}this.clean_node(a);c&&c.call(this)}else if(a===-1||!a){if(f.correct_state){this.get_container().children("ul").empty();c&&c.call(this)}}else{a.children(".jstree-loading").removeClass("jstree-loading");a.data("jstree-is-loading",false);if(f.correct_state){a.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");c&&c.call(this)}}};f.ajax.context=this;f.ajax.error=d;f.ajax.success=i;if(!f.ajax.dataType)f.ajax.dataType="json";if(b.isFunction(f.ajax.url))f.ajax.url=
f.ajax.url.call(this,a);if(b.isFunction(f.ajax.data))f.ajax.data=f.ajax.data.call(this,a);b.ajax(f.ajax);break}},_parse_json:function(a,c){var e=false,f=this._get_settings(),i=f.json_data,d=f.core.html_titles,g;if(!a)return e;if(b.isFunction(a))a=a.call(this);if(b.isArray(a)){e=b();if(!a.length)return false;f=0;for(i=a.length;f<i;f++){g=this._parse_json(a[f],true);if(g.length)e=e.add(g)}}else{if(typeof a=="string")a={data:a};if(!a.data&&a.data!=="")return e;e=b("<li>");a.attr&&e.attr(a.attr);a.metadata&&
e.data("jstree",a.metadata);a.state&&e.addClass("jstree-"+a.state);if(!b.isArray(a.data)){g=a.data;a.data=[];a.data.push(g)}b.each(a.data,function(h,j){g=b("<a>");if(b.isFunction(j))j=j.call(this,a);if(typeof j=="string")g.attr("href","#")[d?"html":"text"](j);else{if(!j.attr)j.attr={};if(!j.attr.href)j.attr.href="#";g.attr(j.attr)[d?"html":"text"](j.title);j.language&&g.addClass(j.language)}g.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!j.icon&&a.icon)j.icon=a.icon;if(j.icon)j.icon.indexOf("/")===
-1?g.children("ins").addClass(j.icon):g.children("ins").css("background","url('"+j.icon+"') center center no-repeat");e.append(g)});e.prepend("<ins class='jstree-icon'>&#160;</ins>");if(a.children)if(i.progressive_render&&a.state!=="open")e.addClass("jstree-closed").data("jstree-children",a.children);else{if(b.isFunction(a.children))a.children=a.children.call(this,a);if(b.isArray(a.children)&&a.children.length){g=this._parse_json(a.children,true);if(g.length){f=b("<ul>");f.append(g);e.append(f)}}}}if(!c){f=
b("<ul>");f.append(e);e=f}return e},get_json:function(a,c,e,f){var i=[],d=this._get_settings(),g=this,h,j,l,k,m,n;a=this._get_node(a);if(!a||a===-1)a=this.get_container().find("> ul > li");c=b.isArray(c)?c:["id","class"];!f&&this.data.types&&c.push(d.types.type_attr);e=b.isArray(e)?e:[];a.each(function(){l=b(this);h={data:[]};if(c.length)h.attr={};b.each(c,function(p,o){if((j=l.attr(o))&&j.length&&j.replace(/jstree[^ ]*|$/ig,"").length)h.attr[o]=j.replace(/jstree[^ ]*|$/ig,"")});if(l.hasClass("jstree-open"))h.state=
"open";if(l.hasClass("jstree-closed"))h.state="closed";k=l.children("a");k.each(function(){m=b(this);if(e.length||b.inArray("languages",d.plugins)!==-1||m.children("ins").get(0).style.backgroundImage.length||m.children("ins").get(0).className&&m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length){n=false;b.inArray("languages",d.plugins)!==-1&&b.isArray(d.languages)&&d.languages.length&&b.each(d.languages,function(p,o){if(m.hasClass(o)){n=o;return false}});j={attr:{},title:g.get_text(m,
n)};b.each(e,function(p,o){h.attr[o]=(m.attr(o)||"").replace(/jstree[^ ]*|$/ig,"")});b.each(d.languages,function(p,o){if(m.hasClass(o)){j.language=o;return true}});if(m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length)j.icon=m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"");if(m.children("ins").get(0).style.backgroundImage.length)j.icon=m.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}else j=
g.get_text(m);if(k.length>1)h.data.push(j);else h.data=j});l=l.find("> ul > li");if(l.length)h.children=g.get_json(l,c,e,true);i.push(h)});return i}}})})(jQuery);
(function(b){b.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(a){var c=this._get_settings().languages,e=false,f=".jstree-"+this.get_index()+" a";if(!b.isArray(c)||c.length===0)return false;if(b.inArray(a,c)==-1)if(c[a])a=c[a];else return false;if(a==this.data.languages.current_language)return true;e=b.vakata.css.get_css(f+"."+this.data.languages.current_language,false,this.data.languages.language_css);if(e!==false)e.style.display="none";e=b.vakata.css.get_css(f+
"."+a,false,this.data.languages.language_css);if(e!==false)e.style.display="";this.data.languages.current_language=a;this.__callback(a);return true},get_lang:function(){return this.data.languages.current_language},get_text:function(a,c){a=this._get_node(a)||this.data.ui.last_selected;if(!a.size())return false;var e=this._get_settings().languages,f=this._get_settings().core.html_titles;if(b.isArray(e)&&e.length){c=c&&b.inArray(c,e)!=-1?c:this.data.languages.current_language;a=a.children("a."+c)}else a=
a.children("a:eq(0)");if(f){a=a.clone();a.children("INS").remove();return a.html()}else{a=a.contents().filter(function(){return this.nodeType==3})[0];return a.nodeValue}},set_text:function(a,c,e){a=this._get_node(a)||this.data.ui.last_selected;if(!a.size())return false;var f=this._get_settings().languages,i=this._get_settings().core.html_titles;if(b.isArray(f)&&f.length){e=e&&b.inArray(e,f)!=-1?e:this.data.languages.current_language;a=a.children("a."+e)}else a=a.children("a:eq(0)");if(i){f=a.children("INS").clone();
a.html(c).prepend(f);this.__callback({obj:a,name:c,lang:e});return true}else{a=a.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:a,name:c,lang:e});return a.nodeValue=c}},_load_css:function(){var a=this._get_settings().languages,c="/* languages css */",e=".jstree-"+this.get_index()+" a",f;if(b.isArray(a)&&a.length){this.data.languages.current_language=a[0];for(f=0;f<a.length;f++){c+=e+"."+a[f]+" {";if(a[f]!=this.data.languages.current_language)c+=" display:none; ";c+=
" } "}this.data.languages.language_css=b.vakata.css.add_sheet({str:c})}},create_node:function(a,c,e,f){return this.__call_old(true,a,c,e,function(i){var d=this._get_settings().languages,g=i.children("a"),h;if(b.isArray(d)&&d.length){for(h=0;h<d.length;h++)g.is("."+d[h])||i.append(g.eq(0).clone().removeClass(d.join(" ")).addClass(d[h]));g.not("."+d.join(", .")).remove()}f&&f.call(this,i)})}}})})(jQuery);
(function(b){b.jstree.plugin("cookies",{__init:function(){if(typeof b.cookie==="undefined")throw"jsTree cookie: jQuery cookie plugin not included.";var a=this._get_settings().cookies,c;if(a.save_opened)if((c=b.cookie(a.save_opened))&&c.length)this.data.core.to_open=c.split(",");if(a.save_selected)if((c=b.cookie(a.save_selected))&&c.length&&this.data.ui)this.data.ui.to_select=c.split(",");this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",b.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",
b.proxy(function(e){this._get_settings().cookies.auto_save&&this.save_cookie((e.handleObj.namespace+e.handleObj.type).replace("jstree",""))},this))},this))},defaults:{save_opened:"jstree_open",save_selected:"jstree_select",auto_save:true,cookie_options:{}},_fn:{save_cookie:function(a){if(!this.data.core.refreshing){var c=this._get_settings().cookies;if(a)switch(a){case "open_node":case "close_node":if(c.save_opened){this.save_opened();b.cookie(c.save_opened,this.data.core.to_open.join(","),c.cookie_options)}break;
case "select_node":case "deselect_node":if(c.save_selected&&this.data.ui){this.save_selected();b.cookie(c.save_selected,this.data.ui.to_select.join(","),c.cookie_options)}break}else{if(c.save_opened){this.save_opened();b.cookie(c.save_opened,this.data.core.to_open.join(","),c.cookie_options)}if(c.save_selected&&this.data.ui){this.save_selected();b.cookie(c.save_selected,this.data.ui.to_select.join(","),c.cookie_options)}}}}}});b.jstree.defaults.plugins.push("cookies")})(jQuery);
(function(b){b.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",b.proxy(function(a,c){var e=this._get_node(c.rslt.obj);e=e===-1?this.get_container().children("ul"):e.children("ul");this.sort(e)},this)).bind("rename_node.jstree",b.proxy(function(a,c){this.sort(c.rslt.obj.parent())},this)).bind("move_node.jstree",b.proxy(function(a,c){this.sort((c.rslt.np==-1?this.get_container():c.rslt.np).children("ul"))},this))},defaults:function(a,c){return this.get_text(a)>this.get_text(c)?
1:-1},_fn:{sort:function(a){var c=this._get_settings().sort,e=this;a.append(b.makeArray(a.children("li")).sort(b.proxy(c,e)));a.find("> li > ul").each(function(){e.sort(b(this))});this.clean_node(a)}}})})(jQuery);
(function(b){var a=false,c=false,e=false,f=false,i=false,d=false,g=false;b.vakata.dnd={is_down:false,is_drag:false,helper:false,scroll_spd:10,init_x:0,init_y:0,threshold:5,user_data:{},drag_start:function(h,j,l){b.vakata.dnd.is_drag&&b.vakata.drag_stop({});try{h.currentTarget.unselectable="on";h.currentTarget.onselectstart=function(){return false};if(h.currentTarget.style)h.currentTarget.style.MozUserSelect="none"}catch(k){}b.vakata.dnd.init_x=h.pageX;b.vakata.dnd.init_y=h.pageY;b.vakata.dnd.user_data=
j;b.vakata.dnd.is_down=true;b.vakata.dnd.helper=b("<div id='vakata-dragged'>").html(l).css("opacity","0.75");b(document).bind("mousemove",b.vakata.dnd.drag);b(document).bind("mouseup",b.vakata.dnd.drag_stop);return false},drag:function(h){if(b.vakata.dnd.is_down){if(!b.vakata.dnd.is_drag)if(Math.abs(h.pageX-b.vakata.dnd.init_x)>5||Math.abs(h.pageY-b.vakata.dnd.init_y)>5){b.vakata.dnd.helper.appendTo("body");b.vakata.dnd.is_drag=true;b(document).triggerHandler("drag_start.vakata",{event:h,data:b.vakata.dnd.user_data})}else return;
if(h.type==="mousemove"){var j=b(document),l=j.scrollTop();j=j.scrollLeft();if(h.pageY-l<20){if(i&&d==="down"){clearInterval(i);i=false}if(!i){d="up";i=setInterval(function(){b(document).scrollTop(b(document).scrollTop()-b.vakata.dnd.scroll_spd)},150)}}else if(i&&d==="up"){clearInterval(i);i=false}if(b(window).height()-(h.pageY-l)<20){if(i&&d==="up"){clearInterval(i);i=false}if(!i){d="down";i=setInterval(function(){b(document).scrollTop(b(document).scrollTop()+b.vakata.dnd.scroll_spd)},150)}}else if(i&&
d==="down"){clearInterval(i);i=false}if(h.pageX-j<20){if(f&&g==="right"){clearInterval(f);f=false}if(!f){g="left";f=setInterval(function(){b(document).scrollLeft(b(document).scrollLeft()-b.vakata.dnd.scroll_spd)},150)}}else if(f&&g==="left"){clearInterval(f);f=false}if(b(window).width()-(h.pageX-j)<20){if(f&&g==="left"){clearInterval(f);f=false}if(!f){g="right";f=setInterval(function(){b(document).scrollLeft(b(document).scrollLeft()+b.vakata.dnd.scroll_spd)},150)}}else if(f&&g==="right"){clearInterval(f);
f=false}}b.vakata.dnd.helper.css({left:h.pageX+5+"px",top:h.pageY+10+"px"});b(document).triggerHandler("drag.vakata",{event:h,data:b.vakata.dnd.user_data})}},drag_stop:function(h){b(document).unbind("mousemove",b.vakata.dnd.drag);b(document).unbind("mouseup",b.vakata.dnd.drag_stop);b(document).triggerHandler("drag_stop.vakata",{event:h,data:b.vakata.dnd.user_data});b.vakata.dnd.helper.remove();b.vakata.dnd.init_x=0;b.vakata.dnd.init_y=0;b.vakata.dnd.user_data={};b.vakata.dnd.is_down=false;b.vakata.dnd.is_drag=
false}};b(function(){b.vakata.css.add_sheet({str:"#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } "})});b.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:false,after:false,inside:false,before:false,off:false,prepared:false,w:0,to1:false,to2:false,cof:false,cw:false,ch:false,i1:false,i2:false};this.get_container().bind("mouseenter.jstree",b.proxy(function(){if(b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree&&
this.data.themes){e.attr("class","jstree-"+this.data.themes.theme);b.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}},this)).bind("mouseleave.jstree",b.proxy(function(){if(b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree){this.data.dnd.i1&&clearInterval(this.data.dnd.i1);this.data.dnd.i2&&clearInterval(this.data.dnd.i2)}},this)).bind("mousemove.jstree",b.proxy(function(j){if(b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree){var l=this.get_container()[0];if(j.pageX+
24>this.data.dnd.cof.left+this.data.dnd.cw){this.data.dnd.i1&&clearInterval(this.data.dnd.i1);this.data.dnd.i1=setInterval(b.proxy(function(){this.scrollLeft+=b.vakata.dnd.scroll_spd},l),100)}else if(j.pageX-24<this.data.dnd.cof.left){this.data.dnd.i1&&clearInterval(this.data.dnd.i1);this.data.dnd.i1=setInterval(b.proxy(function(){this.scrollLeft-=b.vakata.dnd.scroll_spd},l),100)}else this.data.dnd.i1&&clearInterval(this.data.dnd.i1);if(j.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch){this.data.dnd.i2&&
clearInterval(this.data.dnd.i2);this.data.dnd.i2=setInterval(b.proxy(function(){this.scrollTop+=b.vakata.dnd.scroll_spd},l),100)}else if(j.pageY-24<this.data.dnd.cof.top){this.data.dnd.i2&&clearInterval(this.data.dnd.i2);this.data.dnd.i2=setInterval(b.proxy(function(){this.scrollTop-=b.vakata.dnd.scroll_spd},l),100)}else this.data.dnd.i2&&clearInterval(this.data.dnd.i2)}},this)).delegate("a","mousedown.jstree",b.proxy(function(j){if(j.which===1){this.start_drag(j.currentTarget,j);return false}},this)).delegate("a",
"mouseenter.jstree",b.proxy(function(j){b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree&&this.dnd_enter(j.currentTarget)},this)).delegate("a","mousemove.jstree",b.proxy(function(j){if(b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree){if(typeof this.data.dnd.off.top==="undefined")this.data.dnd.off=b(j.target).offset();this.data.dnd.w=(j.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height;if(this.data.dnd.w<0)this.data.dnd.w+=this.data.core.li_height;this.dnd_show()}},this)).delegate("a",
"mouseleave.jstree",b.proxy(function(j){if(b.vakata.dnd.is_drag&&b.vakata.dnd.user_data.jstree){this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;b.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");e.hide();if(c&&c[0]===j.target.parentNode){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1);this.data.dnd.to1=false}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2);this.data.dnd.to2=false}}}},this)).delegate("a","mouseup.jstree",b.proxy(function(j){b.vakata.dnd.is_drag&&
b.vakata.dnd.user_data.jstree&&this.dnd_finish(j)},this));b(document).bind("drag_stop.vakata",b.proxy(function(){this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;this.data.dnd.off=false;this.data.dnd.prepared=false;this.data.dnd.w=false;this.data.dnd.to1=false;this.data.dnd.to2=false;this.data.dnd.active=false;this.data.dnd.foreign=false;e&&e.css({top:"-2000px"})},this)).bind("drag_start.vakata",b.proxy(function(j,l){if(l.data.jstree){var k=b(l.event.target);k.closest(".jstree").hasClass("jstree-"+
this.get_index())&&this.dnd_enter(k)}},this));var h=this._get_settings().dnd;h.drag_target&&b(document).delegate(h.drag_target,"mousedown.jstree",b.proxy(function(j){a=j.target;b.vakata.dnd.drag_start(j,{jstree:true,obj:j.target},"<ins class='jstree-icon'></ins>"+b(j.target).text());if(this.data.themes){e.attr("class","jstree-"+this.data.themes.theme);b.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}b.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
j=this.get_container();this.data.dnd.cof=j.offset();this.data.dnd.cw=parseInt(j.width(),10);this.data.dnd.ch=parseInt(j.height(),10);this.data.dnd.foreign=true;return false},this));h.drop_target&&b(document).delegate(h.drop_target,"mouseenter.jstree",b.proxy(function(j){this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:a,r:b(j.target)})&&b.vakata.dnd.helper.children("ins").attr("class","jstree-ok")},this)).delegate(h.drop_target,"mouseleave.jstree",b.proxy(function(){this.data.dnd.active&&
b.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")},this)).delegate(h.drop_target,"mouseup.jstree",b.proxy(function(j){this.data.dnd.active&&b.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&this._get_settings().dnd.drop_finish.call(this,{o:a,r:b(j.target)})},this))},defaults:{copy_modifier:"ctrl",check_timeout:200,open_timeout:500,drop_target:".jstree-drop",drop_check:function(){return true},drop_finish:b.noop,drag_target:".jstree-draggable",drag_finish:b.noop,drag_check:function(){return{after:false,
before:false,inside:true}}},_fn:{dnd_prepare:function(){if(c&&c.length){this.data.dnd.off=c.offset();if(this._get_settings().core.rtl)this.data.dnd.off.right=this.data.dnd.off.left+c.width();if(this.data.dnd.foreign){var h=this._get_settings().dnd.drag_check.call(this,{o:a,r:c});this.data.dnd.after=h.after;this.data.dnd.before=h.before;this.data.dnd.inside=h.inside;this.data.dnd.prepared=true;return this.dnd_show()}this.prepare_move(a,c,"before");this.data.dnd.before=this.check_move();this.prepare_move(a,
c,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(c)){this.prepare_move(a,c,"inside");this.data.dnd.inside=this.check_move()}else this.data.dnd.inside=false;this.data.dnd.prepared=true;return this.dnd_show()}},dnd_show:function(){if(this.data.dnd.prepared){var h=["before","inside","after"],j=false,l=this._get_settings().core.rtl;h=this.data.dnd.w<this.data.core.li_height/3?["before","inside","after"]:this.data.dnd.w<=this.data.core.li_height*2/3?this.data.dnd.w<this.data.core.li_height/
2?["inside","before","after"]:["inside","after","before"]:["after","inside","before"];b.each(h,b.proxy(function(k,m){if(this.data.dnd[m]){b.vakata.dnd.helper.children("ins").attr("class","jstree-ok");j=m;return false}},this));j===false&&b.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");h=l?this.data.dnd.off.right-18:this.data.dnd.off.left+10;switch(j){case "before":e.css({left:h+"px",top:this.data.dnd.off.top-6+"px"}).show();break;case "after":e.css({left:h+"px",top:this.data.dnd.off.top+
this.data.core.li_height-7+"px"}).show();break;case "inside":e.css({left:h+(l?-4:4)+"px",top:this.data.dnd.off.top+this.data.core.li_height/2-5+"px"}).show();break;default:e.hide();break}return j}},dnd_open:function(){this.data.dnd.to2=false;this.open_node(c,b.proxy(this.dnd_prepare,this),true)},dnd_finish:function(h){if(this.data.dnd.foreign){if(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside)this._get_settings().dnd.drag_finish.call(this,{o:a,r:c})}else{this.dnd_prepare();this.move_node(a,
c,this.dnd_show(),h[this._get_settings().dnd.copy_modifier+"Key"])}c=a=false;e.hide()},dnd_enter:function(h){var j=this._get_settings().dnd;this.data.dnd.prepared=false;c=this._get_node(h);if(j.check_timeout){this.data.dnd.to1&&clearTimeout(this.data.dnd.to1);this.data.dnd.to1=setTimeout(b.proxy(this.dnd_prepare,this),j.check_timeout)}else this.dnd_prepare();if(j.open_timeout){this.data.dnd.to2&&clearTimeout(this.data.dnd.to2);if(c&&c.length&&c.hasClass("jstree-closed"))this.data.dnd.to2=setTimeout(b.proxy(this.dnd_open,
this),j.open_timeout)}else c&&c.length&&c.hasClass("jstree-closed")&&this.dnd_open()},start_drag:function(h,j){a=this._get_node(h);if(this.data.ui&&this.is_selected(a))a=this._get_node(null,true);b.vakata.dnd.drag_start(j,{jstree:true,obj:a},"<ins class='jstree-icon'></ins>"+(a.length>1?"Multiple selection":this.get_text(a)));if(this.data.themes){e.attr("class","jstree-"+this.data.themes.theme);b.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}var l=this.get_container();
this.data.dnd.cof=l.children("ul").offset();this.data.dnd.cw=parseInt(l.width(),10);this.data.dnd.ch=parseInt(l.height(),10);this.data.dnd.active=true}}});b(function(){b.vakata.css.add_sheet({str:"#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; line-height:12px; font-size:1px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:silver; } "});
e=b("<div>").attr({id:"jstree-marker"}).hide().appendTo("body");b(document).bind("drag_start.vakata",function(h,j){j.data.jstree&&e.show()});b(document).bind("drag_stop.vakata",function(h,j){j.data.jstree&&e.hide()})})})(jQuery);
(function(b){b.jstree.plugin("checkbox",{__init:function(){this.select_node=this.deselect_node=this.deselect_all=b.noop;this.get_selected=this.get_checked;this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree",b.proxy(function(a,c){this._prepare_checkboxes(c.rslt.obj)},this)).bind("loaded.jstree",b.proxy(function(){this._prepare_checkboxes()},this)).delegate("a","click.jstree",b.proxy(function(a){this._get_node(a.target).hasClass("jstree-checked")?this.uncheck_node(a.target):
this.check_node(a.target);this.data.ui&&this.save_selected();this.data.cookies&&this.save_cookie("select_node");a.preventDefault()},this))},__destroy:function(){this.get_container().find(".jstree-checkbox").remove()},_fn:{_prepare_checkboxes:function(a){a=!a||a==-1?this.get_container():this._get_node(a);var c,e=this,f;a.each(function(){f=b(this);c=f.is("li")&&f.hasClass("jstree-checked")?"jstree-checked":"jstree-unchecked";f.find("a").not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(c)});
a.is("li")?this._repair_state(a):a.find("> ul > li").each(function(){e._repair_state(this)})},change_state:function(a,c){a=this._get_node(a);if(c=c===false||c===true?c:a.hasClass("jstree-checked"))a.find("li").andSelf().removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");else{a.find("li").andSelf().removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(this.data.ui)this.data.ui.last_selected=a;this.data.checkbox.last_selected=a}a.parentsUntil(".jstree",
"li").each(function(){var e=b(this);if(c)if(e.children("ul").children(".jstree-checked, .jstree-undetermined").length){e.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");return false}else e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");else if(e.children("ul").children(".jstree-unchecked, .jstree-undetermined").length){e.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
return false}else e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked")});if(this.data.ui)this.data.ui.selected=this.get_checked();this.__callback(a)},check_node:function(a){this.change_state(a,false)},uncheck_node:function(a){this.change_state(a,true)},check_all:function(){var a=this;this.get_container().children("ul").children("li").each(function(){a.check_node(this,false)})},uncheck_all:function(){var a=this;this.get_container().children("ul").children("li").each(function(){a.change_state(this,
true)})},is_checked:function(a){a=this._get_node(a);return a.length?a.is(".jstree-checked"):false},get_checked:function(a){a=!a||a===-1?this.get_container():this._get_node(a);return a.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(a){a=!a||a===-1?this.get_container():this._get_node(a);return a.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},
hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(a){a=this._get_node(a);if(a.length){var c=a.find("> ul > .jstree-checked").length,e=a.find("> ul > .jstree-undetermined").length,f=a.find("> ul > li").length;if(f===0)a.hasClass("jstree-undetermined")&&this.check_node(a);else if(c===0&&e===0)this.uncheck_node(a);else c===f?this.check_node(a):a.parentsUntil(".jstree","li").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined")}},
reselect:function(){if(this.data.ui){var a=this,c=this.data.ui.to_select;c=b.map(b.makeArray(c),function(e){return"#"+e.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/")});this.deselect_all();b.each(c,function(e,f){a.check_node(f)});this.__callback()}}}})})(jQuery);
(function(b){b.vakata.xslt=function(c,e,f){var i="",d;if(document.recalc){d=document.createElement("xml");i=document.createElement("xml");d.innerHTML=c;i.innerHTML=e;b("body").append(d).append(i);setTimeout(function(g,h,j){return function(){j.call(null,g.transformNode(h.XMLDocument));setTimeout(function(l,k){return function(){jQuery("body").remove(l).remove(k)}}(g,h),200)}}(d,i,f),100);return true}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!==
"undefined"){d=new XSLTProcessor;i=b.isFunction(d.transformDocument)?typeof window.XMLSerializer!=="undefined":true;if(!i)return false;c=(new DOMParser).parseFromString(c,"text/xml");e=(new DOMParser).parseFromString(e,"text/xml");if(b.isFunction(d.transformDocument)){i=document.implementation.createDocument("","",null);d.transformDocument(c,e,i,null);f.call(null,XMLSerializer().serializeToString(i))}else{d.importStylesheet(e);i=d.transformToFragment(c,document);f.call(null,b("<div>").append(i).html())}return true}return false};
var a={nest:'<?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="/">\t<xsl:call-template name="nodes">\t\t<xsl:with-param name="node" select="/root" />\t</xsl:call-template></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<ul>\t<xsl:for-each select="$node/item">\t\t<xsl:variable name="children" select="count(./item) &gt; 0" />\t\t<li>\t\t\t<xsl:attribute name="class">\t\t\t\t<xsl:if test="position() = last()">jstree-last </xsl:if>\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t\t\t</xsl:choose>\t\t\t\t<xsl:value-of select="@class" />\t\t\t</xsl:attribute>\t\t\t<xsl:for-each select="@*">\t\t\t\t<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t</xsl:if>\t\t\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>\t\t\t<xsl:for-each select="content/name">\t\t\t\t<a>\t\t\t\t<xsl:attribute name="href">\t\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t\t\t</xsl:choose>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t\t\t<xsl:for-each select="@*">\t\t\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t\t</xsl:if>\t\t\t\t</xsl:for-each>\t\t\t\t\t<ins>\t\t\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t\t\t</xsl:attribute>\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t\t\t<xsl:text>&#xa0;</xsl:text>\t\t\t\t\t</ins>\t\t\t\t\t<xsl:value-of select="current()" />\t\t\t\t</a>\t\t\t</xsl:for-each>\t\t\t<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>\t\t</li>\t</xsl:for-each>\t</ul></xsl:template></xsl:stylesheet>',
flat:'<?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/xml" /><xsl:template match="/">\t<ul>\t<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">\t\t<xsl:call-template name="nodes">\t\t\t<xsl:with-param name="node" select="." />\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t</xsl:call-template>\t</xsl:for-each>\t</ul></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<xsl:param name="is_last" />\t<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />\t<li>\t<xsl:attribute name="class">\t\t<xsl:if test="$is_last = true()">jstree-last </xsl:if>\t\t<xsl:choose>\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t</xsl:choose>\t\t<xsl:value-of select="@class" />\t</xsl:attribute>\t<xsl:for-each select="@*">\t\t<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t</xsl:if>\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>\t<xsl:for-each select="content/name">\t\t<a>\t\t<xsl:attribute name="href">\t\t\t<xsl:choose>\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t</xsl:choose>\t\t</xsl:attribute>\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t<xsl:for-each select="@*">\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t</xsl:if>\t\t</xsl:for-each>\t\t\t<ins>\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t<xsl:text>&#xa0;</xsl:text>\t\t\t</ins>\t\t\t<xsl:value-of select="current()" />\t\t</a>\t</xsl:for-each>\t<xsl:if test="$children">\t\t<ul>\t\t<xsl:for-each select="//item[@parent_id=$node/attribute::id]">\t\t\t<xsl:call-template name="nodes">\t\t\t\t<xsl:with-param name="node" select="." />\t\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t\t</xsl:call-template>\t\t</xsl:for-each>\t\t</ul>\t</xsl:if>\t</li></xsl:template></xsl:stylesheet>'};
b.jstree.plugin("xml_data",{defaults:{data:false,ajax:false,xsl:"flat",clean_node:false,correct_state:true},_fn:{load_node:function(c,e,f){var i=this;this.load_node_xml(c,function(){i.__callback({obj:c});e.call(this)},f)},_is_loaded:function(c){var e=this._get_settings().xml_data;c=this._get_node(c);return c==-1||!c||!e.ajax||c.is(".jstree-open, .jstree-leaf")||c.children("ul").children("li").size()>0},load_node_xml:function(c,e,f){var i=this.get_settings().xml_data,d=function(){},g=function(){};
if((c=this._get_node(c))&&c!==-1)if(c.data("jstree-is-loading"))return;else c.data("jstree-is-loading",true);switch(true){case !i.data&&!i.ajax:throw"Neither data nor ajax settings supplied.";case !!i.data&&!i.ajax||!!i.data&&!!i.ajax&&(!c||c===-1):if(!c||c==-1)this.parse_xml(i.data,b.proxy(function(h){if(h){h=h.replace(/ ?xmlns="[^"]*"/ig,"");if(h.length>10){h=b(h);this.get_container().children("ul").empty().append(h.children());i.clean_node&&this.clean_node(c);e&&e.call(this)}}else if(i.correct_state){this.get_container().children("ul").empty();
e&&e.call(this)}},this));break;case !i.data&&!!i.ajax||!!i.data&&!!i.ajax&&c&&c!==-1:d=function(h,j,l){var k=this.get_settings().xml_data.ajax.error;k&&k.call(this,h,j,l);if(c!==-1&&c.length){c.children(".jstree-loading").removeClass("jstree-loading");c.data("jstree-is-loading",false);j==="success"&&i.correct_state&&c.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}else j==="success"&&i.correct_state&&this.get_container().children("ul").empty();f&&f.call(this)};g=function(h,j,l){h=
l.responseText;var k=this.get_settings().xml_data.ajax.success;if(k)h=k.call(this,h,j,l)||h;if(h=="")return d.call(this,l,j,"");this.parse_xml(h,b.proxy(function(m){if(m){m=m.replace(/ ?xmlns="[^"]*"/ig,"");if(m.length>10){m=b(m);if(c===-1||!c)this.get_container().children("ul").empty().append(m.children());else{c.children(".jstree-loading").removeClass("jstree-loading");c.append(m);c.data("jstree-is-loading",false)}i.clean_node&&this.clean_node(c);e&&e.call(this)}else if(c&&c!==-1){c.children(".jstree-loading").removeClass("jstree-loading");
c.data("jstree-is-loading",false);if(i.correct_state){c.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");e&&e.call(this)}}else if(i.correct_state){this.get_container().children("ul").empty();e&&e.call(this)}}},this))};i.ajax.context=this;i.ajax.error=d;i.ajax.success=g;if(!i.ajax.dataType)i.ajax.dataType="xml";if(b.isFunction(i.ajax.url))i.ajax.url=i.ajax.url.call(this,c);if(b.isFunction(i.ajax.data))i.ajax.data=i.ajax.data.call(this,c);b.ajax(i.ajax);break}},parse_xml:function(c,
e){var f=this._get_settings().xml_data;b.vakata.xslt(c,a[f.xsl],e)},get_xml:function(c,e,f,i,d){var g="",h=this._get_settings(),j=this,l,k,m,n,p;c||(c="flat");d||(d=0);e=this._get_node(e);if(!e||e===-1)e=this.get_container().find("> ul > li");f=b.isArray(f)?f:["id","class"];!d&&this.data.types&&b.inArray(h.types.type_attr,f)===-1&&f.push(h.types.type_attr);i=b.isArray(i)?i:[];d||(g+="<root>");e.each(function(){g+="<item";m=b(this);b.each(f,function(o,q){g+=" "+q+'="'+(m.attr(q)||"").replace(/jstree[^ ]*|$/ig,
"").replace(/^\s+$/ig,"")+'"'});if(m.hasClass("jstree-open"))g+=' state="open"';if(m.hasClass("jstree-closed"))g+=' state="closed"';if(c==="flat")g+=' parent_id="'+d+'"';g+=">";g+="<content>";n=m.children("a");n.each(function(){l=b(this);p=false;g+="<name";b.inArray("languages",h.plugins)!==-1&&b.each(h.languages,function(o,q){if(l.hasClass(q)){g+=' lang="'+q+'"';p=q;return false}});i.length&&b.each(i,function(o,q){g+=" "+q+'="'+(l.attr(q)||"").replace(/jstree[^ ]*|$/ig,"")+'"'});if(l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,
"").replace(/^\s+$/ig,"").length)g+=' icon="'+l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"")+'"';if(l.children("ins").get(0).style.backgroundImage.length)g+=' icon="'+l.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")+'"';g+=">";g+="<![CDATA["+j.get_text(l,p)+"]]\>";g+="</name>"});g+="</content>";k=m[0].id;m=m.find("> ul > li");k=m.length?j.get_xml(c,m,f,i,k):"";if(c=="nest")g+=k;g+="</item>";if(c=="flat")g+=k});d||(g+="</root>");
return g}}})})(jQuery);
(function(b){b.expr[":"].jstree_contains=function(a,c,e){return(a.textContent||a.innerText||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};b.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=b()},defaults:{ajax:false,case_insensitive:false},_fn:{search:function(a,c){if(a!==""){var e=this.get_settings().search,f=this,i=function(){},d=function(){};this.data.search.str=a;if(!c&&e.ajax!==false&&this.get_container().find(".jstree-closed:eq(0)").length>0){this.search.supress_callback=
true;i=function(){};d=function(g,h,j){var l=this.get_settings().search.ajax.success;if(l)g=l.call(this,g,h,j)||g;this.data.search.to_open=g;this._search_open()};e.ajax.context=this;e.ajax.error=i;e.ajax.success=d;if(b.isFunction(e.ajax.url))e.ajax.url=e.ajax.url.call(this,a);if(b.isFunction(e.ajax.data))e.ajax.data=e.ajax.data.call(this,a);if(!e.ajax.data)e.ajax.data={search_string:a};if(!e.ajax.dataType||/^json/.exec(e.ajax.dataType))e.ajax.dataType="json";b.ajax(e.ajax)}else{this.data.search.result.length&&
this.clear_search();this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+(e.case_insensitive?"jstree_contains":"contains")+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parents(".jstree-closed").each(function(){f.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:a})}}},clear_search:function(){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);
this.data.search.result=b()},_search_open:function(){var a=this,c=true,e=[],f=[];if(this.data.search.to_open.length){b.each(this.data.search.to_open,function(i,d){if(d=="#")return true;b(d).length&&b(d).is(".jstree-closed")?e.push(d):f.push(d)});if(e.length){this.data.search.to_open=f;b.each(e,function(i,d){a.open_node(d,function(){a._search_open(true)})});c=false}}c&&this.search(this.data.search.str,true)}}})})(jQuery);
(function(b){b.vakata.context={cnt:b("<div id='vakata-contextmenu'>"),vis:false,tgt:false,par:false,func:false,data:false,show:function(a,c,e,f,i,d){if(a=b.vakata.context.parse(a)){b.vakata.context.vis=true;b.vakata.context.tgt=c;b.vakata.context.par=d||c||null;b.vakata.context.data=i||null;b.vakata.context.cnt.html(a).css({visibility:"hidden",display:"block",left:0,top:0});i=b.vakata.context.cnt.height();d=b.vakata.context.cnt.width();if(e+d>b(document).width()){e=b(document).width()-(d+5);b.vakata.context.cnt.find("li > ul").addClass("right")}if(f+
i>b(document).height()){f-=i+c[0].offsetHeight;b.vakata.context.cnt.find("li > ul").addClass("bottom")}b.vakata.context.cnt.css({left:e,top:f}).find("li:has(ul)").bind("mouseenter",function(){var g=b(document).width(),h=b(document).height(),j=b(this).children("ul").show();g!==b(document).width()&&j.toggleClass("right");h!==b(document).height()&&j.toggleClass("bottom")}).bind("mouseleave",function(){b(this).children("ul").hide()}).end().css({visibility:"visible"}).show();b(document).triggerHandler("context_show.vakata")}},
hide:function(){b.vakata.context.vis=false;b.vakata.context.cnt.attr("class","").hide();b(document).triggerHandler("context_hide.vakata")},parse:function(a,c){if(!a)return false;var e="",f=false,i=true;if(!c)b.vakata.context.func={};e+="<ul>";b.each(a,function(d,g){if(!g)return true;b.vakata.context.func[d]=g.action;if(!i&&g.separator_before)e+="<li class='vakata-separator vakata-separator-before'></li>";i=false;e+="<li class='"+(g._class||"")+(g._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";
if(g.icon&&g.icon.indexOf("/")===-1)e+=" class='"+g.icon+"' ";if(g.icon&&g.icon.indexOf("/")!==-1)e+=" style='background:url("+g.icon+") center center no-repeat;' ";e+=">&#160;</ins><a href='#' rel='"+d+"'>";if(g.submenu)e+="<span style='float:right;'>&raquo;</span>";e+=g.label+"</a>";if(g.submenu)if(f=b.vakata.context.parse(g.submenu,true))e+=f;e+="</li>";if(g.separator_after){e+="<li class='vakata-separator vakata-separator-after'></li>";i=true}});e=e.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,
"");e+="</ul>";return e.length>10?e:false},exec:function(a){if(b.isFunction(b.vakata.context.func[a])){b.vakata.context.func[a].call(b.vakata.context.data,b.vakata.context.par);return true}else return false}};b(function(){b.vakata.css.add_sheet({str:"#vakata-contextmenu { display:none; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } "});
b.vakata.context.cnt.delegate("a","click",function(a){a.preventDefault()}).delegate("a","mouseup",function(){!b(this).parent().hasClass("jstree-contextmenu-disabled")&&b.vakata.context.exec(b(this).attr("rel"))?b.vakata.context.hide():b(this).blur()}).delegate("a","mouseover",function(){b.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");b(document).bind("mousedown",function(a){b.vakata.context.vis&&!b.contains(b.vakata.context.cnt[0],a.target)&&b.vakata.context.hide()});
typeof b.hotkeys!=="undefined"&&b(document).bind("keydown","up",function(a){if(b.vakata.context.vis){var c=b.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();c.length||(c=b.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last());c.addClass("vakata-hover");a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","down",function(a){if(b.vakata.context.vis){var c=
b.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();c.length||(c=b.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first());c.addClass("vakata-hover");a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","right",function(a){if(b.vakata.context.vis){b.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","left",function(a){if(b.vakata.context.vis){b.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","esc",function(a){b.vakata.context.hide();a.preventDefault()}).bind("keydown","space",function(a){b.vakata.context.cnt.find(".vakata-hover").last().children("a").click();a.preventDefault()})});b.jstree.plugin("contextmenu",
{__init:function(){this.get_container().delegate("a","contextmenu.jstree",b.proxy(function(a){a.preventDefault();this.show_contextmenu(a.currentTarget,a.pageX,a.pageY)},this)).bind("destroy.jstree",b.proxy(function(){this.data.contextmenu&&b.vakata.context.hide()},this));b(document).bind("context_hide.vakata",b.proxy(function(){this.data.contextmenu=false},this))},defaults:{select_node:false,show_at_node:true,items:{create:{separator_before:false,separator_after:true,label:"Create",action:function(a){this.create(a)}},
rename:{separator_before:false,separator_after:false,label:"Rename",action:function(a){this.rename(a)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(a){this.remove(a)}},ccp:{separator_before:true,icon:false,separator_after:false,label:"Edit",action:false,submenu:{cut:{separator_before:false,separator_after:false,label:"Cut",action:function(a){this.cut(a)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(a){this.copy(a)}},
paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(a){this.paste(a)}}}}}},_fn:{show_contextmenu:function(a,c,e){a=this._get_node(a);var f=this.get_settings().contextmenu,i=a.children("a:visible:eq(0)"),d=false;if(f.select_node&&this.data.ui&&!this.is_selected(a)){this.deselect_all();this.select_node(a,true)}if(f.show_at_node||typeof c==="undefined"||typeof e==="undefined"){d=i.offset();c=d.left;e=d.top+this.data.core.li_height}if(b.isFunction(f.items))f.items=
f.items.call(this,a);this.data.contextmenu=true;b.vakata.context.show(f.items,i,c,e,this,a);this.data.themes&&b.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}})})(jQuery);
(function(b){b.jstree.plugin("types",{__init:function(){var a=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",b.proxy(function(){var c=a.type_attr,e="",f=this;b.each(a.types,function(i,d){b.each(d,function(g){/^(max_depth|max_children|icon|valid_children)$/.test(g)||f.data.types.attach_to.push(g)});if(!d.icon)return true;if(d.icon.image||d.icon.position){e+=i=="default"?".jstree-"+f.get_index()+" a > .jstree-icon { ":".jstree-"+f.get_index()+" li["+
c+"="+i+"] > a > .jstree-icon { ";if(d.icon.image)e+=" background-image:url("+d.icon.image+"); ";e+=d.icon.position?" background-position:"+d.icon.position+"; ":" background-position:0 0; ";e+="} "}});e!=""&&b.vakata.css.add_sheet({str:e})},this)).bind("before.jstree",b.proxy(function(c,e){if(b.inArray(e.func,this.data.types.attach_to)!==-1){var f=this._get_settings().types.types,i=this._get_type(e.args[0]);if((f[i]&&typeof f[i][e.func]!=="undefined"||f["default"]&&typeof f["default"][e.func]!=="undefined")&&
!this._check(e.func,e.args[0])){c.stopImmediatePropagation();return false}}},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_get_type:function(a){a=this._get_node(a);return!a||!a.length?false:a.attr(this._get_settings().types.type_attr)||"default"},set_type:function(a,c){c=this._get_node(c);return!c.length||!a?false:c.attr(this._get_settings().types.type_attr,a)},_check:function(a,c,e){var f=
false,i=this._get_type(c),d=0,g=this,h=this._get_settings().types;if(c===-1)if(h[a])f=h[a];else return;else{if(i===false)return;if(h.types[i]&&h.types[i][a])f=h.types[i][a];else if(h.types["default"]&&h.types["default"][a])f=h.types["default"][a]}if(b.isFunction(f))f=f.call(this,c);a==="max_depth"&&c!==-1&&e!==false&&h.max_depth!==-2&&f!==0&&this._get_node(c).children("a:eq(0)").parentsUntil(".jstree","li").each(function(j){if(h.max_depth!==-1&&h.max_depth-(j+1)<=0){f=0;return false}d=j===0?f:g._check(a,
this,false);if(d!==-1&&d-(j+1)<=0){f=0;return false}if(d>=0&&(d-(j+1)<f||f<0))f=d-(j+1);if(h.max_depth>=0&&(h.max_depth-(j+1)<f||f<0))f=h.max_depth-(j+1)});return f},check_move:function(){if(!this.__call_old())return false;var a=this._get_move(),c=a.rt._get_settings().types,e=a.rt._check("max_children",a.cr),f=a.rt._check("max_depth",a.cr),i=a.rt._check("valid_children",a.cr),d=0,g=1;if(i==="none")return false;if(b.isArray(i)&&a.ot&&a.ot._get_type){a.o.each(function(){if(b.inArray(a.ot._get_type(this),
i)===-1)return g=false});if(g===false)return false}if(c.max_children!==-2&&e!==-1){d=a.cr===-1?this.get_container().children("> ul > li").not(a.o).length:a.cr.children("> ul > li").not(a.o).length;if(d+a.o.length>e)return false}if(c.max_depth!==-2&&f!==-1){g=0;if(f===0)return false;if(typeof a.o.d==="undefined"){for(c=a.o;c.length>0;){c=c.find("> ul > li");g++}a.o.d=g}if(f-a.o.d<0)return false}return true},create_node:function(a,c,e,f,i,d){if(!d&&(i||this._is_loaded(a))){var g=c&&c.match(/^before|after$/i)&&
a!==-1?this._get_parent(a):this._get_node(a),h=this._get_settings().types,j=this._check("max_children",g),l=this._check("max_depth",g),k=this._check("valid_children",g);e||(e={});if(k==="none")return false;if(b.isArray(k))if(!e.attr||!e.attr[h.type_attr]){if(!e.attr)e.attr={};e.attr[h.type_attr]=k[0]}else if(b.inArray(e.attr[h.type_attr],k)===-1)return false;if(h.max_children!==-2&&j!==-1){g=g===-1?this.get_container().children("> ul > li").length:g.children("> ul > li").length;if(g+1>j)return false}if(h.max_depth!==
-2&&l!==-1&&l-1<0)return false}return this.__call_old(true,a,c,e,f,i,d)}}})})(jQuery);
(function(b){b.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(true);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:false,ajax:false,correct_state:true},_fn:{load_node:function(a,c,e){var f=this;this.load_node_html(a,function(){f.__callback({obj:a});c.call(this)},e)},_is_loaded:function(a){a=this._get_node(a);return a==
-1||!a||!this._get_settings().html_data.ajax||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").size()>0},load_node_html:function(a,c,e){var f,i=this.get_settings().html_data,d=function(){};f=function(){};if((a=this._get_node(a))&&a!==-1)if(a.data("jstree-is-loading"))return;else a.data("jstree-is-loading",true);switch(true){case !i.data&&!i.ajax:if(!a||a==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return this.firstChild.tagName!==
"INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}c&&c.call(this);break;case !!i.data&&!i.ajax||!!i.data&&!!i.ajax&&(!a||a===-1):if(!a||a==-1){f=b(i.data);f.is("ul")||(f=b("<ul>").append(f));this.get_container().children("ul").empty().append(f.children()).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
this.clean_node()}c&&c.call(this);break;case !i.data&&!!i.ajax||!!i.data&&!!i.ajax&&a&&a!==-1:a=this._get_node(a);d=function(g,h,j){var l=this.get_settings().html_data.ajax.error;l&&l.call(this,g,h,j);if(a!=-1&&a.length){a.children(".jstree-loading").removeClass("jstree-loading");a.data("jstree-is-loading",false);h==="success"&&i.correct_state&&a.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}else h==="success"&&i.correct_state&&this.get_container().children("ul").empty();e&&e.call(this)};
f=function(g,h,j){var l=this.get_settings().html_data.ajax.success;if(l)g=l.call(this,g,h,j)||g;if(g=="")return d.call(this,j,h,"");if(g){g=b(g);g.is("ul")||(g=b("<ul>").append(g));if(a==-1||!a)this.get_container().children("ul").empty().append(g.children()).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");else{a.children(".jstree-loading").removeClass("jstree-loading");
a.append(g).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");a.data("jstree-is-loading",false)}this.clean_node(a);c&&c.call(this)}else if(a&&a!==-1){a.children(".jstree-loading").removeClass("jstree-loading");a.data("jstree-is-loading",false);if(i.correct_state){a.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");c&&c.call(this)}}else if(i.correct_state){this.get_container().children("ul").empty();
c&&c.call(this)}};i.ajax.context=this;i.ajax.error=d;i.ajax.success=f;if(!i.ajax.dataType)i.ajax.dataType="html";if(b.isFunction(i.ajax.url))i.ajax.url=i.ajax.url.call(this,a);if(b.isFunction(i.ajax.data))i.ajax.data=i.ajax.data.call(this,a);b.ajax(i.ajax);break}}}});b.jstree.defaults.plugins.push("html_data")})(jQuery);
(function(b){b.jstree.plugin("themeroller",{__init:function(){var a=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").delegate("a","mouseenter.jstree",function(){b(this).addClass(a.item_h)}).delegate("a","mouseleave.jstree",function(){b(this).removeClass(a.item_h)}).bind("open_node.jstree create_node.jstree",b.proxy(function(c,e){this._themeroller(e.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",b.proxy(function(){this._themeroller()},this)).bind("close_node.jstree",
b.proxy(function(c,e){e.rslt.obj.children("ins").removeClass(a.opened).addClass(a.closed)},this)).bind("select_node.jstree",b.proxy(function(c,e){e.rslt.obj.children("a").addClass(a.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",b.proxy(function(){this.get_container().find("."+a.item_a).removeClass(a.item_a).end().find(".jstree-clicked").addClass(a.item_a)},this)).bind("move_node.jstree",b.proxy(function(c,e){this._themeroller(e.rslt.o)},this))},__destroy:function(){var a=this._get_settings().themeroller,
c=["ui-icon"];b.each(a,function(e,f){f=f.split(" ");if(f.length)c=c.concat(f)});this.get_container().removeClass("ui-widget-content").find("."+c.join(", .")).removeClass(c.join(" "))},_fn:{_themeroller:function(a){var c=this._get_settings().themeroller;a=!a||a==-1?this.get_container():this._get_node(a).parent();a.find("li.jstree-closed > ins.jstree-icon").removeClass(c.opened).addClass("ui-icon "+c.closed).end().find("li.jstree-open > ins.jstree-icon").removeClass(c.closed).addClass("ui-icon "+c.opened).end().find("a").addClass(c.item).children("ins.jstree-icon").addClass("ui-icon "+
c.item_icon)}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_icon:"ui-icon-folder-collapsed"}});b(function(){b.vakata.css.add_sheet({str:".jstree .ui-icon { overflow:visible; } .jstree a { padding:0 2px; }"})})})(jQuery);
(function(b){b.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",b.proxy(function(a,c){var e=[],f=true,i;if(c.func=="move_node")if(c.args[4]===true)if(c.args[0].o&&c.args[0].o.length){c.args[0].o.children("a").each(function(){e.push(b(this).text().replace(/^\s+/g,""))});f=this._check_unique(e,c.args[0].np.find("> ul > li").not(c.args[0].o))}if(c.func=="create_node")if(c.args[4]||this._is_loaded(c.args[0])){f=this._get_node(c.args[0]);if(c.args[1]&&(c.args[1]==="before"||
c.args[1]==="after")){f=this._get_parent(c.args[0]);if(!f||f===-1)f=this.get_container()}if(typeof c.args[2]==="string")e.push(c.args[2]);else!c.args[2]||!c.args[2].data?e.push(this._get_settings().core.strings.new_node):e.push(c.args[2].data);f=this._check_unique(e,f.find("> ul > li"))}if(c.func=="rename_node"){e.push(c.args[1]);i=this._get_node(c.args[0]);f=this._get_parent(i);if(!f||f===-1)f=this.get_container();f=this._check_unique(e,f.find("> ul > li").not(i))}if(!f){a.stopPropagation();return false}},
this))},_fn:{_check_unique:function(a,c){var e=[];c.children("a").each(function(){e.push(b(this).text().replace(/^\s+/g,""))});if(!e.length||!a.length)return true;e=e.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");if(e.length+a.length!=e.concat(a).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length)return false;return true},check_move:function(){if(!this.__call_old())return false;
var a=this._get_move(),c=[];if(a.o&&a.o.length){a.o.children("a").each(function(){c.push(b(this).text().replace(/^\s+/g,""))});return this._check_unique(c,a.np.find("> ul > li").not(a.o))}return true}}})})(jQuery);(function(b){var a={},c={};b.manageAjax=function(){return{create:function(e,f){a[e]=new b.manageAjax._manager(e,f);return a[e]},destroy:function(e){if(a[e]){a[e].clear(true);delete a[e]}}}}();b.manageAjax._manager=function(e,f){this.requests={};this.inProgress=0;this.qName=this.name=e;this.opts=b.extend({},b.ajaxSettings,b.manageAjax.defaults,f);if(f&&f.queue&&f.queue!==true&&typeof f.queue==="string"&&f.queue!=="clear")this.qName=f.queue};b.manageAjax._manager.prototype={add:function(e){e=b.extend({},
this.opts,e);var f=e.complete||b.noop,i=e.success||b.noop,d=e.beforeSend||b.noop,g=e.error||b.noop,h=typeof e.data=="string"?e.data:b.param(e.data||{}),j=e.type+e.url+h,l=this,k=this._createAjax(j,e,i,f);if(e.preventDoubbleRequests&&e.queueDuplicateRequests){if(e.preventDoubbleRequests)e.queueDuplicateRequests=false;setTimeout(function(){throw"preventDoubbleRequests and queueDuplicateRequests can't be both true";},0)}if(!(this.requests[j]&&e.preventDoubbleRequests)){k.xhrID=j;e.xhrID=j;e.beforeSend=
function(m,n){var p=d.call(this,m,n);p===false&&l._removeXHR(j);return p};e.complete=function(m,n){l._complete.call(l,this,f,m,n,j,e)};e.success=function(m,n,p){l._success.call(l,this,i,m,n,p,e)};e.error=function(m,n,p){var o="",q="";if(n!=="timeout"&&m){o=m.status;q=m.responseXML||m.responseText}g?g.call(this,m,n,p,e):setTimeout(function(){throw n+"| status: "+o+" | URL: "+e.url+" | data: "+h+" | thrown: "+p+" | response: "+q;},0);m=null};e.queue==="clear"&&b(document).clearQueue(this.qName);if(e.queue||
e.queueDuplicateRequests&&this.requests[j]){b.queue(document,this.qName,k);if(this.inProgress<e.maxRequests&&(!this.requests[j]||!e.queueDuplicateRequests))b.dequeue(document,this.qName);return j}return k()}},_createAjax:function(e,f,i,d){var g=this;return function(){if(f.beforeCreate.call(f.context||g,e,f)!==false){g.inProgress++;g.inProgress===1&&b.event.trigger(g.name+"AjaxStart");if(f.cacheResponse&&c[e])if(!c[e].cacheTTL||c[e].cacheTTL<0||(new Date).getTime()-c[e].timestamp<c[e].cacheTTL){g.requests[e]=
{};setTimeout(function(){g._complete.call(g,f.context||f,d,c[e],"success",e,f);g._success.call(g,f.context||f,i,c[e]._successData,"success",c[e],f)},0)}else delete c[e];if(!f.cacheResponse||!c[e])if(f.async)g.requests[e]=b.ajax(f);else b.ajax(f);return e}}},_removeXHR:function(e){if(this.opts.queue||this.opts.queueDuplicateRequests)b.dequeue(document,this.qName);this.inProgress--;this.requests[e]=null;delete this.requests[e]},clearCache:function(){c={}},_isAbort:function(e,f,i){if(!i.abortIsNoSuccess||
!e&&!f)return false;return!!(!e||e.readyState===0||this.lastAbort===i.xhrID)},_complete:function(e,f,i,d,g,h){if(this._isAbort(i,d,h)){d="abort";h.abort.call(e,i,d,h)}f.call(e,i,d,h);b.event.trigger(this.name+"AjaxComplete",[i,d,h]);h.domCompleteTrigger&&b(h.domCompleteTrigger).trigger(this.name+"DOMComplete",[i,d,h]).trigger("DOMComplete",[i,d,h]);this._removeXHR(g);this.inProgress||b.event.trigger(this.name+"AjaxStop")},_success:function(e,f,i,d,g,h){var j=this;if(!this._isAbort(g,d,h)){h.abortOld&&
b.each(this.requests,function(n){if(n===h.xhrID)return false;j.abort(n)});if(h.cacheResponse&&!c[h.xhrID]){c[h.xhrID]={status:g.status,statusText:g.statusText,responseText:g.responseText,responseXML:g.responseXML,_successData:i,cacheTTL:h.cacheTTL,timestamp:(new Date).getTime()};if("getAllResponseHeaders"in g){var l=g.getAllResponseHeaders(),k,m=function(){if(!k){k={};b.each(l.split("\n"),function(n,p){var o=p.indexOf(":");k[p.substr(0,o)]=p.substr(o+2)})}};b.extend(c[h.xhrID],{getAllResponseHeaders:function(){return l},
getResponseHeader:function(n){m();return n in k?k[n]:null}})}}f.call(e,i,d,g,h);b.event.trigger(this.name+"AjaxSuccess",[g,h,i]);h.domSuccessTrigger&&b(h.domSuccessTrigger).trigger(this.name+"DOMSuccess",[i,h]).trigger("DOMSuccess",[i,h])}g=null},getData:function(e){if(e){var f=this.requests[e];if(!f&&this.opts.queue)f=b.grep(b(document).queue(this.qName),function(i){return i.xhrID===e})[0];return f}return{requests:this.requests,queue:this.opts.queue?b(document).queue(this.qName):[],inProgress:this.inProgress}},
abort:function(e){var f;if(e){if((f=this.getData(e))&&f.abort){this.lastAbort=e;f.abort();this.lastAbort=false}else b(document).queue(this.qName,b.grep(b(document).queue(this.qName),function(g){return g!==f}));f=null}else{var i=this,d=[];b.each(this.requests,function(g){d.push(g)});b.each(d,function(g,h){i.abort(h)})}},clear:function(e){b(document).clearQueue(this.qName);e&&this.abort()}};b.manageAjax._manager.prototype.getXHR=b.manageAjax._manager.prototype.getData;b.manageAjax.defaults={beforeCreate:b.noop,
abort:b.noop,abortIsNoSuccess:true,maxRequests:1,cacheResponse:false,domCompleteTrigger:false,domSuccessTrigger:false,preventDoubbleRequests:true,queueDuplicateRequests:false,cacheTTL:-1,queue:false};b.each(b.manageAjax._manager.prototype,function(e,f){e.indexOf("_")===0||!b.isFunction(f)||(b.manageAjax[e]=function(i,d){if(!a[i])if(e==="add")b.manageAjax.create(i,d);else return;var g=Array.prototype.slice.call(arguments,1);a[i][e].apply(a[i],g)})})})(jQuery);(function(b){b.fn.autogrowFocus=function(a){this.filter("textarea").each(function(){var c=b(this),e=c.css("lineHeight");c.bind("focus",function(){c.autogrow(a)}).bind("blur",function(){c.css("height",e)})})};b.fn.autogrow=function(){this.filter("textarea").each(function(){var a=b(this),c=a.height();a.css("lineHeight");var e=b("<div></div>").css({position:"absolute",top:-10000,left:-10000,width:b(this).width()-parseInt(a.css("paddingLeft"))-parseInt(a.css("paddingRight")),fontSize:a.css("fontSize"),
fontFamily:a.css("fontFamily"),lineHeight:a.css("lineHeight"),resize:"none"}).appendTo(document.body);a=function(){var f=this.value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n$/,"<br/>&nbsp;").replace(/\n/g,"<br/>").replace(/ {2,}/g,function(i){for(var d=0,g="";d<i.length-1;d++)g+="&nbsp;";return g+" "});e.html(f);b(this).css("height",Math.max(e.height()+0,c))};b(this).change(a).keyup(a).keydown(a);a.apply(this)});return this}})(jQuery);$("html").bind("ajaxStart",function(){$(this).addClass("busy")}).bind("ajaxStop ajaxComplete ajaxError ajaxSuccess",function(){$(this).removeClass("busy")});$.datepicker.setDefaults({showOn:"button",buttonImage:"/images/silk/date.png",buttonImageOnly:true,buttonText:"Ouvrir le calendrier",showButtonPanel:true,changeMonth:true,changeYear:true,dateFormat:"dd/mm/yy",firstDay:1,showAnim:"slideDown",duration:"fast",showOtherMonths:true,yearRange:"-60:+10"});
Number.prototype.formatMoney=function(b,a,c){var e=this;b=isNaN(b=Math.abs(b))?2:b;a=a==undefined?",":a;c=c==undefined?".":c;var f=e<0?"-":"",i=parseInt(e=Math.abs(+e||0).toFixed(b))+"",d=(d=i.length)>3?d%3:0;return f+(d?i.substr(0,d)+c:"")+i.substr(d).replace(/(\d{3})(?=\d)/g,"$1"+c)+(b?a+Math.abs(e-i).toFixed(b).slice(2):"")};
$.Calculation.setDefaults({reNumbers:/(-?\$?)(\d+(\ \d{3})*([,\.]\d{1,})?|[,\.]\d{1,})?/g,cleanseNumber:function(b){return b.replace(/[^0-9,\.\-]/g,"").replace(/,/g,".")},cbFormat:function(b){return b.formatMoney(2,","," ")}});
(function(b){b.fn.hoverClass=function(a,c){return this.live("mouseover mouseout",function(e){if(e.type=="mouseover"){b(this).addClass(a);c&&b("."+b(this).attr("id")).addClass(a)}else{b(this).removeClass(a);c&&b("."+b(this).attr("id")).removeClass(a)}})};b.fn.selectToggle=function(a,c){var e=b.extend({},c);return this.each(function(){var f=b(this);b.fn.xToggleHandler(f,f.val(),a,e,false);f.bind("change",function(){b.fn.xToggleHandler(f,f.val(),a,e,true)})})};b.fn.inputToggle=function(a,c){var e=b.extend({},
c);return this.each(function(){var f=b(this);b.fn.xToggleHandler(f,f.val(),a,e,false);f.bind("change keyup",function(){b.fn.xToggleHandler(f,f.val(),a,e,true)})})};b.fn.radioToggle=function(a,c){var e=b.extend({},b.fn.radioToggle.values,c);this.filter(":checked").length||b.fn.xToggleHandler(null,null,a,e,false);return this.each(function(){var f=b(this);f.is(":checked")&&b.fn.xToggleHandler(f,f.val(),a,e,false);f.bind("change",function(){b.fn.xToggleHandler(f,f.val(),a,e,true)})})};b.fn.monocheckToggle=
function(a,c){var e=b.extend({},b.fn.radioToggle.values,c);return this.each(function(){var f=b(this);b.fn.xToggleHandler(f,f.is(":checked")+0,a,e,false);f.bind("change",function(){b.fn.xToggleHandler(f,f.is(":checked")+0,a,e,true)})})};b.fn.callbackToggle=function(a,c){var e=b.extend({},b.fn.radioToggle.values);return this.each(function(){var f=b(this);b.fn.xToggleHandler(f,c(),a,e,false);f.bind("change keyup",function(){b.fn.xToggleHandler(f,c(),a,e,true)})})};b.fn.radioToggle.values={"0":false,
"1":true};b.fn.xToggleHandler=function(a,c,e,f,i){if(b.type(c)=="object")b.each(c,function(g,h){b.fn.xToggleHandler(a,h,g,f,i)});else if(b.type(e)=="object")b.each(e,function(g,h){b.fn.xToggleHandler(a,c,g,b.extend({},f,h),i)});else{e=b(e);var d=f[c];if(b.type(d)=="undefined")d=b.type(c)=="boolean"?c:f.__default;if(i)d?e.slideDown("fast"):e.slideUp("fast");else d?e.show():e.hide()}};b.fn.dataOr=function(a,c){var e=b(this).data(a);return e!==undefined?e:c};b.fn.relReload=function(a){return this.each(function(){var c=
b(this);b.ajax({cache:false,url:c.attr("rel"),success:function(e){c.html(e);a&&a()}})})};b.fn.resizeHandler=function(){return this.each(function(){var a=b(this);a.resizeHandlerToggler();b(window).resize(function(){a.resizeHandlerToggler()})})};b.fn.resizeHandlerToggler=function(){var a=b(window).width();return this.toggleClass("window-1024",a<=1024).toggleClass("window-800",a<=800)};b.fn.unloadAlert=function(){return this.each(function(){var a=b(this);b(':input:not([readonly="readonly"])',a).change(function(){a.data("changelock",
true)});a.submit(function(){a.data("changelock",false)});window.onbeforeunload=function(c){c=c||window.event;if(a.data("changelock")){if(c)c.returnValue="ATTENTION : Vous \u00eates sur le point de perdre les modifications apport\u00e9es \u00e0 ce formulaire.\nPour que vos changements soient enregistr\u00e9s, vous devez restez sur la page en cours\net valider le formulaire \u00e0 l'aide du bouton en bas de page.";return"ATTENTION : Vous \u00eates sur le point de perdre les modifications apport\u00e9es \u00e0 ce formulaire.\nPour que vos changements soient enregistr\u00e9s, vous devez restez sur la page en cours\net valider le formulaire \u00e0 l'aide du bouton en bas de page."}}})};
b.fn.ajaxBindDialog=function(){return this.bind("click",function(a){a.preventDefault();var c=b(this);a=c.closest("form");b.ajax({cache:false,url:c.attr("href"),data:a.serialize(),type:"post",success:function(e){b("<div/>",{title:c.attr("title")}).hide().appendTo("body").html(e).dialog({modal:true,bgiframe:true,width:c.attr("data-dialog_width"),minHeight:300,dialogClass:c.attr("data-dialog_class"),close:function(){b(this).remove()},buttons:{Fermer:function(){b(this).dialog("close")}}})}});return false})};
b.fn.reportAutoSetup=function(){return this.each(function(){var a=b(this),c=b(a.attr("ref")),e=c.is(":input")?"val":"text";if(a.is(":checked"))if(a.val()==1){c.attr("readonly","readonly").addClass("readonly");c.data("orig",c[e]())}else c.removeAttr("readonly").removeClass("readonly")})}})(jQuery);
$("a.ajax-dialog").live("click",function(b){b.preventDefault();var a=$(this),c=a.attr("dwidth")?a.attr("dwidth"):500;$("<div/>",{title:a.attr("title")}).hide().appendTo("body").load(a.attr("href"),function(){$(this).dialog({bgiframe:true,width:c,minHeight:300,dialogClass:a.attr("data-dialog_class"),close:function(){$(this).remove()},buttons:{Fermer:function(){$(this).dialog("close")}}})});return false});
$("a.ajax-form-read").live("click",function(b){b.preventDefault();var a=$(this),c=a.attr("dwidth")?a.attr("dwidth"):770;$("<div/>",{title:a.attr("title")}).hide().appendTo("body").load(a.attr("href"),function(){$(this).dialog({bgiframe:true,width:c,minHeight:300,dialogClass:a.attr("data-dialog_class"),close:function(){$(this).remove()},buttons:{Fermer:function(){$(this).dialog("close")}}})});return false});
$("a.ajax-form").live("click",function(b){b.preventDefault();b=$(this);var a=b.attr("rel"),c=b.attr("from"),e=b.attr("href"),f=$("<div/>",{title:b.attr("title")}).hide().appendTo("body").load(e+(/\?/.test(e)?"&":"?")+"_="+$.now(),function(){$(this).dialog({bgiframe:true,modal:$.browser.safari==true?false:true,width:770,minHeight:300,open:function(){c&&$(c).effect("transfer",{to:f})},close:function(){a&&!f.data("cancelReload")&&$(a).relReload();$(this).remove()},buttons:{Annuler:function(){$(this).dialog("close")},
Enregistrer:function(){var i=$(this).find("form");$.ajax({cache:false,url:i.attr("action"),data:i.serialize(),type:i.attr("method"),success:function(d){if(typeof d=="object"){if(d.save=="OK")a?$(a).relReload(function(){if(d.indice){var g=d.module+"_"+d.indice,h=$("#"+g),j=$("."+g);h.length&&f.effect("transfer",{to:h},400,function(){j.length&&h.effect("transfer",{to:j},400)})}f.data("cancelReload",true);f.dialog("close")}):f.dialog("close")}else i.closest(".ui-dialog-content").html(d)}});return false}}})});
return false});$("a.ajax-load").live("click",function(b){b.preventDefault();$($(this).attr("rel")).load($(this).attr("href"));return false});$("a.report").live("click",function(b){b.preventDefault();var a=$($(this).attr("data-from")),c=$($(this).attr("data-to")),e=a.is(":input")?"val":"text",f=c.is(":input")?"val":"text";a.effect("transfer",{to:c},400,function(){c[f](a[e]());c.trigger("change")});return false});
$(".form_report_auto").reportAutoSetup().live("click",function(){var b=$($(this).attr("ref")),a=$($(this).attr("ref")+"_calcul"),c=a.is(":input")?"val":"text",e=b.is(":input")?"val":"text";if($(this).is(":checked"))if($(this).val()==1){b.data("orig",b[e]());b[e](a[c]());b.trigger("keyup").attr("readonly","readonly").addClass("readonly")}else{b[e](b.data("orig"));b.removeAttr("readonly").removeClass("readonly").trigger("keyup").focus()}});
$("a.champ-alerte-toggle").live("click",function(b){b.preventDefault();var a=$(this);$.ajax({url:a.attr("href"),dataType:"json",cache:false,success:function(c){a.closest(".form_row").toggleClass("form_row_error",c.alerte);a.html(c.alerte?'Retirer le marquage "\u00e0 v\u00e9rifier"':'Marquer ce champ "\u00e0 v\u00e9rifier"')}});return false});
$("a.anim-dialog").click(function(b){b.preventDefault();b=$(this);var a=b.attr("dwidth")?b.attr("dwidth"):1026,c=b.attr("dheight")?b.attr("dheight"):800;window.open(b.attr("href"),"flash_anim","width="+a+",height="+c+",status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,fullscreen=1");return false});
$(function(){$(".menu_champ_handler").live("click",function(){var a=$(this);a.data("rel_menu")||a.data("rel_menu",$("#menu_champ_"+a.data("rel")).menu());var c=a.data("rel_menu");if(!c.hasClass("ui-helper-hidden-accessible")){c.addClass("ui-helper-hidden-accessible");return false}c.menu("deactivate").removeClass("ui-helper-hidden-accessible").css({top:0,left:0}).position({my:"left top",at:"left bottom",of:a});$(document).one("click",function(){c.addClass("ui-helper-hidden-accessible")});return false});
$("a.confirm").live("click",function(){var a=$(this).attr("data-confirm");a.length||(a="Etes-vous s\u00fbr(e) ?");return confirm(a)});if(document.location.hash.length){var b=$(document.location.hash);b.hasClass("ajax-form")||b.hasClass("ajax-form-read")?b.click():b.effect("pulsate",{times:3},400)}window.setInterval(function(){$.get("/general/ping")},6E5);$(".form_commentaire_add button").live("click",function(a){a.preventDefault();var c=$(this).closest(".form_commentaire_add").find("textarea");$.post("/formulaire/champ-commentaire-add/"+
$(this).attr("rel"),{body:c.val()},function(e){if(typeof e=="object")if(e.save=="OK"){c.before("<p>"+c.val().replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</p>");c.val("")}});return false})});$("body").resizeHandler();$("form.unloadalert").unloadAlert();$("table.form_compta tr.form_row").hoverClass("hover");
$(".mois_select").css({cursor:"pointer"}).click(function(){var b=$(this).attr("data-m");if(b){$(".form_field__mois").hide();$(".mois_"+b).show()}else $(".form_field__mois").show();$(".mois_select").removeClass("selected");$(this).addClass("selected")});
$("button#dossier_compta_mode").click(function(){var b=$(this),a=b.attr("data-dossier"),c=b.attr("data-compta");b=b.attr("data-mensuel");if(confirm("Attention, vous allez perdre toutes les saisies de vos "+c+"."))top.location="/dossier/"+a+"/compta-mode/"+c+"?mensuel="+b});$("#menu-contract").click(function(){var b=$("#content");b.data("marginLeftOrig",b.css("marginLeft"));$("#menu").slideUp(300,function(){$("#menu-t").show()});b.animate({marginLeft:"26"},300)});
$("#menu-expand").click(function(){var b=$("#content");$("#menu-t").hide();b.animate({marginLeft:b.data("marginLeftOrig")},300);$("#menu").slideDown(300)});$("label[required]").append("&nbsp;<sup>*</sup>");var is_ie6=$.browser.msie&&$.browser.version.substr(0,1)<7;$.fn.checkToggler=function(){return this.each(function(){undefined==$(this).data("checkToggler")&&$(this).bind("load change click",function(){$($(this).data("rel")).toggle($(this).is(":checked"))});$(this).data("checkToggler",true)})};$(".__pp_maintien_c").checkToggler();
$.fn.obsQtip=function(){return this.each(function(){$(this).qtip({position:{my:"bottom right",at:"top left",viewport:$(window),adjust:{y:-4},method:"shift flip"},content:{text:function(){return $($(this).attr("rel"))},title:{text:function(){return"<u>"+$(this).data("code")+"</u> : "+$(this).attr("title")},button:false}},show:{delay:300},hide:{fixed:true,delay:200},style:{classes:"ui-tooltip-shadow ui-tooltip-light ui-tooltip-rounded ui-tooltip-observation"}})})};
$.fn.alerteQtip=function(){return this.each(function(){$(this).qtip({position:{my:"bottom left",at:"top right",viewport:$(window),adjust:{y:-4},method:"shift flip"},content:{text:function(){return $($(this).attr("rel"))},title:{text:function(){return $(this).data("theme")+" - "+$(this).text()},button:false}},show:{delay:300},hide:{fixed:true,delay:200},style:{classes:"ui-tooltip-shadow ui-tooltip-light ui-tooltip-rounded ui-tooltip-observation"}})})};
$.fn.enterNextTabindex=function(){return this.each(function(){var b=$(this);b.bind("keydown",function(a){if(a.which===13){a.stopPropagation();a.preventDefault();a=b.closest("form");var c=$(":focusable",a),e=b.attr("tabindex"),f=$("input[type=submit]",a),i=999999999;c.each(function(d,g){var h=$(g),j=h.attr("tabindex");if(j>e&&j<i){f=h;i=j}});f.focus()}})})};

