/*! jstree - v1.0.0 - 2012-10-01 * http://jstree.com * Copyright (c) 2012 Ivan Bozhanov; Licensed MIT, GPL */ (function(e){e.vakata={}})(jQuery),function(e){e.fn.vakata_reverse=[].reverse}(jQuery),function(e){jQuery.expr[":"].vakata_icontains=function(e,t,n){return(e.textContent||e.innerText||"").toLowerCase().indexOf(n[3].toLowerCase())>=0}}(jQuery),function(e){e.vakata.array_remove=function(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r),e}}(jQuery),function(e){e.vakata.array_unique=function(e){var t=[],n,r,i;for(n=0,i=e.length;n').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),r=e('').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),t=n.width()-r.width(),n.add(r).remove()):(n=e("
").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:0}).prependTo("body").append("
").find("div").css({width:"100%",height:200}),t=100-n.width(),n.parent().remove())),t}}(jQuery),function(e){e.vakata.css={get_css:function(e,t,n){e=e.toLowerCase();var r=n.cssRules||n.rules,i=0;do{if(r.length&&i>r.length+5)return!1;if(r[i].selectorText&&r[i].selectorText.toLowerCase()===e)return t===!0?(n.removeRule&&n.removeRule(i),n.deleteRule&&n.deleteRule(i),!0):r[i]}while(r[++i]);return!1},add_css:function(t,n){return e.jstree.css.get_css(t,!1,n)?!1:(n.insertRule?n.insertRule(t+" { }",0):n.addRule(t,null,0),e.vakata.css.get_css(t))},remove_css:function(t,n){return e.vakata.css.get_css(t,!0,n)},add_sheet:function(t){var n=!1,r=!0;if(t.str)return t.title&&(n=e("style[id='"+t.title+"-stylesheet']")[0]),n?r=!1:(n=document.createElement("style"),n.setAttribute("type","text/css"),t.title&&n.setAttribute("id",t.title+"-stylesheet")),n.styleSheet?r?(document.getElementsByTagName("head")[0].appendChild(n),n.styleSheet.cssText=t.str):n.styleSheet.cssText=n.styleSheet.cssText+" "+t.str:(n.appendChild(document.createTextNode(t.str)),document.getElementsByTagName("head")[0].appendChild(n)),n.sheet||n.styleSheet;if(t.url){if(!document.createStyleSheet)return n=document.createElement("link"),n.rel="stylesheet",n.type="text/css",n.media="all",n.href=t.url,document.getElementsByTagName("head")[0].appendChild(n),n.styleSheet;try{n=document.createStyleSheet(t.url)}catch(i){}}}}}(jQuery),function(e){var t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,n){var r=e.vakata.dnd._get();r.event=n,e(document).triggerHandler("dnd_"+t+".vakata",r)},_get:function(){return{data:t.data,element:t.element,helper:t.helper}},_clean:function(){t.helper&&t.helper.remove(),t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.stop)},_scroll:function(n){if(!t.scroll_e||!t.scroll_l&&!t.scroll_t)return t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),!1;if(!t.scroll_i)return t.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(n===!0)return!1;var r=t.scroll_e.scrollTop(),i=t.scroll_e.scrollLeft();t.scroll_e.scrollTop(r+t.scroll_t*e.vakata.dnd.settings.scroll_speed),t.scroll_e.scrollLeft(i+t.scroll_l*e.vakata.dnd.settings.scroll_speed),(r!==t.scroll_e.scrollTop()||i!==t.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",t.scroll_e)},start:function(n,r,i){t.is_drag&&e.vakata.dnd.stop({});try{n.currentTarget.unselectable="on",n.currentTarget.onselectstart=function(){return!1},n.currentTarget.style&&(n.currentTarget.style.MozUserSelect="none")}catch(s){}return t.init_x=n.pageX,t.init_y=n.pageY,t.data=r,t.is_down=!0,t.element=n.currentTarget,i!==!1&&(t.helper=e("
").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.stop),!1},drag:function(n){if(!t.is_down)return;if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>e.vakata.dnd.settings.threshold||Math.abs(n.pageY-t.init_y)>e.vakata.dnd.settings.threshold))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",n)}var r=!1,i=!1,s=!1,o=!1,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1;t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1;var p=e(n.target).parentsUntil("body").andSelf().vakata_reverse().filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var r=e(this),i=r.offset();this.scrollHeight>this.offsetHeight&&(i.top+r.height()-n.pageYthis.offsetWidth&&(i.left+r.width()-n.pageXo&&n.pageY-fo&&o-(n.pageY-f)a&&n.pageX-la&&a-(n.pageX-l)s&&(c=s-50),u&&h+t.helper_w>u&&(h=u-(t.helper_w+2)),t.helper.css({left:h+"px",top:c+"px"})),e.vakata.dnd._trigger("move",n)},stop:function(n){t.is_drag&&e.vakata.dnd._trigger("stop",n),e.vakata.dnd._clean()}}}(jQuery),function(e){e.vakata.xslt=function(t,n){var r=!1,i,s,o;if(r===!1&&window.ActiveXObject)try{r=new ActiveXObject("Msxml2.XSLTemplate"),s=new ActiveXObject("Msxml2.DOMDocument"),s.loadXML(t),o=new ActiveXObject("Msxml2.FreeThreadedDOMDocument"),o.loadXML(n),r.stylesheet=o,i=r.createProcessor(),i.input=s,i.transform(),r=i.output}catch(u){}return t=e.parseXML(t),n=e.parseXML(n),r===!1&&typeof XSLTProcessor!="undefined"&&(i=new XSLTProcessor,i.importStylesheet(n),r=i.transformToFragment(t,document),r=e("
").append(r).html()),r===!1&&typeof t.transformNode!="undefined"&&(r=t.transformNode(n)),r}}(jQuery),typeof jQuery.hotkeys=="undefined"&&function(e){function t(e){if(typeof e.data!="string")return;var t=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(!(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&e.target.type!=="text"))return;var r=e.type!=="keypress"&&jQuery.vakata_hotkeys.specialKeys[e.which],i=String.fromCharCode(e.which).toLowerCase(),s,o="",u={};e.altKey&&r!=="alt"&&(o+="alt+"),e.ctrlKey&&r!=="ctrl"&&(o+="ctrl+"),e.metaKey&&!e.ctrlKey&&r!=="meta"&&(o+="meta+"),e.shiftKey&&r!=="shift"&&(o+="shift+"),r?u[o+r]=!0:(u[o+i]=!0,u[o+jQuery.vakata_hotkeys.shiftNums[i]]=!0,o==="shift+"&&(u[jQuery.vakata_hotkeys.shiftNums[i]]=!0));for(var a=0,f=n.length;a","/":"?","\\":"|"}},jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:t}})}(jQuery),function(e){var t=!1,n={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}})},_execute:function(e){return e=n.items[e],e&&!e._disabled&&e.action?e.action.call(null,{item:e,reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}}):!1},_parse:function(t,r){if(!t)return!1;r||(n.html="",n.items=[]);var i="",s=!1,o;return r&&(i+=""),r||(n.html=i,e.vakata.context._trigger("parse")),i.length>10?i:!1},_show_submenu:function(n){n=e(n);if(!n.length||!n.children("ul").length)return;var r=n.children("ul"),i=n.offset().left+n.outerWidth(),s=n.offset().top,o=r.width(),u=r.height(),a=e(window).width()+e(window).scrollLeft(),f=e(window).height()+e(window).scrollTop();t?n[i-(o+10+n.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):n[i+o+10>a?"addClass":"removeClass"]("vakata-context-right"),s+u+10>f&&r.css("bottom","-1px"),r.show()},show:function(r,i,s){n.element&&n.element.length&&n.element.width("");switch(!0){case!i&&!r:return!1;case!!i&&!!r:n.reference=r,n.position_x=i.x,n.position_y=i.y;break;case!i&&!!r:n.reference=r;var o=r.offset();n.position_x=o.left+r.outerHeight(),n.position_y=o.top;break;case!!i&&!r:n.position_x=i.x,n.position_y=i.y}!!r&&!s&&e(r).data("vakata_contextmenu")&&(s=e(r).data("vakata_contextmenu")),e.vakata.context._parse(s)&&n.element.html(n.html);if(n.items.length){var u=n.element,a=n.position_x,f=n.position_y,l=u.width(),c=u.height(),h=e(window).width()+e(window).scrollLeft(),p=e(window).height()+e(window).scrollTop();t&&(a-=u.outerWidth(),ah&&(a=h-(l+20)),f+c+20>p&&(f=p-(c+20)),n.element.css({left:a,top:f}).show().width(n.element.outerWidth()),n.is_visible=!0,e.vakata.context._trigger("show")}},hide:function(){n.is_visible&&(n.element.hide().find("ul").hide(),n.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){t=e("body").css("direction")==="rtl";var r=!1,i='.vakata-context { display:none; _width:1px; } .vakata-context, .vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } .vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context li { list-style:none; display:inline; }.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }.vakata-context li a:hover { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position:right center; background-repeat:no-repeat; } .vakata-context li.vakata-context-separator a, .vakata-context li.vakata-context-separator a:hover { background:white; border:0; border-top:1px solid #e2e3e3; height:1px; min-height:1px; max-height:1px; padding:0; margin:0 0 0 2.4em; border-left:1px solid #e0e0e0; _overflow:hidden; -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } .vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } .vakata-context-rtl ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context-rtl li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position:left center; background-repeat:no-repeat; } .vakata-context-rtl li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} .vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } .vakata-context-rtl li a ins { margin:0 -2em 0 0; } .vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ';e.vakata.css.add_sheet({str:i,title:"vakata-context"}),n.element=e("
    "),n.element.delegate("li","mouseenter",function(t){t.stopImmediatePropagation();if(e.contains(this,t.relatedTarget))return;r&&clearTimeout(r),n.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").andSelf().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this)}).delegate("li","mouseleave",function(t){if(e.contains(this,t.relatedTarget))return;e(this).find(".vakata-context-hover").andSelf().removeClass("vakata-context-hover")}).bind("mouseleave",function(t){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(r=setTimeout(function(t){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).delegate("a","click",function(e){e.preventDefault()}).delegate("a","mouseup",function(t){!e(this).blur().parent().hasClass("vakata-context-disabled")&&e.vakata.context._execute(e(this).attr("rel"))!==!1&&e.vakata.context.hide()}).appendTo("body"),e(document).bind("mousedown",function(t){n.is_visible&&!e.contains(n.element[0],t.target)&&e.vakata.context.hide()}).bind("context_show.vakata",function(e,r){n.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),t&&n.element.addClass("vakata-context-rtl").css("direction","rtl"),n.element.find("ul").hide().end()}),(typeof e.hotkeys!="undefined"||typeof e.vakata_hotkeys!="undefined")&&e(document).bind("keydown","up",function(e){if(n.is_visible){var t=n.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();t.length||(t=n.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").last()),t.addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault()}}).bind("keydown","down",function(e){if(n.is_visible){var t=n.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();t.length||(t=n.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").first()),t.addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault()}}).bind("keydown","right",function(e){n.is_visible&&(n.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault())}).bind("keydown","left",function(e){n.is_visible&&(n.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault())}).bind("keydown","esc",function(t){e.vakata.context.hide(),t.preventDefault()}).bind("keydown","space",function(e){n.element.find(".vakata-context-hover").last().children("a").click(),e.preventDefault()})})}(jQuery),function(e){var t=function(e){var t=/["\\\x00-\x1f\x7f-\x9f]/g,n={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return e.match(t)?'"'+e.replace(t,function(e){var t=n[e];return typeof t=="string"?t:(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})+'"':'"'+e+'"'};e.vakata.json={encode:function(n){if(n===null)return"null";var r=[],i;switch(typeof n){case"undefined":return undefined;case"number":case"boolean":return n+"";case"string":return t(n);case"object":if(e.isFunction(n.toJSON))return e.vakata.json.encode(n.toJSON());if(n.constructor===Date)return'"'+n.getUTCFullYear()+"-"+String("0"+(n.getUTCMonth()+1)).slice(-2)+"-"+String("0"+n.getUTCDate()).slice(-2)+"T"+String("0"+n.getUTCHours()).slice(-2)+":"+String("0"+n.getUTCMinutes()).slice(-2)+":"+String("0"+n.getUTCSeconds()).slice(-2)+"."+String("00"+n.getUTCMilliseconds()).slice(-3)+'Z"';if(n.constructor===Array){for(i=0;i1&&String(n)!=="[object Object]"){r=e.extend({},r);if(n===null||n===undefined)r.expires=-1;return typeof r.expires=="number"&&(i=r.expires,s=r.expires=new Date,s.setDate(s.getDate()+i)),n=String(n),document.cookie=[encodeURIComponent(t),"=",r.raw?n:encodeURIComponent(n),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}return r=n||{},u=r.raw?function(e){return e}:decodeURIComponent,(o=(new RegExp("(?:^|; )"+encodeURIComponent(t)+"=([^;]*)")).exec(document.cookie))?u(o[1]):null}}(jQuery),function(e){function f(){var t=!1;if("localStorage"in window)try{window.localStorage.setItem("_tmptest","tmpval"),t=!0,window.localStorage.removeItem("_tmptest")}catch(i){}if(t)try{window.localStorage&&(n=window.localStorage,u="localStorage")}catch(s){}else if("globalStorage"in window)try{window.globalStorage&&(n=window.globalStorage[window.location.hostname],u="globalStorage")}catch(o){}else{r=document.createElement("link");if(r.addBehavior){r.style.behavior="url(#default#userData)",document.getElementsByTagName("head")[0].appendChild(r);try{r.load("jStorage");var a="{}";a=r.getAttribute("jStorage"),n.jStorage=a,u="userDataBehavior"}catch(f){}}!u&&(!!e.vakata.cookie("__vjstorage")||e.vakata.cookie("__vjstorage","{}",{expires:365})&&e.vakata.cookie("__vjstorage")==="{}")&&(r=null,n.jStorage=e.vakata.cookie("__vjstorage"),u="cookie");if(!u){r=null;return}}l(),p()}function l(){if(n.jStorage)try{t=o(String(n.jStorage))}catch(e){n.jStorage="{}"}else n.jStorage="{}";i=n.jStorage?String(n.jStorage).length:0}function c(){try{n.jStorage=s(t),u==="userDataBehavior"&&(r.setAttribute("jStorage",n.jStorage),r.save("jStorage")),u==="cookie"&&e.vakata.cookie("__vjstorage",n.jStorage,{expires:365}),i=n.jStorage?String(n.jStorage).length:0}catch(o){}}function h(e){if(!e||typeof e!="string"&&typeof e!="number")throw new TypeError("Key name must be string or numeric");if(e==="__jstorage_meta")throw new TypeError("Reserved key name");return!0}function p(){var e=+(new Date),n,r,i=Infinity,s=!1;a!==!1&&clearTimeout(a);if(!t.__jstorage_meta||typeof t.__jstorage_meta.TTL!="object")return;r=t.__jstorage_meta.TTL;for(n in r)r.hasOwnProperty(n)&&(r[n]<=e?(delete r[n],delete t[n],s=!0):r[n]0?t.__jstorage_meta.TTL[e]=r+n:delete t.__jstorage_meta.TTL[e],c(),p(),!0):!1},flush:function(){return t={},c(),!0},storageObj:function(){function e(){}return e.prototype=t,new e},index:function(){var n=[],r;return e.each(t,function(e,t){e!=="__jstorage_meta"&&n.push(e)}),n},storageSize:function(){return i},currentBackend:function(){return u},storageAvailable:function(){return!!u}},f()}(jQuery),function(e){e.vakata.pretty_date={lang:{ago:"Ago",from:"From Now",now:"Just Now",minute:"Minute",minutes:"Minutes",hour:"Hour",hours:"Hours",day:"Day",days:"Days",week:"Week",weeks:"Weeks",month:"Month",months:"Months",year:"Year",years:"Years"},parse:function(t,n){t=new Date(t.replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\+\d\d\:\d\d$/,"")),n=n||new Date;var r=e.vakata.pretty_date.lang,i=[[60,r.now],[3600,r.minute,r.minutes,60],[86400,r.hour,r.hours,3600],[604800,r.day,r.days,86400],[2628e3,r.week,r.weeks,604800],[31536e3,r.month,r.months,2628e3],[Infinity,r.year,r.years,31536e3]],s=(n-t+n.getTimezoneOffset()*6e4)/1e3,o=function(e,t){var n=.1;return e>=t&&e<=t*(1+n)?t:e},u;s<0?(s=Math.abs(s),u=" "+r.from):u=" "+r.ago;for(var a=0,f=i[0];i[a];f=i[++a])if(s0?u:"")}},init:function(t,n){e("time, [datetime]").vakata_pretty_date(n),setInterval(function(){e("time, [datetime]").vakata_pretty_date(n)},t||6e4)}},e.fn.vakata_pretty_date=function(t,n){return t||(t="%{s}"),this.each(function(){var r=jQuery(this),i=e.vakata.pretty_date.parse(r.attr("datetime"),n);i&&(i=t.replace("%{s}",i),r.html()!==i&&r.html(i))})}}(jQuery),function(e){e.vakata.selection={get:function(e){if(window.getSelection){if(e)return window.getSelection().toString();var t=window.getSelection(),n=t.getRangeAt&&t.rangeCount?t.getRangeAt(0):document.createRange(),r=document.createElement("div");return t.getRangeAt||(n.setStart(t.anchorNode,t.anchorOffset),n.setEnd(t.focusNode,t.focusOffset)),r.appendChild(n.cloneContents()),r.innerHTML}return document.selection?document.selection.createRange()[e?"text":"htmlText"]:""},elm_get:function(e){e=typeof e=="string"?document.getElementById(e):e,e.jquery&&(e=e.get(0));if("selectionStart"in e)return{start:e.selectionStart,end:e.selectionEnd,length:e.selectionEnd-e.selectionStart,text:e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart)};if(!document.selection)return{start:e.value.length,end:e.value.length,length:0,text:""};e.focus();var t=document.selection.createRange(),n=!1,r=!1,i,s,o,u;if(t&&t.parentElement()===e)return i=e.value.length,s=e.value.replace(/\r\n/g,"\n"),n=e.createTextRange(),n.moveToBookmark(t.getBookmark()),r=e.createTextRange(),r.collapse(!1),n.compareEndPoints("StartToEnd",r)>-1?o=u=i:(o=-n.moveStart("character",-i),o+=s.slice(0,o).split("\n").length-1,n.compareEndPoints("EndToEnd",r)>-1?u=i:(u=-n.moveEnd("character",-i),u+=s.slice(0,u).split("\n").length-1)),s=e.value.slice(o,u),{start:o,end:u,length:s.length,text:s}},elm_set:function(t,n,r){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));if("selectionStart"in t)t.focus(),t.selectionStart=n,t.selectionEnd=r;else if(document.selection){t.focus();var i=t.createTextRange(),s=t.value.replace(/\r\n/g,"\n");n-=s.slice(0,n).split("\n").length-1,r-=s.slice(0,r).split("\n").length-1,i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",n),i.select()}return e.vakata.selection.elm_get(t)},elm_replace:function(t,n){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));var r=e.vakata.selection.elm_get(t),i=r.start,s=i+n.length;return t.value=t.value.substr(0,i)+n+t.value.substr(r.end,t.value.length),e.vakata.selection.elm_set(t,i,s),{start:i,end:s,length:n.length,text:n}},elm_get_caret:function(t){return e.vakata.selection.elm_get(t).end},elm_set_caret:function(t,n){return e.vakata.selection.elm_set(t,n,n)},elm_get_caret_position:function(t){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));var n=e.vakata.selection.elm_get_caret(t),r=t.value.substring(0,n).replace(/&/g,"&").replace(//ig,">").replace(/\r/g,"").replace(/\t/g," ").replace(/\n/ig,"
    "),i=e.vakata.get_scrollbar_width(),s=e(t).width(),o=e(t).height();return t.scrollHeight>o&&(s-=i),t.scrollWidth>s&&(o-=i),t=e(t),t=e("
    ").html(r).css({background:"red",width:s+"px",height:"auto",position:"absolute",left:"0px",top:"-10000px",fontSize:t.css("fontSize"),fontFamily:t.css("fontFamily"),fontWeight:t.css("fontWeight"),fontVariant:t.css("fontVariant"),fontStyle:t.css("fontStyle"),textTransform:t.css("textTransform"),lineHeight:t.css("lineHeight"),whiteSpace:"pre-wrap"}),t.append(' ').appendTo("body"),r=t.find("span.caret"),n=r.offset(),n.top=n.top+1e4+r.height(),t.remove(),n}}}(jQuery),function(e){e.fn.vakata_highlight=function(t){var n=this;return typeof t=="string"&&(t=[t]),e.isArray(t)&&(t={words:t}),t=e.extend(!0,{},{css_class:"vakata-highlight",words:[],color:"#99ccff"},t),t.words.length&&this.each(function(){var n=e(this);e.each(t.words,function(r,i){var s=!1;typeof t.color=="string"&&(s=t.color),e.isArray(t.color)&&typeof t.color[r]=="string"&&(s=t.color[r]),n.find(':vakata_icontains("'+i.replace(/\"/ig,"")+'")').filter("strong, span, li, p, h1, h2, h3, h4, h5, h6, div, u, em, i, dt, dd").contents().filter(function(){return this.nodeType===3}).each(function(){if(this.nodeValue.toLowerCase().indexOf(i.toLowerCase())>=0){this.nodeValue=this.nodeValue.replace(new RegExp("("+i.replace(/([\-.*+?\^${}()|\[\]\/\\])/g,"\\$1")+")","ig"),"|{{{$1}}}|");var n=e(this).parent();n.html(n.html().replace(/\|\{\{\{/g,'").replace(/\}\}\}\|/g,""))}})})}),n}}(jQuery),function(){"use strict";if(!jQuery)throw"jsTree: jQuery not included.";if(jQuery.jstree)return;(function(e){var t=[],n=-1,r={},i={};e.jstree={VERSION:"1.0.0",IS_IE6:jQuery.browser.msie&&parseInt(jQuery.browser.version,10)===6,IS_IE7:jQuery.browser.msie&&parseInt(jQuery.browser.version,10)===6,IS_FF2:jQuery.browser.mozilla&&parseFloat(jQuery.browser.version,10)<1.9,__construct:function(n){var i={},s={},o=[],u=[],a=0;return n=e(n),e.jstree._reference(n)&&e.jstree.__destruct(n),e.extend.apply(null,[!0,i].concat(Array.prototype.slice.call(arguments,1),n.data("jstree")||{})),o=e.isArray(i.plugins)?i.plugins:e.jstree.defaults.plugins.slice(),o=e.vakata.array_unique(o),i=e.extend(!0,{},e.jstree.defaults,i),e.each(r,function(t,n){t!=="core"&&e.inArray(t,o)===-1?(i[t]=null,delete i[t]):(u.push(t),s[t]={})}),i.plugins=u,a=parseInt(t.push({}),10)-1,n.data("jstree_instance_id",a).addClass("jstree jstree-"+a),this.data=s,this.get_index=function(){return a},this.get_container=function(){return n},this.get_container_ul=function(){return n.children("ul:eq(0)")},this.get_settings=function(t){return t?i:e.extend(!0,{},i)},this.__trigger=function(e,t){if(!e)return;return t||(t={}),typeof e=="string"&&(e=e.replace(".jstree","")+".jstree"),t.inst=this,this.get_container().triggerHandler(e,t)},t[a]=this,e.each(u,function(e,n){r[n]&&r[n].__construct.apply(t[a])}),this.__trigger("__construct"),e.jstree._focus(a),this},__destruct:function(i){i=e.jstree._reference(i);if(!i)return!1;var s=i.get_settings(),o=i.get_index(),u=0;if(n===o){for(u in t)if(t.hasOwnProperty(u)&&u!==o){e.jstree._focus(u);break}n===o&&e.jstree._focus(!1)}return e.each(s.plugins,function(e,t){try{r[t].__destruct.apply(i)}catch(n){}}),i.__trigger("__destruct"),i.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")}),e(document).unbind(".jstree-"+o).undelegate(".jstree-"+o),delete t[o],!0},__call:function(t,n,r){t=e.jstree._reference(t);if(!t||!e.isFunction(t[n]))return;return t[n].apply(t,r)},_reference:function(n){if(t[n])return t[n];var r=e(n);return!r.length&&typeof n=="string"&&(r=e("#"+n)),r.length?t[r.closest(".jstree").data("jstree_instance_id")]||null:null},_focused:function(){return t[n]||null},_focus:function(r){return r===!1?(t[n].get_container().removeClass("jstree-focused"),t[n].__trigger("_defocus"),n=-1,!1):(r=e.jstree._reference(r),!r||r.get_index()===n?!1:(n!==-1&&(t[n].get_container().removeClass("jstree-focused"),t[n].__trigger("_defocus")),n=r.get_index(),r.get_container().addClass("jstree-focused"),r.__trigger("_focus"),!0))},plugin:function(t,n){n=e.extend({},{__construct:e.noop,__destuct:e.noop,_fn:{},defaults:!1},n),r[t]=n,e.jstree.defaults[t]=n.defaults,e.each(n._fn,function(n,r){r.plugin=t,r.old=i[n],i[n]=function(){var t,i=r,s=Array.prototype.slice.call(arguments),o=new e.Event("before.jstree"),u=this.get_settings(!0).plugins;do{if(i&&i.plugin&&e.inArray(i.plugin,u)!==-1)break;i=i.old}while(i);if(!i)return;if(n.indexOf("_")===0)t=i.apply(this,s);else{t=this.__trigger(o,{func:n,args:s,plugin:i.plugin});if(t===!1)return;t=i.apply(e.extend({},this,{__callback:function(e){return this.__trigger(n,{args:s,rslt:e,plugin:i.plugin}),e},__call_old:function(e){return i.old.apply(this,e?Array.prototype.slice.call(arguments,1):s)}}),s)}return t},i[n].old=r.old,i[n].plugin=t})},defaults:{plugins:[]}},e.fn.jstree=function(t){var n=typeof t=="string",r=Array.prototype.slice.call(arguments,1),i=this;return this.each(function(){if(n){var s=e.jstree.__call(this,t,r);if(typeof s!="undefined"&&(t.indexOf(!1)||s!==!0&&s!==!1))return i=s,!1}else n=new e.jstree.__construct(this,t)}),i},i=e.jstree.__construct.prototype,e.expr[":"].jstree=function(t,n,r){return typeof e(t).data("jstree_instance_id")!="undefined"}})(jQuery),function(e){var t=!1,n=!1;e(function(){e.jstree.SCROLLBAR_WIDTH=e.vakata.get_scrollbar_width()}),e.jstree.plugin("core",{__construct:function(){this.data.core.rtl=this.get_container().css("direction")==="rtl",this.data.core.rtl&&this.get_container().addClass("jstree-rtl"),this.data.core.ready=!1,e.support.touch&&this.get_container().addTouch(),this.get_container().bind("__construct.jstree",e.proxy(function(){setTimeout(e.proxy(function(){this&&this.init()},this),0)},this)).bind("before.jstree",e.proxy(function(e,t){if(!/^is_locked|unlock$/.test(t.func)&&this.data.core.locked)return e.stopImmediatePropagation(),!1},this)).bind("create_node.jstree",e.proxy(function(e,t){this.clean_node(t.rslt.obj)},this)).bind("load_node.jstree",e.proxy(function(e,t){if(t.rslt.status){if(t.rslt.obj===-1){var n=this.get_container_ul().detach();this.clean_node(n.children("li")),this.get_container().prepend(n)}else this.clean_node(t.rslt.obj.find("> ul > li"));!this.data.core.ready&&!this.get_container_ul().find(".jstree-loading:eq(0)").length&&(this.data.core.ready=!0,this.__trigger("__ready"))}},this)).bind("__loaded.jstree",e.proxy(function(e,t){t.inst.get_container_ul().children("li").each(function(){t.inst.correct_node(this)})},this)).bind("open_node.jstree",e.proxy(function(e,t){t.rslt.obj.find("> ul > li").each(function(){t.inst.correct_node(this)})},this)).bind("mousedown.jstree",e.proxy(function(){e.jstree._focus(this.get_index())},this)).bind("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).delegate(".jstree-ocl","click.jstree",e.proxy(function(e){this.toggle_node(e.target)},this))},__destruct:function(){},defaults:{strings:!1,check_callback:!0,animation:100},_fn:{_get_string:function(t){var n=this.get_settings(!0).core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},init:function(){this.data.core.original_container_html=this.get_container().find(" > ul > li").clone(!0),this.data.core.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType===3&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.get_container().html(""),this.clean_node(-1),this.data.core.li_height=this.get_container_ul().children("li:eq(0)").height()||18,this.load_node(-1,function(){this.__trigger("__loaded")})},lock:function(){this.data.core.locked=!0,this.get_container().addClass("jstree-locked"),this.__callback()},unlock:function(){this.data.core.locked=!1,this.get_container().removeClass("jstree-locked"),this.__callback()},is_locked:function(){return this.data.core.locked},get_node:function(t){var n=e(t,this.get_container());return n.is(".jstree")||t===-1?-1:(n=n.closest("li",this.get_container()),n.length?n:!1)},get_next:function(e,t){return e=this.get_node(e),e===-1?this.get_container_ul().children("li:eq(0)"):!e||!e.length?!1:t?e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):!1:e.hasClass("jstree-open")?e.find("li:eq(0)"):e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):e.parentsUntil(".jstree","li").next("li").eq(0)},get_prev:function(e,t){e=this.get_node(e);if(e===-1)return this.get_container().find("> ul > li:last-child");if(!e||!e.length)return!1;if(t)return e.prevAll("li").length>0?e.prevAll("li:eq(0)"):!1;if(e.prev("li").length){e=e.prev("li").eq(0);while(e.hasClass("jstree-open"))e=e.children("ul:eq(0)").children("li:last");return e}var n=e.parentsUntil(".jstree","li:eq(0)");return n.length?n:!1},get_parent:function(e){e=this.get_node(e);if(e===-1||!e||!e.length)return!1;var t=e.parentsUntil(".jstree","li:eq(0)");return t.length?t:-1},get_children:function(e){return e=this.get_node(e),e===-1?this.get_container_ul().children("li"):!e||!e.length?!1:e.find("> ul > li")},is_parent:function(e){return e=this.get_node(e),e&&e!==-1&&(e.find("> ul > li:eq(0)").length||e.hasClass("jstree-closed"))},is_loaded:function(e){return e=this.get_node(e),e&&(e===-1&&!this.get_container().find("> ul > li.jstree-loading").length||e!==-1&&!e.hasClass("jstree-loading")&&(e.find("> ul > li").length||e.hasClass("jstree-leaf")))},is_loading:function(e){return e=this.get_node(e),e&&(e===-1&&this.get_container().find("> ul > li.jstree-loading").length||e!==-1&&e.hasClass("jstree-loading"))},is_open:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-open")},is_closed:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-closed")},is_leaf:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-leaf")},load_node:function(t,n){return t=this.get_node(t),t?(t!==-1&&t.addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){t!==-1&&t.removeClass("jstree-loading"),this.__callback({obj:t,status:e}),n&&n.call(this,t,e)},this)),!0):(n.call(this,t,!1),!1)},_load_node:function(e,t){e===-1&&this.get_container_ul().empty().append(this.data.core.original_container_html.clone(!0)),t.call(null,!0)},open_node:function(t,n,r){t=this.get_node(t),r=(typeof r).toLowerCase()==="undefined"?this.get_settings().core.animation:r;if(t===-1||!t||!t.length)return!1;if(!this.is_closed(t))return n&&n.call(this,t,!1),!1;if(!this.is_loaded(t))this.load_node(t,function(e,t){return t?this.open_node(e,n,r):n?n.call(this,e,!1):!1});else{var i=this;t.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").children("ul").stop(!0,!0).slideDown(e.jstree.IS_IE6?0:r,function(){this.style.display="",i.__trigger("__after_open",{rslt:{obj:t}})}),n&&n.call(this,t,!0),this.__callback({obj:t})}},close_node:function(t,n){t=this.get_node(t),n=(typeof n).toLowerCase()==="undefined"?this.get_settings().core.animation:n;if(!t||!t.length||!this.is_open(t))return!1;var r=this;t.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").children("ul").stop(!0,!0).slideUp(e.jstree.IS_IE6?0:n,function(){this.style.display="",r.__trigger("__after_close",{rslt:{obj:t}})}),this.__callback({obj:t})},toggle_node:function(e){if(this.is_closed(e))return this.open_node(e);if(this.is_open(e))return this.close_node(e)},open_all:function(e,t,n){e=e?this.get_node(e):-1,e=!e||e===-1?this.get_container_ul():e,n=n||e;var r=this;e=this.is_closed(e)?e.find("li.jstree-closed").andSelf():e.find("li.jstree-closed"),e.each(function(){r.open_node(this,r.is_loaded(this)?!1:function(e){this.open_all(e,t,n)},t||0)}),n.find("li.jstree-closed").length===0&&this.__callback({obj:n})},close_all:function(e,t){e=e?this._get_node(e):-1;var n=!e||e===-1?this.get_container_ul():e,r=this;n=this.is_open(n)?n.find("li.jstree-open").andSelf():n.find("li.jstree-open"),n.each(function(){r.close_node(this,t||0)}),this.__callback({obj:e})},clean_node:function(t){t=this.get_node(t),t=!t||t===-1?this.get_container().find("li"):t.find("li").andSelf();var n=this;return t.each(function(){var t=e(this),r=t.data("jstree"),i=r&&r.opened||t.hasClass("jstree-open")?"open":r&&r.closed||t.children("ul").length?"closed":"leaf";r&&r.opened&&delete r.opened,r&&r.closed&&delete r.closed,t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last"),t.children("a").length?e.trim(t.children("a").attr("href"))||t.children("a").attr("href","#"):(t.contents().filter(function(){return this.nodeType===3||this.tagName!=="UL"}).wrapAll(''),t.children("a").html(t.children("a").html().replace(/[\s\t\n]+$/,""))),t.children("ins.jstree-ocl").length||t.prepend(" "),t.is(":last-child")&&t.addClass("jstree-last");switch(i){case"leaf":t.addClass("jstree-leaf");break;case"closed":t.addClass("jstree-open"),n.close_node(t,0);break;case"open":t.addClass("jstree-closed"),n.open_node(t,!1,0)}})},correct_node:function(t,n){return t=this.get_node(t),!t||t===-1&&!n?!1:(t===-1?t=this.get_container().find("li"):t=n?t.find("li").andSelf():t,t.each(function(){var t=e(this);switch(!0){case t.hasClass("jstree-open")&&!t.find("> ul > li").length:t.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove();break;case t.hasClass("jstree-leaf")&&!!t.find("> ul > li").length:t.removeClass("jstree-leaf").addClass("jstree-closed")}t[t.is(":last-child")?"addClass":"removeClass"]("jstree-last")}),t)},scroll_to_node:function(t){var n=this.get_container()[0],r;if(n.scrollHeight>n.offsetHeight){t=this.get_node(t);if(!t||t===-1||!t.length||!t.is(":visible"))return;r=t.offset().top-this.get_container().offset().top,r<0&&(n.scrollTop=n.scrollTop+r-1),r+this.data.core.li_height+(n.scrollWidth>n.offsetWidth?e.jstree.SCROLLBAR_WIDTH:0)>n.offsetHeight&&(n.scrollTop=n.scrollTop+(r-n.offsetHeight+this.data.core.li_height+1+(n.scrollWidth>n.offsetWidth?e.jstree.SCROLLBAR_WIDTH:0)))}},get_state:function(){var e={open:[],scroll:{left:this.get_container().scrollLeft(),top:this.get_container().scrollTop()}};return this.get_container_ul().find(".jstree-open").each(function(){this.id&&e.open.push(this.id)}),e},set_state:function(t,n){if(t){if(e.isArray(t.open)){var r=!0,i=this;return e.each(t.open.concat([]),function(n,s){s=document.getElementById(s),s&&(i.is_loaded(s)?(i.is_closed(s)&&i.open_node(s,!1,0),e.vakata.array_remove(t.open,n)):(i.is_loading(s)||i.open_node(s,e.proxy(function(){this.set_state(t)},i),0),r=!1))}),r&&(delete t.open,this.set_state(t,n)),!1}return t.scroll?(t.scroll&&typeof t.scroll.left!="undefined"&&this.get_container().scrollLeft(t.scroll.left),t.scroll&&typeof t.scroll.top!="undefined"&&this.get_container().scrollTop(t.scroll.top),delete t.scroll,delete t.open,this.set_state(t,n),!1):e.isEmptyObject(t)?(n&&n.call(this),this.__callback(),!1):!0}return!1},refresh:function(){this.data.core.state=this.get_state(),this.load_node(-1,function(t,n){n&&this.set_state(e.extend(!0,{},this.data.core.state),function(){this.__trigger("refresh")}),this.data.core.state=null})},get_text:function(t,n){return t=this.get_node(t),!t||t===-1||!t.length?!1:(t=t.children("a:eq(0)").clone(),t.children(".jstree-icon").remove(),t=t[n?"text":"html"](),t=e("
    ")[n?"text":"html"](t),t.html())},set_text:function(e,t){e=this.get_node(e);if(!e||e===-1||!e.length)return!1;e=e.children("a:eq(0)");var n=e.children("INS").clone();return e.html(t).prepend(n),this.__callback({obj:e,text:t}),!0},parse_json:function(t){var n,r,i,s;if(e.isArray(t))return i=e("