var qq=qq||{};qq.extend=function(n,t){for(var i in t)n[i]=t[i]};qq.indexOf=function(n,t,i){if(n.indexOf)return n.indexOf(t,i);i=i||0;var r=n.length;for(i<0&&(i+=r);i<r;i++)if(i in n&&n[i]===t)return i;return-1};qq.getUniqueId=function(){var n=0;return function(){return n++}}();qq.ie=function(){return navigator.userAgent.indexOf("MSIE")!=-1};qq.safari=function(){return navigator.vendor!=undefined&&navigator.vendor.indexOf("Apple")!=-1};qq.chrome=function(){return navigator.vendor!=undefined&&navigator.vendor.indexOf("Google")!=-1};qq.firefox=function(){return navigator.userAgent.indexOf("Mozilla")!=-1&&navigator.vendor!=undefined&&navigator.vendor==""};qq.windows=function(){return navigator.platform=="Win32"};qq.attach=function(n,t,i){return n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i),function(){qq.detach(n,t,i)}};qq.detach=function(n,t,i){n.removeEventListener?n.removeEventListener(t,i,!1):n.attachEvent&&n.detachEvent("on"+t,i)};qq.preventDefault=function(n){n.preventDefault?n.preventDefault():n.returnValue=!1};qq.insertBefore=function(n,t){t.parentNode.insertBefore(n,t)};qq.remove=function(n){n.parentNode.removeChild(n)};qq.contains=function(n,t){return n==t?!0:n.contains?n.contains(t):!!(t.compareDocumentPosition(n)&8)};qq.toElement=function(){var n=document.createElement("div");return function(t){n.innerHTML=t;var i=n.firstChild;return n.removeChild(i),i}}();qq.css=function(n,t){t.opacity!=null&&typeof t.opacity!="undefined"&&typeof n.style.opacity!="string"&&typeof n.filters!="undefined"&&(t.filter="alpha(opacity="+Math.round(100*t.opacity)+")");qq.extend(n.style,t)};qq.hasClass=function(n,t){var i=new RegExp("(^| )"+t+"( |$)");return i.test(n.className)};qq.addClass=function(n,t){qq.hasClass(n,t)||(n.className+=" "+t)};qq.removeClass=function(n,t){var i=new RegExp("(^| )"+t+"( |$)");n.className=n.className.replace(i," ").replace(/^\s+|\s+$/g,"")};qq.setText=function(n,t){n.innerText=t;n.textContent=t};qq.children=function(n){for(var i=[],t=n.firstChild;t;)t.nodeType==1&&i.push(t),t=t.nextSibling;return i};qq.getByClass=function(n,t){var i;if(n.querySelectorAll)return n.querySelectorAll("."+t);var u=[],r=n.getElementsByTagName("*"),f=r.length;for(i=0;i<f;i++)qq.hasClass(r[i],t)&&u.push(r[i]);return u};qq.obj2url=function(n,t,i){var u=[],f="&",e=function(n,i){var r=t?/\[\]$/.test(t)?t:t+"["+i+"]":i;r!="undefined"&&i!="undefined"&&u.push(typeof n=="object"?qq.obj2url(n,r,!0):Object.prototype.toString.call(n)==="[object Function]"?encodeURIComponent(r)+"="+encodeURIComponent(n()):encodeURIComponent(r)+"="+encodeURIComponent(n))},o,r;if(!i&&t)f=/\?/.test(t)?/\?$/.test(t)?"":"&":"?",u.push(t),u.push(qq.obj2url(n));else if(Object.prototype.toString.call(n)==="[object Array]"&&typeof n!="undefined")for(r=0,o=n.length;r<o;++r)e(n[r],r);else if(typeof n!="undefined"&&n!==null&&typeof n=="object")for(r in n)e(n[r],r);else u.push(encodeURIComponent(t)+"="+encodeURIComponent(n));return u.join(f).replace(/^&/,"").replace(/%20/g,"+")};qq=qq||{};qq.FileUploaderBasic=function(n){this._options={debug:!1,action:"/server/upload",params:{},customHeaders:{},button:null,multiple:!0,maxConnections:3,allowedExtensions:[],acceptFiles:null,sizeLimit:0,minSizeLimit:0,abortOnFailure:!0,onSubmit:function(){},onProgress:function(){},onComplete:function(){},onCancel:function(){},onUpload:function(){},onError:function(){},messages:{typeError:"Unfortunately the file(s) you selected weren't the type we were expecting. Only {extensions} files are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(n){alert(n)},inputName:"qqfile",extraDropzones:[]};qq.extend(this._options,n);qq.extend(this,qq.DisposeSupport);this._filesInProgress=0;this._handler=this._createUploadHandler();this._options.button&&(this._button=this._createUploadButton(this._options.button));this._preventLeaveInProgress()};qq.FileUploaderBasic.prototype={setParams:function(n){this._options.params=n},getInProgress:function(){return this._filesInProgress},_createUploadButton:function(n){var i=this,t=new qq.UploadButton({element:n,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),acceptFiles:this._options.acceptFiles,onChange:function(n){i._onInputChange(n)},inputLabeledBy:$(this._options.element).attr("input-labeled-by")});return this.addDisposer(function(){t.dispose()}),t},_createUploadHandler:function(){var n=this,t;return t=qq.UploadHandlerXhr.isSupported()?"UploadHandlerXhr":"UploadHandlerForm",new qq[t]({debug:this._options.debug,action:this._options.action,encoding:this._options.encoding,maxConnections:this._options.maxConnections,customHeaders:this._options.customHeaders,inputName:this._options.inputName,extraDropzones:this._options.extraDropzones,onProgress:function(t,i,r,u){n._onProgress(t,i,r,u);n._options.onProgress(t,i,r,u)},onComplete:function(t,i,r){n._onComplete(t,i,r);n._options.onComplete(t,i,r)},onCancel:function(t,i){n._onCancel(t,i);n._options.onCancel(t,i)},onError:n._options.onError,onUpload:function(t,i,r){n._onUpload(t,i,r);n._options.onUpload(t,i,r)}})},_preventLeaveInProgress:function(){var n=this;this._attach(window,"beforeunload",function(t){if(n._filesInProgress){var t=t||window.event;return t.returnValue=n._options.messages.onLeave,n._options.messages.onLeave}})},_onSubmit:function(){this._filesInProgress++},_onProgress:function(){},_onComplete:function(n,t,i){this._filesInProgress--;i.error&&this._options.showMessage(i.error)},_onCancel:function(){this._filesInProgress--},_onUpload:function(){},_onInputChange:function(n){(!this._options.onInputChange||this._options.onInputChange(n))&&(this._handler instanceof qq.UploadHandlerXhr?this._uploadFileList(n.files):this._validateFile(n)&&this._uploadFile(n));this._button.reset()},_uploadFileList:function(n){for(var i=[],t=0;t<n.length;t++)if(this._validateFile(n[t]))i.push(n[t]);else if(this._options.abortOnFailure)return;for(t=0;t<i.length;t++)this._uploadFile(i[t])},_uploadFile:function(n){var t=this._handler.add(n),i=this._handler.getName(t);this._options.onSubmit(t,i)!==!1&&(this._onSubmit(t,i),this._handler.upload(t,this._options.params))},_validateFile:function(n){var t,i;if(n.value?t=n.value.replace(/.*(\/|\\)/,""):(t=n.fileName!==null&&n.fileName!==undefined?n.fileName:n.name,i=n.fileSize!==null&&n.fileSize!==undefined?n.fileSize:n.size),this._isAllowedExtension(t)){if(i===0)return this._error("emptyError",t),!1;if(i&&this._options.sizeLimit&&i>this._options.sizeLimit)return this._error("sizeError",t),!1;if(i&&i<this._options.minSizeLimit)return this._error("minSizeError",t),!1}else return this._error("typeError",t),!1;return!0},_error:function(n,t){function i(n,t){r=r.replace(n,t)}var r=this._options.messages[n];i("{file}",this._formatFileName(t));i("{extensions}",this._options.allowedExtensions.join(", "));i("{sizeLimit}",this._formatSize(this._options.sizeLimit));i("{minSizeLimit}",this._formatSize(this._options.minSizeLimit));this._options.showMessage(r)},_formatFileName:function(n){return n.length>33&&(n=n.slice(0,19)+"..."+n.slice(-13)),n},_isAllowedExtension:function(n){var r=-1!==n.indexOf(".")?n.replace(/.*[.]/,"").toLowerCase():"",i=this._options.allowedExtensions,t;if(!i.length)return!0;for(t=0;t<i.length;t++)if(i[t].toLowerCase()==r)return!0;return!1},_formatSize:function(n){var t=-1;do n=n/1024,t++;while(n>99);return Math.max(n,.1).toFixed(1)+["kB","MB","GB","TB","PB","EB"][t]}};qq.FileUploader=function(n){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,dragText:"Drop files here to upload",uploadButtonText:"Upload a file",cancelButtonText:"Cancel",failUploadText:"Upload failed",hideShowDropArea:!0,template:'<div class="qq-uploader"><div class="qq-upload-drop-area"><span>{dragText}<\/span><\/div><div class="qq-upload-button">{uploadButtonText}<\/div><ul class="qq-upload-list"><\/ul><\/div>',fileTemplate:'<li><span class="qq-progress-bar"><\/span><span class="qq-upload-file"><\/span><span class="qq-upload-spinner"><\/span><span class="qq-upload-size"><\/span><a class="qq-upload-cancel" href="#">{cancelButtonText}<\/a><span class="qq-upload-failed-text">{failUploadtext}<\/span><\/li>',classes:{button:"qq-upload-button",drop:"qq-upload-drop-area",dropActive:"qq-upload-drop-area-active",dropDisabled:"qq-upload-drop-area-disabled",list:"qq-upload-list",progressBar:"qq-progress-bar",file:"qq-upload-file",spinner:"qq-upload-spinner",size:"qq-upload-size",cancel:"qq-upload-cancel",success:"qq-upload-success",fail:"qq-upload-fail"},dragAndDropFile:!0,removeDragTemplate:'<div class="qq-uploader"><div class="qq-upload-button">{uploadButtonText}<\/div><ul class="qq-upload-list"><\/ul><\/div>',checkLeavingDocument:null});qq.extend(this._options,n);this._options.dragAndDropFile?(this._options.template=this._options.template.replace(/\{dragText\}/g,this._options.dragText),this._options.template=this._options.template.replace(/\{uploadButtonText\}/g,this._options.uploadButtonText)):this._options.removeDragTemplate=this._options.removeDragTemplate.replace(/\{uploadButtonText\}/g,this._options.uploadButtonText);this._options.fileTemplate=this._options.fileTemplate.replace(/\{cancelButtonText\}/g,this._options.cancelButtonText);this._options.fileTemplate=this._options.fileTemplate.replace(/\{failUploadtext\}/g,this._options.failUploadText);this._element=this._options.element;this._element.innerHTML=this._options.dragAndDropFile?this._options.template:this._options.removeDragTemplate;this._listElement=this._options.listElement||this._find(this._element,"list");this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,"button"));this._bindCancelEvent();this._setupDragDrop()};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{addExtraDropzone:function(n){this._setupExtraDropzone(n)},removeExtraDropzone:function(n){var t=this._options.extraDropzones;for(var i in t)if(t[i]===n)return this._options.extraDropzones.splice(i,1)},_leaving_document_out:function(n){return(qq.chrome()||qq.safari()&&qq.windows())&&n.clientX==0&&n.clientY==0||qq.firefox()&&!n.relatedTarget},_find:function(n,t){var i=qq.getByClass(n,this._options.classes[t])[0];if(!i)throw new Error("element not found "+t);return i},_setupExtraDropzone:function(n){this._options.extraDropzones.push(n);this._setupDropzone(n)},_setupDropzone:function(n){var t=this,i=new qq.UploadDropZone({element:n,onEnter:function(i){qq.addClass(n,t._classes.dropActive);i.stopPropagation()},onLeave:function(){},onLeaveNotDescendants:function(){qq.removeClass(n,t._classes.dropActive)},onDrop:function(i){t._options.hideShowDropArea&&(n.style.display="none");qq.removeClass(n,t._classes.dropActive);t._uploadFileList(i.dataTransfer.files)}});this._dropZone=i;this.addDisposer(function(){i.dispose()});this._options.hideShowDropArea&&(n.style.display="none")},_setupDragDrop:function(){var r,i,t,n;if(this._options.dragAndDropFile){for(r=this._find(this._element,"drop"),i=this,this._options.extraDropzones.push(r),t=this._options.extraDropzones,n=0;n<t.length;n++)this._setupDropzone(t[n]);qq.ie()||this._attach(document,"dragenter",function(u){if(i._dropZone._isValidFileDrag(u)&&!qq.hasClass(r,i._classes.dropDisabled))for(r.style.display="block",n=0;n<t.length;n++)t[n].style.display="block"});this._attach(document,"dragleave",function(r){if(i._options.checkLeavingDocument!=undefined&&i._options.checkLeavingDocument!=null&&typeof i._options.checkLeavingDocument=="function"){if(i._options.hideShowDropArea&&i._options.checkLeavingDocument(r))for(n=0;n<t.length;n++)t[n].style.display="none"}else{var u=document.elementFromPoint(r.clientX,r.clientY);if(i._options.hideShowDropArea&&qq.FileUploader.prototype._leaving_document_out(r))for(n=0;n<t.length;n++)t[n].style.display="none"}});qq.attach(document,"drop",function(r){if(i._options.hideShowDropArea)for(n=0;n<t.length;n++)t[n].style.display="none";r.preventDefault()})}},_onSubmit:function(n,t){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(n,t)},_onProgress:function(n,t,i,r){var u,f,o,e;qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);u=this._getItemByFileId(n);f=this._find(u,"size");f.style.display="inline";e=Math.round(i/r*100);o=i!=r?e+"% from "+this._formatSize(r):this._formatSize(r);this._find(u,"progressBar").style.width=e+"%";qq.setText(f,o)},_onComplete:function(n,t,i){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var r=this._getItemByFileId(n);qq.remove(this._find(r,"cancel"));qq.remove(this._find(r,"spinner"));i.success?qq.addClass(r,this._classes.success):qq.addClass(r,this._classes.fail)},_addToList:function(n,t){var i=qq.toElement(this._options.fileTemplate),r;i.qqFileId=n;r=this._find(i,"file");qq.setText(r,this._formatFileName(t));this._find(i,"size").style.display="none";this._options.multiple||this._clearList();this._listElement.appendChild(i)},_clearList:function(){this._listElement.innerHTML=""},_getItemByFileId:function(n){for(var t=this._listElement.firstChild;t;){if(t.qqFileId==n)return t;t=t.nextSibling}},_bindCancelEvent:function(){var n=this,t=this._listElement;this._attach(t,"click",function(t){var i,r,u;t=t||window.event;i=t.target||t.srcElement;qq.hasClass(i,n._classes.cancel)&&(qq.preventDefault(t),r=i.parentNode,n._handler.cancel(r.qqFileId),qq.remove(r),u=i.parentNode.closest(".qq-upload-drop-area"),console.log(u),u.hide())})}});qq.UploadDropZone=function(n){this._options={element:null,onEnter:function(){},onLeave:function(){},onLeaveNotDescendants:function(){},onDrop:function(){}};qq.extend(this._options,n);qq.extend(this,qq.DisposeSupport);this._element=this._options.element;this._disableDropOutside();this._attachEvents()};qq.UploadDropZone.prototype={_dragover_should_be_canceled:function(){return qq.safari()||qq.firefox()&&qq.windows()},_disableDropOutside:function(){qq.UploadDropZone.dropOutsideDisabled||(this._dragover_should_be_canceled?qq.attach(document,"dragover",function(n){n.preventDefault()}):qq.attach(document,"dragover",function(n){n.dataTransfer&&(n.dataTransfer.dropEffect="none",n.preventDefault())}),qq.UploadDropZone.dropOutsideDisabled=!0)},_attachEvents:function(){var n=this;n._attach(n._element,"dragover",function(t){if(n._isValidFileDrag(t)){var i=qq.ie()?null:t.dataTransfer.effectAllowed;t.dataTransfer.dropEffect=i=="move"||i=="linkMove"?"move":"copy";t.stopPropagation();t.preventDefault()}});n._attach(n._element,"dragenter",function(t){if(n._isValidFileDrag(t))n._options.onEnter(t)});n._attach(n._element,"dragleave",function(t){if(n._isValidFileDrag(t)){n._options.onLeave(t);var i=document.elementFromPoint(t.clientX,t.clientY);if(!qq.contains(this,i))n._options.onLeaveNotDescendants(t)}});n._attach(n._element,"drop",function(t){if(n._isValidFileDrag(t)){t.preventDefault();n._options.onDrop(t)}})},_isValidFileDrag:function(n){if(qq.ie())return!1;var t=n.dataTransfer,i=qq.safari();return t&&t.effectAllowed!="none"&&(t.files||!i&&t.types.contains&&t.types.contains("Files"))}};qq.UploadButton=function(n){this._options={element:null,multiple:!1,acceptFiles:null,name:"file",onChange:function(){},hoverClass:"qq-upload-button-hover",focusClass:"qq-upload-button-focus"};qq.extend(this._options,n);qq.extend(this,qq.DisposeSupport);this._element=this._options.element;qq.css(this._element,{position:"relative",overflow:"hidden",direction:"ltr"});this._input=this._createInput()};qq.UploadButton.prototype={getInput:function(){return this._input},reset:function(){this._input.parentNode&&qq.remove(this._input);qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput()},_createInput:function(){var n=document.createElement("input"),t;return this._options.multiple&&n.setAttribute("multiple","multiple"),this._options.acceptFiles&&n.setAttribute("accept",this._options.acceptFiles),n.setAttribute("type","file"),n.setAttribute("name",this._options.name),this._options.inputLabeledBy&&n.setAttribute("aria-labelledby",this._options.inputLabeledBy),qq.css(n,{position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),this._element.appendChild(n),t=this,this._attach(n,"change",function(){t._options.onChange(n)}),this._attach(n,"mouseover",function(){qq.addClass(t._element,t._options.hoverClass)}),this._attach(n,"mouseout",function(){qq.removeClass(t._element,t._options.hoverClass)}),this._attach(n,"focus",function(){qq.addClass(t._element,t._options.focusClass)}),this._attach(n,"blur",function(){qq.removeClass(t._element,t._options.focusClass)}),window.attachEvent&&n.setAttribute("tabIndex","-1"),n}};qq.UploadHandlerAbstract=function(n){this._options={debug:!1,action:"/upload.php",maxConnections:999,onProgress:function(){},onComplete:function(){},onCancel:function(){},onUpload:function(){}};qq.extend(this._options,n);this._queue=[];this._params=[]};qq.UploadHandlerAbstract.prototype={log:function(n){this._options.debug&&window.console&&console.log("[uploader] "+n)},add:function(){},upload:function(n,t){var r=this._queue.push(n),i={};qq.extend(i,t);this._params[n]=i;r<=this._options.maxConnections&&this._upload(n,this._params[n])},cancel:function(n){this._cancel(n);this._dequeue(n)},cancelAll:function(){for(var n=0;n<this._queue.length;n++)this._cancel(this._queue[n]);this._queue=[]},getName:function(){},getSize:function(){},getQueue:function(){return this._queue},_upload:function(){},_cancel:function(){},_dequeue:function(n){var r=qq.indexOf(this._queue,n),t,i;this._queue.splice(r,1);t=this._options.maxConnections;this._queue.length>=t&&r<t&&(i=this._queue[t-1],this._upload(i,this._params[i]))}};qq.UploadHandlerForm=function(){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={}};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{_detach_event:{},add:function(n){n.setAttribute("name",this._options.inputName);var t="qq-upload-handler-iframe"+qq.getUniqueId();return this._inputs[t]=n,n.parentNode&&qq.remove(n),t},getName:function(n){return this._inputs[n].value.replace(/.*(\/|\\)/,"")},_cancel:function(n){this._options.onCancel(n,this.getName(n));delete this._inputs[n];var t=document.getElementById(n);t&&(t.setAttribute("src","javascript:false;"),qq.remove(t))},_upload:function(n,t){var u,i;this._options.onUpload(n,this.getName(n),!1);if(u=this._inputs[n],!u)throw new Error("file with passed id was not added, or already uploaded or cancelled");var e=this.getName(n),r=this._createIframe(n),f=this._createForm(r,t);return f.appendChild(u),i=this,this._attachLoadEvent(r,function(){i.log("iframe loaded");var t=i._getIframeContentJSON(r);i._options.onComplete(n,e,t);i._dequeue(n);delete i._inputs[n];setTimeout(function(){i._detach_event[r.id]();delete i._detach_event[r.id];qq.remove(r)},1)}),f.submit(),qq.remove(f),n},_attachLoadEvent:function(n,t){this._detach_event[n.id]=qq.attach(n,"load",function(){n.parentNode&&(n.contentDocument&&n.contentDocument.body&&n.contentDocument.body.innerHTML=="false"||t())})},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response,innerHTML=doc.body.innerHTML;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+innerHTML);innerHTML.slice(0,5).toLowerCase()=="<pre>"&&innerHTML.slice(-6).toLowerCase()=="<\/pre>"&&(innerHTML=doc.body.firstChild.firstChild.nodeValue);try{response=eval("("+innerHTML+")")}catch(err){response={}}return response},_createIframe:function(n){var t=qq.toElement('<iframe src="javascript:false;" name="'+n+'" />');return t.setAttribute("id",n),t.style.display="none",document.body.appendChild(t),t},_createForm:function(n,t){var i=qq.toElement('<form method="post" enctype="multipart/form-data"><\/form>'),r=qq.obj2url(t,this._options.action);return i.setAttribute("action",r),i.setAttribute("target",n.name),i.style.display="none",document.body.appendChild(i),i}});qq.UploadHandlerXhr=function(){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[]};qq.UploadHandlerXhr.isSupported=function(){var n=document.createElement("input");return n.type="file","multiple"in n&&typeof File!="undefined"&&typeof FormData!="undefined"&&typeof(new XMLHttpRequest).upload!="undefined"};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(n){if(!(n instanceof File))throw new Error("Passed obj in not a File (in qq.UploadHandlerXhr)");return this._files.push(n)-1},getName:function(n){var t=this._files[n];return t.fileName!==null&&t.fileName!==undefined?t.fileName:t.name},getSize:function(n){var t=this._files[n];return t.fileSize!=null?t.fileSize:t.size},getLoaded:function(n){return this._loaded[n]||0},_upload:function(n,t){var i,r,o,f;this._options.onUpload(n,this.getName(n),!0);var u=this._files[n],e=this.getName(n),s=this.getSize(n);this._loaded[n]=0;i=this._xhrs[n]=new XMLHttpRequest;r=this;i.upload.onprogress=function(t){if(t.lengthComputable){r._loaded[n]=t.loaded;r._options.onProgress(n,e,t.loaded,t.total)}};i.onreadystatechange=function(){i.readyState==4&&r._onComplete(n,i)};t=t||{};t[this._options.inputName]=e;o=qq.obj2url(t,this._options.action);i.open("POST",o,!0);i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.setRequestHeader("X-File-Name",encodeURIComponent(e));this._options.encoding=="multipart"?(f=new FormData,f.append(this._options.inputName,u),u=f):(i.setRequestHeader("Content-Type","application/octet-stream"),i.setRequestHeader("X-Mime-Type",u.type));for(key in this._options.customHeaders)i.setRequestHeader(key,this._options.customHeaders[key]);i.send(u)},_onComplete:function(id,xhr){var name,size,response;if(this._files[id]){name=this.getName(id);size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);try{response=eval("("+xhr.responseText+")")}catch(err){response={}}this._options.onComplete(id,name,response)}else{this._options.onError(id,name,xhr);this._options.onComplete(id,name,{})}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id)}},_cancel:function(n){this._options.onCancel(n,this.getName(n));this._files[n]=null;this._xhrs[n]&&(this._xhrs[n].abort(),this._xhrs[n]=null)}});qq.DisposeSupport={_disposers:[],dispose:function(){for(var n;n=this._disposers.shift();)n()},addDisposer:function(n){this._disposers.push(n)},_attach:function(){this.addDisposer(qq.attach.apply(this,arguments))}},function(n){function t(t){if(typeof t.data=="string"){var r=t.handler,i=t.data.toLowerCase().split(" ");t.handler=function(t){var o,h;if(this===t.target||!/textarea|select/i.test(t.target.nodeName)&&t.target.type!=="text"){var f=t.type!=="keypress"&&n.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),u="",e={};for(t.altKey&&f!=="alt"&&(u+="alt+"),t.ctrlKey&&f!=="ctrl"&&(u+="ctrl+"),t.metaKey&&!t.ctrlKey&&f!=="meta"&&(u+="meta+"),t.shiftKey&&f!=="shift"&&(u+="shift+"),f?e[u+f]=!0:(e[u+s]=!0,e[u+n.hotkeys.shiftNums[s]]=!0,u==="shift+"&&(e[n.hotkeys.shiftNums[s]]=!0)),o=0,h=i.length;o<h;o++)if(e[i[o]])return r.apply(this,arguments)}}}}n.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};n.each(["keydown","keyup","keypress"],function(){n.event.special[this]={add:t}})}(jQuery),function(){if(!jQuery||!jQuery.jstree){var n=!1,t=!1,i=!1;(function(r){r.vakata={};r.vakata.css={get_css:function(n,t,i){n=n.toLowerCase();var u=i.cssRules||i.rules,r=0;do{if(u.length&&r>u.length+5)return!1;if(u[r].selectorText&&u[r].selectorText.toLowerCase()==n)return t===!0?(i.removeRule&&i.removeRule(r),i.deleteRule&&i.deleteRule(r),!0):u[r]}while(u[++r]);return!1},add_css:function(n,t){return r.jstree.css.get_css(n,!1,t)?!1:(t.insertRule?t.insertRule(n+" { }",0):t.addRule(n,null,0),r.vakata.css.get_css(n))},remove_css:function(n,t){return r.vakata.css.get_css(n,!0,t)},add_sheet:function(n){var t=!1,i=!0;if(n.str)return n.title&&(t=r("style[id='"+n.title+"-stylesheet']")[0]),t?i=!1:(t=document.createElement("style"),t.setAttribute("type","text/css"),n.title&&t.setAttribute("id",n.title+"-stylesheet")),t.styleSheet?i?(document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet.cssText=n.str):t.styleSheet.cssText=t.styleSheet.cssText+" "+n.str:(t.appendChild(document.createTextNode(n.str)),document.getElementsByTagName("head")[0].appendChild(t)),t.sheet||t.styleSheet;if(n.url)if(document.createStyleSheet)try{t=document.createStyleSheet(n.url)}catch(u){}else return t=document.createElement("link"),t.rel="stylesheet",t.type="text/css",t.media="all",t.href=n.url,document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet}};var u=[],e=-1,o={},f={};r.fn.jstree=function(n){var f=typeof n=="string",i=Array.prototype.slice.call(arguments,1),t=this;if(f){if(n.substring(0,1)=="_")return t;this.each(function(){var f=u[r.data(this,"jstree_instance_id")],e=f&&r.isFunction(f[n])?f[n].apply(f,i):f;if(typeof e!="undefined"&&(n.indexOf("is_")===0||e!==!0&&e!==!1))return t=e,!1})}else this.each(function(){var t=r.data(this,"jstree_instance_id"),s=[],f=n?r.extend({},!0,n):{},h=r(this),e=!1,c=[];s=s.concat(i);h.data("jstree")&&s.push(h.data("jstree"));f=s.length?r.extend.apply(null,[!0,f].concat(s)):f;typeof t!="undefined"&&u[t]&&u[t].destroy();t=parseInt(u.push({}),10)-1;r.data(this,"jstree_instance_id",t);f.plugins=r.isArray(f.plugins)?f.plugins:r.jstree.defaults.plugins.slice();f.plugins.unshift("core");f.plugins=f.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");e=r.extend(!0,{},r.jstree.defaults,f);e.plugins=f.plugins;r.each(o,function(n){r.inArray(n,e.plugins)===-1?(e[n]=null,delete e[n]):c.push(n)});e.plugins=c;u[t]=new r.jstree._instance(t,r(this).addClass("jstree jstree-"+t),e);r.each(u[t]._get_settings().plugins,function(n,i){u[t].data[i]={}});r.each(u[t]._get_settings().plugins,function(n,i){o[i]&&o[i].__init.apply(u[t])});setTimeout(function(){u[t]&&u[t].init()},0)});return t};r.jstree={defaults:{plugins:[]},_focused:function(){return u[e]||null},_reference:function(n){if(u[n])return u[n];var t=r(n);return(t.length||typeof n!="string"||(t=r("#"+n)),!t.length)?null:u[t.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(n,t,i){this.data={core:{}};this.get_settings=function(){return r.extend(!0,{},i)};this._get_settings=function(){return i};this.get_index=function(){return n};this.get_container=function(){return t};this.get_container_ul=function(){return t.children("ul:eq(0)")};this._set_settings=function(n){i=r.extend(!0,{},i,n)}},_fn:{},plugin:function(n,t){t=r.extend({},{__init:r.noop,__destroy:r.noop,_fn:{},defaults:!1},t);o[n]=t;r.jstree.defaults[n]=t.defaults;r.each(t._fn,function(t,i){i.plugin=n;i.old=r.jstree._fn[t];r.jstree._fn[t]=function(){var u,n=i,f=Array.prototype.slice.call(arguments),o=new r.Event("before.jstree"),e=!1;if(this.data.core.locked!==!0||t==="unlock"||t==="is_locked"){do{if(n&&n.plugin&&r.inArray(n.plugin,this._get_settings().plugins)!==-1)break;n=n.old}while(n);if(n){if(t.indexOf("_")===0)u=n.apply(this,f);else{if(u=this.get_container().triggerHandler(o,{func:t,inst:this,args:f,plugin:n.plugin}),u===!1)return;typeof u!="undefined"&&(f=u);u=n.apply(r.extend({},this,{__callback:function(n){this.get_container().triggerHandler(t+".jstree",{inst:this,args:f,rslt:n,rlbk:e})},__rollback:function(){return e=this.get_rollback()},__call_old:function(t){return n.old.apply(this,t?Array.prototype.slice.call(arguments,1):f)}}),f)}return u}}};r.jstree._fn[t].old=i.old;r.jstree._fn[t].plugin=n})},rollback:function(n){n&&(r.isArray(n)||(n=[n]),r.each(n,function(n,t){u[t.i].set_rollback(t.h,t.d)}))}};r.jstree._fn=r.jstree._instance.prototype={};r(function(){var u=navigator.userAgent.toLowerCase(),e=(u.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],f=".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; white-space:nowrap; margin-left:18px; min-width: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:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; 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(u)&&parseInt(e,10)==6){n=!0;try{document.execCommand("BackgroundImageCache",!1,!0)}catch(o){}f+=".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; } "}/msie/.test(u)&&parseInt(e,10)==7&&(t=!0,f+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } ");!/compatible/.test(u)&&/mozilla/.test(u)&&parseFloat(e,10)<1.9&&(i=!0,f+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ");r.vakata.css.add_sheet({str:f,title:"jstree"})});r.jstree.plugin("core",{__init:function(){this.data.core.locked=!1;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:!1,animation:500,initially_open:[],initially_load:[],open_parents:!0,notify_plugins:!0,rtl:!1,load_open:!1,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_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_string("loading")+"<\/a><\/li><\/ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",r.proxy(function(n){var t=r(n.target);this.toggle_node(t)},this)).bind("mousedown.jstree",r.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(){var n;if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){n=window.getSelection();try{n.removeAllRanges();n.collapse()}catch(t){}}});this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",r.proxy(function(n,t){var i=this._get_node(t.rslt.obj),u=this;(i===-1&&(i=this.get_container_ul()),i.length)&&i.find("li").each(function(){var n=r(this);n.data("jstree")&&r.each(n.data("jstree"),function(t,i){u.data[t]&&r.isFunction(u["_"+t+"_notify"])&&u["_"+t+"_notify"].call(u,n,i)})})},this));this._get_settings().core.load_open&&this.get_container().bind("load_node.jstree",r.proxy(function(n,t){var i=this._get_node(t.rslt.obj),u=this;(i===-1&&(i=this.get_container_ul()),i.length)&&i.find("li.jstree-open:not(:has(ul))").each(function(){u.load_node(this,r.noop,r.noop)})},this));this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var t,n=this.get_index(),i=this._get_settings(),f=this;if(r.each(i.plugins,function(n,t){try{o[t].__destroy.apply(f)}catch(i){}}),this.__callback(),this.is_focused())for(t in u)if(u.hasOwnProperty(t)&&t!=n){u[t].set_focus();break}n===e&&(e=-1);this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});r(document).unbind(".jstree-"+n).undelegate(".jstree-"+n);u[n]=null;delete u[n]},_core_notify:function(n,t){t.opened&&this.open_node(n,!1,!0)},lock:function(){this.data.core.locked=!0;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=!1;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var n=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){this.id&&n.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))});this.__callback(n.data.core.to_open)},save_loaded:function(){},reload_nodes:function(n){var t=this,u=!0,i=[],f=[];n||(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=r.map(r.makeArray(this.data.core.to_open),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_load=r.map(r.makeArray(this.data.core.to_load),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_open.length&&(this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)));this.data.core.to_load.length&&(r.each(this.data.core.to_load,function(n,t){if(t=="#")return!0;r(t).length?i.push(t):f.push(t)}),i.length&&(this.data.core.to_load=f,r.each(i,function(n,i){t._is_loaded(i)||(t.load_node(i,function(){t.reload_nodes(!0)},function(){t.reload_nodes(!0)}),u=!1)})));this.data.core.to_open.length&&r.each(this.data.core.to_open,function(n,i){t.open_node(i,!1,!0)});u&&(this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){t.__callback({},t)},50),this.data.core.refreshing=!1,this.reopen())},reopen:function(){var n=this;this.data.core.to_open.length&&r.each(this.data.core.to_open,function(t,i){n.open_node(i,!1,!0)});this.__callback({})},refresh:function(n){var t=this;this.save_opened();n||(n=-1);n=this._get_node(n);n||(n=-1);n!==-1?n.children("UL").remove():this.get_container_ul().empty();this.load_node(n,function(){t.__callback({obj:n});t.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(!this.is_focused()){var n=r.jstree._focused();n&&n.unset_focus();this.get_container().addClass("jstree-focused");e=this.get_index();this.__callback()}},is_focused:function(){return e==this.get_index()},unset_focus:function(){this.is_focused()&&(this.get_container().removeClass("jstree-focused"),e=-1);this.__callback()},_get_node:function(n){var t=r(n,this.get_container());return t.is(".jstree")||n==-1?-1:(t=t.closest("li",this.get_container()),t.length?t:!1)},_get_next:function(n,t){return(n=this._get_node(n),n===-1)?this.get_container().find("> ul > li:first-child"):n.length?t?n.nextAll("li").size()>0?n.nextAll("li:eq(0)"):!1:n.hasClass("jstree-open")?n.find("li:eq(0)"):n.nextAll("li").size()>0?n.nextAll("li:eq(0)"):n.parentsUntil(".jstree","li").next("li").eq(0):!1},_get_prev:function(n,t){if(n=this._get_node(n),n===-1)return this.get_container().find("> ul > li:last-child");if(!n.length)return!1;if(t)return n.prevAll("li").length>0?n.prevAll("li:eq(0)"):!1;if(n.prev("li").length){for(n=n.prev("li").eq(0);n.hasClass("jstree-open");)n=n.children("ul:eq(0)").children("li:last");return n}var i=n.parentsUntil(".jstree","li:eq(0)");return i.length?i:!1},_get_parent:function(n){if(n=this._get_node(n),n==-1||!n.length)return!1;var t=n.parentsUntil(".jstree","li:eq(0)");return t.length?t:-1},_get_children:function(n){return(n=this._get_node(n),n===-1)?this.get_container().children("ul:eq(0)").children("li"):n.length?n.children("ul:eq(0)").children("li"):!1},get_path:function(n,t){var i=[],r=this;return(n=this._get_node(n),n===-1||!n||!n.length)?!1:(n.parentsUntil(".jstree","li").each(function(){i.push(t?this.id:r.get_text(this))}),i.reverse(),i.push(t?n.attr("id"):this.get_text(n)),i)},_get_string:function(n){return this._get_settings().core.strings[n]||n},is_open:function(n){return n=this._get_node(n),n&&n!==-1&&n.hasClass("jstree-open")},is_closed:function(n){return n=this._get_node(n),n&&n!==-1&&n.hasClass("jstree-closed")},is_leaf:function(n){return n=this._get_node(n),n&&n!==-1&&n.hasClass("jstree-leaf")},correct_state:function(n){if(n=this._get_node(n),!n||n===-1)return!1;n.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:n})},open_node:function(t,i,r){if(t=this._get_node(t),!t.length)return!1;if(!t.hasClass("jstree-closed"))return i&&i.call(),!1;var f=r||n?0:this._get_settings().core.animation,u=this;this._is_loaded(t)?(this._get_settings().core.open_parents&&t.parentsUntil(".jstree",".jstree-closed").each(function(){u.open_node(this,!1,!0)}),f&&t.children("ul").css("display","none"),t.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"),f?t.children("ul").stop(!0,!0).slideDown(f,function(){this.style.display="";u.after_open(t)}):u.after_open(t),this.__callback({obj:t}),i&&i.call()):(t.children("a").addClass("jstree-loading"),this.load_node(t,function(){u.open_node(t,i,r)},i))},after_open:function(n){this.__callback({obj:n})},close_node:function(t,i){t=this._get_node(t);var r=i||n?0:this._get_settings().core.animation,u=this;if(!t.length||!t.hasClass("jstree-open"))return!1;r&&t.children("ul").attr("style","display:block !important");t.removeClass("jstree-open").addClass("jstree-closed");r?t.children("ul").stop(!0,!0).slideUp(r,function(){this.style.display="";u.after_close(t)}):u.after_close(t);this.__callback({obj:t})},after_close:function(n){this.__callback({obj:n})},toggle_node:function(n){return(n=this._get_node(n),n.hasClass("jstree-closed"))?this.open_node(n):n.hasClass("jstree-open")?this.close_node(n):void 0},open_all:function(n,t,i){n=n?this._get_node(n):-1;n&&n!==-1||(n=this.get_container_ul());i?n=n.find("li.jstree-closed"):(i=n,n=n.is(".jstree-closed")?n.find("li.jstree-closed").addBack():n.find("li.jstree-closed"));var r=this;n.each(function(){var n=this;r._is_loaded(this)?r.open_node(this,!1,!t):r.open_node(this,function(){r.open_all(n,t,i)},!t)});i.find("li.jstree-closed").length===0&&this.__callback({obj:i})},close_all:function(n,t){var i=this;n=n?this._get_node(n):this.get_container();n&&n!==-1||(n=this.get_container_ul());n.find("li.jstree-open").addBack().each(function(){i.close_node(this,!t)});this.__callback({obj:n})},clean_node:function(n){n=n&&n!=-1?r(n):this.get_container_ul();n=n.is("li")?n.find("li").addBack():n.find("li");n.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");n.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:n})},get_rollback:function(){return this.__callback(),{i:this.get_index(),h:this.get_container().children("ul").clone(!0),d:this.data}},set_rollback:function(n,t){this.get_container().empty().append(n);this.data=t;this.__callback()},load_node:function(n){this.__callback({obj:n})},_is_loaded:function(){return!0},create_node:function(n,t,i,u,f){n=this._get_node(n);t=typeof t=="undefined"?"last":t;var o=r("<li />"),s=this._get_settings().core,e;if(n!==-1&&!n.length)return!1;if(!f&&!this._is_loaded(n))return this.load_node(n,function(){this.create_node(n,t,i,u,!0)}),!1;this.__rollback();typeof i=="string"&&(i={data:i});i||(i={});i.attr&&o.attr(i.attr);i.metadata&&o.data(i.metadata);i.state&&o.addClass("jstree-"+i.state);i.data||(i.data=this._get_string("new_node"));r.isArray(i.data)||(e=i.data,i.data=[],i.data.push(e));r.each(i.data,function(n,t){e=r("<a />");r.isFunction(t)&&(t=t.call(this,i));typeof t=="string"?e.attr("href","#")[s.html_titles?"html":"text"](t):(t.attr||(t.attr={}),t.attr.href||(t.attr.href="#"),e.attr(t.attr)[s.html_titles?"html":"text"](t.title),t.language&&e.addClass(t.language));e.prepend("<ins class='jstree-icon'>&#160;<\/ins>");!t.icon&&i.icon&&(t.icon=i.icon);t.icon&&(t.icon.indexOf("/")===-1?e.children("ins").addClass(t.icon):e.children("ins").css("background","url('"+t.icon+"') center center no-repeat"));o.append(e)});o.prepend("<ins class='jstree-icon'>&#160;<\/ins>");n===-1&&(n=this.get_container(),t==="before"&&(t="first"),t==="after"&&(t="last"));switch(t){case"before":n.before(o);e=this._get_parent(n);break;case"after":n.after(o);e=this._get_parent(n);break;case"inside":case"first":n.children("ul").length||n.append("<ul />");n.children("ul").prepend(o);e=n;break;case"last":n.children("ul").length||n.append("<ul />");n.children("ul").append(o);e=n;break;default:n.children("ul").length||n.append("<ul />");t||(t=0);e=n.children("ul").children("li").eq(t);e.length?e.before(o):n.children("ul").append(o);e=n}return(e===-1||e.get(0)===this.get_container().get(0))&&(e=-1),this.clean_node(e),this.__callback({obj:o,parent:e}),u&&u.call(this,o),o},get_text:function(n){if(n=this._get_node(n),!n.length)return!1;var t=this._get_settings().core.html_titles;return n=n.children("a:eq(0)"),t?(n=n.clone(),n.children("INS").remove(),n.html()):(n=n.contents().filter(function(){return this.nodeType==3})[0],n.nodeValue)},set_text:function(n,t){if(n=this._get_node(n),!n.length)return!1;if(n=n.children("a:eq(0)"),this._get_settings().core.html_titles){var i=n.children("INS").clone();return n.html(t).prepend(i),this.__callback({obj:n,name:t}),!0}return n=n.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:n,name:t}),n.nodeValue=t},rename_node:function(n,t){n=this._get_node(n);this.__rollback();n&&n.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))&&this.__callback({obj:n,name:t})},delete_node:function(n){if(n=this._get_node(n),!n.length)return!1;this.__rollback();var t=this._get_parent(n),i=r([]),u=this;return n.each(function(){i=i.add(u._get_prev(this))}),n=n.detach(),t!==-1&&t.find("> ul > li").length===0&&t.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"),this.clean_node(t),this.__callback({obj:n,prev:i,parent:t}),n},prepare_move:function(n,t,i,u,e){var o={};if(o.ot=r.jstree._reference(n)||this,o.o=o.ot._get_node(n),o.r=t===-1?-1:this._get_node(t),o.p=typeof i=="undefined"||i===!1?"last":i,!e&&f.o&&f.o[0]===o.o[0]&&f.r[0]===o.r[0]&&f.p===o.p){this.__callback(f);u&&u.call(this,f);return}if(o.ot=r.jstree._reference(o.o)||this,o.rt=r.jstree._reference(o.r)||this,o.r!==-1&&o.r){if(!/^(before|after)$/.test(o.p)&&!this._is_loaded(o.r))return this.load_node(o.r,function(){this.prepare_move(n,t,i,u,!0)});switch(o.p){case"before":o.cp=o.r.index();o.cr=o.rt._get_parent(o.r);break;case"after":o.cp=o.r.index()+1;o.cr=o.rt._get_parent(o.r);break;case"inside":case"first":o.cp=0;o.cr=o.r;break;case"last":o.cp=o.r.find(" > ul > li").length;o.cr=o.r;break;default:o.cp=o.p;o.cr=o.r}}else{o.cr=-1;switch(o.p){case"first":case"before":case"inside":o.cp=0;break;case"after":case"last":o.cp=o.rt.get_container().find(" > ul > li").length;break;default:o.cp=o.p}}o.np=o.cr==-1?o.rt.get_container():o.cr;o.op=o.ot._get_parent(o.o);o.cop=o.o.index();o.op===-1&&(o.op=o.ot?o.ot.get_container():this.get_container());!/^(before|after)$/.test(o.p)&&o.op&&o.np&&o.op[0]===o.np[0]&&o.o.index()<o.cp&&o.cp++;o.or=o.np.find(" > ul > li:nth-child("+(o.cp+1)+")");f=o;this.__callback(f);u&&u.call(this,f)},check_move:function(){var n=f,t=!0,i=n.r===-1?this.get_container():n.r;if(!n||!n.o||n.or[0]===n.o[0])return!1;if(!n.cy){if(n.op&&n.np&&n.op[0]===n.np[0]&&n.cp-1===n.o.index())return!1;n.o.each(function(){if(i.parentsUntil(".jstree","li").addBack().index(this)!==-1)return t=!1,!1})}return t},move_node:function(n,t,i,u,e,o){if(!e)return this.prepare_move(n,t,i,function(n){this.move_node(n,!1,!1,u,!0,o)});if(u&&(f.cy=!0),!o&&!this.check_move())return!1;this.__rollback();var s=!1;u?(s=n.o.clone(!0),s.find("*[id]").addBack().each(function(){this.id&&(this.id="copy_"+this.id)})):s=n.o;n.or.length?n.or.before(s):(n.np.children("ul").length||r("<ul />").appendTo(n.np),n.np.children("ul:eq(0)").append(s));try{n.ot.clean_node(n.op);n.rt.clean_node(n.np);n.op.find("> ul > li").length||n.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(h){}return u&&(f.cy=!0,f.oc=s),this.__callback(f),f},_get_move:function(){return f}}})})(jQuery),function(n){var i,t,r;n(function(){/msie/.test(navigator.userAgent.toLowerCase())?(t=n('<textarea cols="10" rows="2"><\/textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),r=n('<textarea cols="10" rows="2" style="overflow: hidden;"><\/textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),i=t.width()-r.width(),t.add(r).remove()):(t=n("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}),i=100-t.width(),t.parent().remove())});n.jstree.plugin("ui",{__init:function(){this.data.ui.selected=n();this.data.ui.last_selected=!1;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",n.proxy(function(t){t.preventDefault();t.currentTarget.blur();n(t.currentTarget).hasClass("jstree-loading")||this.select_node(t.currentTarget,!0,t)},this)).delegate("a","mouseenter.jstree",n.proxy(function(t){n(t.currentTarget).hasClass("jstree-loading")||this.hover_node(t.target)},this)).delegate("a","mouseleave.jstree",n.proxy(function(t){n(t.currentTarget).hasClass("jstree-loading")||this.dehover_node(t.target)},this)).bind("reopen.jstree",n.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",n.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",n.proxy(function(){this.reselect()},this)).bind("close_node.jstree",n.proxy(function(t,i){var u=this._get_settings().ui,r=this._get_node(i.rslt.obj),f=r&&r.length?r.children("ul").find("a.jstree-clicked"):n(),e=this;u.selected_parent_close!==!1&&f.length&&f.each(function(){e.deselect_node(this);u.selected_parent_close==="select_parent"&&e.select_node(r)})},this)).bind("delete_node.jstree",n.proxy(function(n,t){var f=this._get_settings().ui.select_prev_on_delete,i=this._get_node(t.rslt.obj),r=i&&i.length?i.find("a.jstree-clicked"):[],u=this;r.each(function(){u.deselect_node(this)});f&&r.length&&t.rslt.prev.each(function(){if(this.parentNode)return u.select_node(this),!1})},this)).bind("move_node.jstree",n.proxy(function(n,t){t.rslt.cy&&t.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:!0,select_prev_on_delete:!0,disable_selecting_children:!1,initially_select:[]},_fn:{_get_node:function(t,i){if(typeof t=="undefined"||t===null)return i?this.data.ui.selected:this.data.ui.last_selected;var r=n(t,this.get_container());return r.is(".jstree")||t==-1?-1:(r=r.closest("li",this.get_container()),r.length?r:!1)},_ui_notify:function(n,t){t.selected&&this.select_node(n,!1)},save_selected:function(){var n=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){this.id&&n.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))});this.__callback(this.data.ui.to_select)},reselect:function(){var i=this,t=this.data.ui.to_select;t=n.map(n.makeArray(t),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});n.each(t,function(n,t){t&&t!=="#"&&i.select_node(t)});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(){return this.save_selected(),this.__call_old()},hover_node:function(n){if(n=this._get_node(n),!n.length)return!1;n.hasClass("jstree-hovered")||this.dehover_node();this.data.ui.hovered=n.children("a").addClass("jstree-hovered").parent();this._fix_scroll(n);this.__callback({obj:n})},dehover_node:function(){var n=this.data.ui.hovered,t;if(!n||!n.length)return!1;t=n.children("a").removeClass("jstree-hovered").parent();this.data.ui.hovered[0]===t[0]&&(this.data.ui.hovered=null);this.__callback({obj:n})},select_node:function(n,t,i){if(n=this._get_node(n),n==-1||!n||!n.length)return!1;var r=this._get_settings().ui,e=r.select_multiple_modifier=="on"||r.select_multiple_modifier!==!1&&i&&i[r.select_multiple_modifier+"Key"],s=r.select_range_modifier!==!1&&i&&i[r.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==n[0]&&this.data.ui.last_selected.parent()[0]===n.parent()[0],u=this.is_selected(n),f=!0,o=this;if(t){if(r.disable_selecting_children&&e&&(n.parentsUntil(".jstree","li").children("a.jstree-clicked").length||n.children("ul").find("a.jstree-clicked:eq(0)").length))return!1;f=!1;switch(!0){case s:this.data.ui.last_selected.addClass("jstree-last-selected");n=n[n.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").addBack();r.select_limit==-1||n.length<r.select_limit?(this.data.ui.last_selected.removeClass("jstree-last-selected"),this.data.ui.selected.each(function(){this!==o.data.ui.last_selected[0]&&o.deselect_node(this)}),u=!1,f=!0):f=!1;break;case u&&!e:this.deselect_all();u=!1;f=!0;break;case!u&&!e:(r.select_limit==-1||r.select_limit>0)&&(this.deselect_all(),f=!0);break;case u&&e:this.deselect_node(n);break;case!u&&e:(r.select_limit==-1||this.data.ui.selected.length+1<=r.select_limit)&&(f=!0)}}f&&!u&&(s||(this.data.ui.last_selected=n),n.children("a").addClass("jstree-clicked"),r.selected_parent_open&&n.parents(".jstree-closed").each(function(){o.open_node(this,!1,!0)}),this.data.ui.selected=this.data.ui.selected.add(n),this._fix_scroll(n.eq(0)),this.__callback({obj:n,e:i}))},_fix_scroll:function(n){var t=this.get_container()[0],r;if(t.scrollHeight>t.offsetHeight){if(n=this._get_node(n),!n||n===-1||!n.length||!n.is(":visible"))return;r=n.offset().top-this.get_container().offset().top;r<0&&(t.scrollTop=t.scrollTop+r-1);r+this.data.core.li_height+(t.scrollWidth>t.offsetWidth?i:0)>t.offsetHeight&&(t.scrollTop=t.scrollTop+(r-t.offsetHeight+this.data.core.li_height+1+(t.scrollWidth>t.offsetWidth?i:0)))}},deselect_node:function(n){if(n=this._get_node(n),!n.length)return!1;this.is_selected(n)&&(n.children("a").removeClass("jstree-clicked"),this.data.ui.selected=this.data.ui.selected.not(n),this.data.ui.last_selected.get(0)===n.get(0)&&(this.data.ui.last_selected=this.data.ui.selected.eq(0)),this.__callback({obj:n}))},toggle_select:function(n){if(n=this._get_node(n),!n.length)return!1;this.is_selected(n)?this.deselect_node(n):this.select_node(n)},is_selected:function(n){return this.data.ui.selected.index(this._get_node(n))>=0},get_selected:function(t){return t?n(t).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(t){var i=t?n(t).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();i.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=n([]);this.data.ui.last_selected=!1;this.__callback({obj:i})}}});n.jstree.defaults.plugins.push("ui")}(jQuery),function(n){n.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",n.proxy(function(n,t){if(this._get_settings().crrm.move.open_onmove){var i=this;t.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function(){i.open_node(this,!1,!0)})}},this))},defaults:{input_width_limit:200,move:{always_copy:!1,open_onmove:!0,default_position:"last",check_move:function(){return!0}}},_fn:{_show_input:function(t,i){t=this._get_node(t);var e=this._get_settings().core.rtl,o=this._get_settings().crrm.input_width_limit,s=t.children("ins").width(),h=t.find("> a:visible > ins").width()*t.find("> a:visible > ins").length,u=this.get_text(t),f=n("<div />",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),r=t.css("position","relative").append(n("<input />",{value:u,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:e?"auto":s+h+4+"px",right:e?s+h+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:n.proxy(function(){var r=t.children(".jstree-rename-input"),n=r.val();n===""&&(n=u);f.remove();r.remove();this.set_text(t,u);this.rename_node(t,n);i.call(this,t,n,u);t.css("position","")},this),keyup:function(n){var t=n.keyCode||n.which;if(t==27){this.value=u;this.blur();return}if(t==13){this.blur();return}r.width(Math.min(f.text("pW"+this.value).width(),o))},keypress:function(n){var t=n.keyCode||n.which;if(t==13)return!1}})).children(".jstree-rename-input");this.set_text(t,"");f.css({fontFamily:r.css("fontFamily")||"",fontSize:r.css("fontSize")||"",fontWeight:r.css("fontWeight")||"",fontStyle:r.css("fontStyle")||"",fontStretch:r.css("fontStretch")||"",fontVariant:r.css("fontVariant")||"",letterSpacing:r.css("letterSpacing")||"",wordSpacing:r.css("wordSpacing")||""});r.width(Math.min(f.text("pW"+r[0].value).width(),o))[0].select()},rename:function(n){n=this._get_node(n);this.__rollback();var t=this.__callback;this._show_input(n,function(n,i,r){t.call(this,{obj:n,new_name:i,old_name:r})})},create:function(t,i,r,u,f){var e=this;return t=this._get_node(t),t||(t=-1),this.__rollback(),this.create_node(t,i,r,function(t){var i=this._get_parent(t),r=n(t).index();u&&u.call(this,t);i.length&&i.hasClass("jstree-closed")&&this.open_node(i,!1,!0);f?e.__callback({obj:t,name:this.get_text(t),parent:i,position:r}):this._show_input(t,function(n,t){e.__callback({obj:n,name:t,parent:i,position:r})})})},remove:function(n){n=this._get_node(n,!0);var t=this._get_parent(n),i=this._get_prev(n);this.__rollback();n=this.delete_node(n);n!==!1&&this.__callback({obj:n,prev:i,parent:t})},check_move:function(){if(!this.__call_old())return!1;var n=this._get_settings().crrm.move;return n.check_move.call(this,this._get_move())?!0:!1},move_node:function(n,t,i,r,u,f){var e=this._get_settings().crrm.move;if(!u)return typeof i=="undefined"&&(i=e.default_position),i!=="inside"||e.default_position.match(/^(before|after)$/)||(i=e.default_position),this.__call_old(!0,n,t,i,r,!1,f);(e.always_copy===!0||e.always_copy==="multitree"&&n.rt.get_index()!==n.ot.get_index())&&(r=!0);this.__call_old(!0,n,t,i,r,!0,f)},cut:function(n){if(n=this._get_node(n,!0),!n||!n.length)return!1;this.data.crrm.cp_nodes=!1;this.data.crrm.ct_nodes=n;this.__callback({obj:n})},copy:function(n){if(n=this._get_node(n,!0),!n||!n.length)return!1;this.data.crrm.ct_nodes=!1;this.data.crrm.cp_nodes=n;this.__callback({obj:n})},paste:function(n){if(n=this._get_node(n),!n||!n.length)return!1;var t=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes)return!1;this.data.crrm.ct_nodes&&(this.move_node(this.data.crrm.ct_nodes,n),this.data.crrm.ct_nodes=!1);this.data.crrm.cp_nodes&&this.move_node(this.data.crrm.cp_nodes,n,!1,!0);this.__callback({obj:n,nodes:t})}}})}(jQuery),function(n){var t=[];n.jstree._themes=!1;n.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",n.proxy(function(){var n=this._get_settings().themes;this.data.themes.dots=n.dots;this.data.themes.icons=n.icons;this.set_theme(n.theme,n.url)},this)).bind("loaded.jstree",n.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:!1,dots:!0,icons:!0},_fn:{set_theme:function(i,r){if(!i)return!1;r||(r=n.jstree._themes+i+"/style.css");n.inArray(r,t)==-1&&(n.vakata.css.add_sheet({url:r}),t.push(r));this.data.themes.theme!=i&&(this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=i);this.get_container().addClass("jstree-"+i);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=!0;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=!1;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=!0;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=!1;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()}}});n(function(){n.jstree._themes===!1&&n("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/))return n.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/",!1});n.jstree._themes===!1&&(n.jstree._themes="themes/")});n.jstree.defaults.plugins.push("themes")}(jQuery),function(n){function i(t,i){var r=n.jstree._focused(),u;if(r&&r.data&&r.data.hotkeys&&r.data.hotkeys.enabled&&(u=r._get_settings().hotkeys[t],u))return u.call(r,i)}var t=[];n.jstree.plugin("hotkeys",{__init:function(){if(typeof n.hotkeys=="undefined")throw"jsTree hotkeys: jQuery hotkeys plugin not included.";if(!this.data.ui)throw"jsTree hotkeys: jsTree UI plugin not included.";n.each(this._get_settings().hotkeys,function(r,u){u!==!1&&n.inArray(r,t)==-1&&(n(document).bind("keydown",r,function(n){return i(r,n)}),t.push(r))});this.get_container().bind("lock.jstree",n.proxy(function(){this.data.hotkeys.enabled&&(this.data.hotkeys.enabled=!1,this.data.hotkeys.revert=!0)},this)).bind("unlock.jstree",n.proxy(function(){this.data.hotkeys.revert&&(this.data.hotkeys.enabled=!0)},this));this.enable_hotkeys()},defaults:{up:function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_prev(n)),!1},"ctrl+up":function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_prev(n)),!1},"shift+up":function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_prev(n)),!1},down:function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_next(n)),!1},"ctrl+down":function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_next(n)),!1},"shift+down":function(){var n=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this._get_next(n)),!1},left:function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&(n.hasClass("jstree-open")?this.close_node(n):this.hover_node(this._get_prev(n))),!1},"ctrl+left":function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&(n.hasClass("jstree-open")?this.close_node(n):this.hover_node(this._get_prev(n))),!1},"shift+left":function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&(n.hasClass("jstree-open")?this.close_node(n):this.hover_node(this._get_prev(n))),!1},right:function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&n.length&&(n.hasClass("jstree-closed")?this.open_node(n):this.hover_node(this._get_next(n))),!1},"ctrl+right":function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&n.length&&(n.hasClass("jstree-closed")?this.open_node(n):this.hover_node(this._get_next(n))),!1},"shift+right":function(){var n=this.data.ui.hovered||this.data.ui.last_selected;return n&&n.length&&(n.hasClass("jstree-closed")?this.open_node(n):this.hover_node(this._get_next(n))),!1},space:function(){return this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").click(),!1},"ctrl+space":function(n){return n.type="click",this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(n),!1},"shift+space":function(n){return n.type="click",this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(n),!1},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=!0},disable_hotkeys:function(){this.data.hotkeys.enabled=!1}}})}(jQuery),function(n){n.jstree.plugin("json_data",{__init:function(){var n=this._get_settings().json_data;n.progressive_unload&&this.get_container().bind("after_close.jstree",function(n,t){t.rslt.obj.children("ul").remove()})},defaults:{data:!1,ajax:!1,correct_state:!0,progressive_render:!1,progressive_unload:!1},_fn:{load_node:function(n,t,i){var r=this;this.load_node_json(n,function(){r.__callback({obj:r._get_node(n)});t.call(this)},i)},_is_loaded:function(t){var i=this._get_settings().json_data;return t=this._get_node(t),t==-1||!t||!i.ajax&&!i.progressive_render&&!n.isFunction(i.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").length>0},refresh:function(t){t=this._get_node(t);var i=this._get_settings().json_data;return t&&t!==-1&&i.progressive_unload&&(n.isFunction(i.data)||!!i.ajax)&&t.removeData("jstree_children"),this.__call_old()},load_node_json:function(t,i,r){var u=this.get_settings().json_data,f,e=function(){},o=function(){};if(t=this._get_node(t),t&&t!==-1&&(u.progressive_render||u.progressive_unload)&&!t.is(".jstree-open, .jstree-leaf")&&t.children("ul").children("li").length===0&&t.data("jstree_children")){f=this._parse_json(t.data("jstree_children"),t);f&&(t.append(f),u.progressive_unload||t.removeData("jstree_children"));this.clean_node(t);i&&i.call(this);return}if(t&&t!==-1){if(t.data("jstree_is_loading"))return;t.data("jstree_is_loading",!0)}switch(!0){case!u.data&&!u.ajax:throw"Neither data nor ajax settings supplied.";case n.isFunction(u.data):u.data.call(this,t,n.proxy(function(n){n=this._parse_json(n,t);n?(t!==-1&&t?(t.append(n).children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(n.children()),this.clean_node(t),i&&i.call(this)):(t!==-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&this.correct_state(t)):u.correct_state&&this.get_container().children("ul").empty(),r&&r.call(this))},this));break;case!!u.data&&!u.ajax||!!u.data&&!!u.ajax&&(!t||t===-1):t&&t!=-1||(f=this._parse_json(u.data,t),f?(this.get_container().children("ul").empty().append(f.children()),this.clean_node()):u.correct_state&&this.get_container().children("ul").empty());i&&i.call(this);break;case!u.data&&!!u.ajax||!!u.data&&!!u.ajax&&t&&t!==-1:e=function(n,i,f){var e=this.get_settings().json_data.ajax.error;e&&e.call(this,n,i,f);t!=-1&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),i==="success"&&u.correct_state&&this.correct_state(t)):i==="success"&&u.correct_state&&this.get_container().children("ul").empty();r&&r.call(this)};o=function(r,f,o){var s=this.get_settings().json_data.ajax.success;if(s&&(r=s.call(this,r,f,o)||r),r===""||r&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")===""||!n.isArray(r)&&!n.isPlainObject(r))return e.call(this,o,f,"");r=this._parse_json(r,t);r?(t!==-1&&t?(t.append(r).children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(r.children()),this.clean_node(t),i&&i.call(this)):t!==-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&(this.correct_state(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this))};u.ajax.context=this;u.ajax.error=e;u.ajax.success=o;u.ajax.dataType||(u.ajax.dataType="json");n.isFunction(u.ajax.url)&&(u.ajax.url=u.ajax.url.call(this,t));n.isFunction(u.ajax.data)&&(u.ajax.data=u.ajax.data.call(this,t));n.ajax(u.ajax)}},_parse_json:function(t,i,r){var u=!1,c=this._get_settings(),o=c.json_data,l=c.core.html_titles,f,e,a,s,h;if(!t)return u;if(o.progressive_unload&&i&&i!==-1&&i.data("jstree_children",u),n.isArray(t)){if(u=n("<ul>"),!t.length)return!1;for(e=0,a=t.length;e<a;e++)f=this._parse_json(t[e],i,!0),f.length&&(u=u.append(f));u=u.children()}else{if(typeof t=="string"&&(t={data:t}),!t.data&&t.data!=="")return u;u=n("<li />");t.attr&&u.attr(t.attr);t.metadata&&u.data(t.metadata);t.state&&u.addClass("jstree-"+t.state);n.isArray(t.data)||(f=t.data,t.data=[],t.data.push(f));n.each(t.data,function(i,r){f=n("<a />");n.isFunction(r)&&(r=r.call(this,t));typeof r=="string"?f.attr("href","#")[l?"html":"text"](r):(r.attr||(r.attr={}),r.attr.href||(r.attr.href="#"),f.attr(r.attr)[l?"html":"text"](r.title),r.language&&f.addClass(r.language));f.prepend("<ins class='jstree-icon'>&#160;<\/ins>");!r.icon&&t.icon&&(r.icon=t.icon);r.icon&&(r.icon.indexOf("/")===-1?f.children("ins").addClass(r.icon):f.children("ins").css("background","url('"+r.icon+"') center center no-repeat"));u.append(f)});u.prepend("<ins class='jstree-icon'>&#160;<\/ins>");t.children&&(o.progressive_render&&t.state!=="open"?u.addClass("jstree-closed").data("jstree_children",t.children):(o.progressive_unload&&u.data("jstree_children",t.children),n.isArray(t.children)&&t.children.length&&(f=this._parse_json(t.children,i,!0),f.length&&(h=n("<ul />"),h.append(f),u.append(h)))))}return r||(s=n("<ul />"),s.append(u),u=s),u},get_json:function(t,i,r,u){var v=[],s=this._get_settings(),c=this,h,f,o,l,e,a;return t=this._get_node(t),t&&t!==-1||(t=this.get_container().find("> ul > li")),i=n.isArray(i)?i:["id","class"],!u&&this.data.types&&i.push(s.types.type_attr),r=n.isArray(r)?r:[],t.each(function(){o=n(this);h={data:[]};i.length&&(h.attr={});n.each(i,function(n,t){f=o.attr(t);f&&f.length&&f.replace(/jstree[^ ]*/ig,"").length&&(h.attr[t]=(" "+f).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))});o.hasClass("jstree-open")&&(h.state="open");o.hasClass("jstree-closed")&&(h.state="closed");o.data()&&(h.metadata=o.data());l=o.children("a");l.each(function(){e=n(this);r.length||n.inArray("languages",s.plugins)!==-1||e.children("ins").get(0).style.backgroundImage.length||e.children("ins").get(0).className&&e.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length?(a=!1,n.inArray("languages",s.plugins)!==-1&&n.isArray(s.languages)&&s.languages.length&&n.each(s.languages,function(n,t){if(e.hasClass(t))return a=t,!1}),f={attr:{},title:c.get_text(e,a)},n.each(r,function(n,t){f.attr[t]=(" "+(e.attr(t)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}),n.inArray("languages",s.plugins)!==-1&&n.isArray(s.languages)&&s.languages.length&&n.each(s.languages,function(n,t){if(e.hasClass(t))return f.language=t,!0}),e.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length&&(f.icon=e.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")),e.children("ins").get(0).style.backgroundImage.length&&(f.icon=e.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""))):f=c.get_text(e);l.length>1?h.data.push(f):h.data=f});o=o.find("> ul > li");o.length&&(h.children=c.get_json(o,i,r,!0));v.push(h)}),v}}})}(jQuery),function(n){var t=!1;n.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(i){var u=this._get_settings().languages,r=!1,f=".jstree-"+this.get_index()+" a";if(!n.isArray(u)||u.length===0)return!1;if(n.inArray(i,u)==-1){if(!u[i])return!1;i=u[i]}return i==this.data.languages.current_language?!0:(r=n.vakata.css.get_css(f+"."+this.data.languages.current_language,!1,t),r!==!1&&(r.style.display="none"),r=n.vakata.css.get_css(f+"."+i,!1,t),r!==!1&&(r.style.display=""),this.data.languages.current_language=i,this.__callback(i),!0)},get_lang:function(){return this.data.languages.current_language},_get_string:function(t,i){var u=this._get_settings().languages,r=this._get_settings().core.strings;return(n.isArray(u)&&u.length&&(i=i&&n.inArray(i,u)!=-1?i:this.data.languages.current_language),r[i]&&r[i][t])?r[i][t]:r[t]?r[t]:t},get_text:function(t,i){if(t=this._get_node(t)||this.data.ui.last_selected,!t.size())return!1;var r=this._get_settings().languages,u=this._get_settings().core.html_titles;return n.isArray(r)&&r.length?(i=i&&n.inArray(i,r)!=-1?i:this.data.languages.current_language,t=t.children("a."+i)):t=t.children("a:eq(0)"),u?(t=t.clone(),t.children("INS").remove(),t.html()):(t=t.contents().filter(function(){return this.nodeType==3})[0],t.nodeValue)},set_text:function(t,i,r){if(t=this._get_node(t)||this.data.ui.last_selected,!t.size())return!1;var u=this._get_settings().languages,e=this._get_settings().core.html_titles,f;return n.isArray(u)&&u.length?(r=r&&n.inArray(r,u)!=-1?r:this.data.languages.current_language,t=t.children("a."+r)):t=t.children("a:eq(0)"),e?(f=t.children("INS").clone(),t.html(i).prepend(f),this.__callback({obj:t,name:i,lang:r}),!0):(t=t.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:t,name:i,lang:r}),t.nodeValue=i)},_load_css:function(){var i=this._get_settings().languages,u="/* languages css */",f=".jstree-"+this.get_index()+" a",r;if(n.isArray(i)&&i.length){for(this.data.languages.current_language=i[0],r=0;r<i.length;r++)u+=f+"."+i[r]+" {",i[r]!=this.data.languages.current_language&&(u+=" display:none; "),u+=" } ";t=n.vakata.css.add_sheet({str:u,title:"jstree-languages"})}},create_node:function(t,i,r,u){return this.__call_old(!0,t,i,r,function(t){var i=this._get_settings().languages,f=t.children("a"),r;if(n.isArray(i)&&i.length){for(r=0;r<i.length;r++)f.is("."+i[r])||t.append(f.eq(0).clone().removeClass(i.join(" ")).addClass(i[r]));f.not("."+i.join(", .")).remove()}u&&u.call(this,t)})}}})}(jQuery),function(n){n.jstree.plugin("cookies",{__init:function(){if(typeof n.cookie=="undefined")throw"jsTree cookie: jQuery cookie plugin not included.";var i=this._get_settings().cookies,t;i.save_loaded&&(t=n.cookie(i.save_loaded),t&&t.length&&(this.data.core.to_load=t.split(",")));i.save_opened&&(t=n.cookie(i.save_opened),t&&t.length&&(this.data.core.to_open=t.split(",")));i.save_selected&&(t=n.cookie(i.save_selected),t&&t.length&&this.data.ui&&(this.data.ui.to_select=t.split(",")));this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",n.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",n.proxy(function(n){this._get_settings().cookies.auto_save&&this.save_cookie((n.handleObj.namespace+n.handleObj.type).replace("jstree",""))},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",save_selected:"jstree_select",auto_save:!0,cookie_options:{}},_fn:{save_cookie:function(t){if(!this.data.core.refreshing){var i=this._get_settings().cookies;if(!t){i.save_loaded&&(this.save_loaded(),n.cookie(i.save_loaded,this.data.core.to_load.join(","),i.cookie_options));i.save_opened&&(this.save_opened(),n.cookie(i.save_opened,this.data.core.to_open.join(","),i.cookie_options));i.save_selected&&this.data.ui&&(this.save_selected(),n.cookie(i.save_selected,this.data.ui.to_select.join(","),i.cookie_options));return}switch(t){case"open_node":case"close_node":i.save_opened&&(this.save_opened(),n.cookie(i.save_opened,this.data.core.to_open.join(","),i.cookie_options));i.save_loaded&&(this.save_loaded(),n.cookie(i.save_loaded,this.data.core.to_load.join(","),i.cookie_options));break;case"select_node":case"deselect_node":!!i.save_selected&&this.data.ui&&(this.save_selected(),n.cookie(i.save_selected,this.data.ui.to_select.join(","),i.cookie_options))}}}}})}(jQuery),function(n){n.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",n.proxy(function(n,t){var i=this._get_node(t.rslt.obj);i=i===-1?this.get_container().children("ul"):i.children("ul");this.sort(i)},this)).bind("rename_node.jstree create_node.jstree create.jstree",n.proxy(function(n,t){this.sort(t.rslt.obj.parent())},this)).bind("move_node.jstree",n.proxy(function(n,t){var i=t.rslt.np==-1?this.get_container():t.rslt.np;this.sort(i.children("ul"))},this))},defaults:function(n,t){return this.get_text(n)>this.get_text(t)?1:-1},_fn:{sort:function(t){var r=this._get_settings().sort,i=this;t.append(n.makeArray(t.children("li")).sort(n.proxy(r,i)));t.find("> li > ul").each(function(){i.sort(n(this))});this.clean_node(t)}}})}(jQuery),function(n){var u=!1,t=!1,r=!1,i=!1,f=!1,e=!1,o=!1,s=!1,h=!1;n.vakata.dnd={is_down:!1,is_drag:!1,helper:!1,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(t,i,r){n.vakata.dnd.is_drag&&n.vakata.drag_stop({});try{t.currentTarget.unselectable="on";t.currentTarget.onselectstart=function(){return!1};t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(u){}return n.vakata.dnd.init_x=t.pageX,n.vakata.dnd.init_y=t.pageY,n.vakata.dnd.user_data=i,n.vakata.dnd.is_down=!0,n.vakata.dnd.helper=n("<div id='vakata-dragged' />").html(r),n(document).bind("mousemove",n.vakata.dnd.drag),n(document).bind("mouseup",n.vakata.dnd.drag_stop),!1},drag:function(t){if(n.vakata.dnd.is_down){if(!n.vakata.dnd.is_drag)if(Math.abs(t.pageX-n.vakata.dnd.init_x)>5||Math.abs(t.pageY-n.vakata.dnd.init_y)>5)n.vakata.dnd.helper.appendTo("body"),n.vakata.dnd.is_drag=!0,n(document).triggerHandler("drag_start.vakata",{event:t,data:n.vakata.dnd.user_data});else return;if(t.type==="mousemove"){var i=n(document),r=i.scrollTop(),u=i.scrollLeft();t.pageY-r<20?(e&&o==="down"&&(clearInterval(e),e=!1),e||(o="up",e=setInterval(function(){n(document).scrollTop(n(document).scrollTop()-n.vakata.dnd.scroll_spd)},150))):e&&o==="up"&&(clearInterval(e),e=!1);n(window).height()-(t.pageY-r)<20?(e&&o==="up"&&(clearInterval(e),e=!1),e||(o="down",e=setInterval(function(){n(document).scrollTop(n(document).scrollTop()+n.vakata.dnd.scroll_spd)},150))):e&&o==="down"&&(clearInterval(e),e=!1);t.pageX-u<20?(f&&s==="right"&&(clearInterval(f),f=!1),f||(s="left",f=setInterval(function(){n(document).scrollLeft(n(document).scrollLeft()-n.vakata.dnd.scroll_spd)},150))):f&&s==="left"&&(clearInterval(f),f=!1);n(window).width()-(t.pageX-u)<20?(f&&s==="left"&&(clearInterval(f),f=!1),f||(s="right",f=setInterval(function(){n(document).scrollLeft(n(document).scrollLeft()+n.vakata.dnd.scroll_spd)},150))):f&&s==="right"&&(clearInterval(f),f=!1)}n.vakata.dnd.helper.css({left:t.pageX+n.vakata.dnd.helper_left+"px",top:t.pageY+n.vakata.dnd.helper_top+"px"});n(document).triggerHandler("drag.vakata",{event:t,data:n.vakata.dnd.user_data})}},drag_stop:function(t){f&&clearInterval(f);e&&clearInterval(e);n(document).unbind("mousemove",n.vakata.dnd.drag);n(document).unbind("mouseup",n.vakata.dnd.drag_stop);n(document).triggerHandler("drag_stop.vakata",{event:t,data:n.vakata.dnd.user_data});n.vakata.dnd.helper.remove();n.vakata.dnd.init_x=0;n.vakata.dnd.init_y=0;n.vakata.dnd.user_data={};n.vakata.dnd.is_down=!1;n.vakata.dnd.is_drag=!1}};n(function(){n.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; } ",title:"vakata"})});n.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:!1,after:!1,inside:!1,before:!1,off:!1,prepared:!1,w:0,to1:!1,to2:!1,cof:!1,cw:!1,ch:!1,i1:!1,i2:!1,mto:!1};this.get_container().bind("mouseenter.jstree",n.proxy(function(t){if(n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&(this.data.themes&&(r.attr("class","jstree-"+this.data.themes.theme),i&&i.attr("class","jstree-"+this.data.themes.theme),n.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),t.currentTarget===t.target&&n.vakata.dnd.user_data.obj&&n(n.vakata.dnd.user_data.obj).length&&n(n.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==t.target)){var f=n.jstree._reference(t.target),e;f.data.dnd.foreign?(e=f._get_settings().dnd.drag_check.call(this,{o:u,r:f.get_container(),is_root:!0}),(e===!0||e.inside===!0||e.before===!0||e.after===!0)&&n.vakata.dnd.helper.children("ins").attr("class","jstree-ok")):(f.prepare_move(u,f.get_container(),"last"),f.check_move()&&n.vakata.dnd.helper.children("ins").attr("class","jstree-ok"))}},this)).bind("mouseup.jstree",n.proxy(function(t){if(n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&t.currentTarget===t.target&&n.vakata.dnd.user_data.obj&&n(n.vakata.dnd.user_data.obj).length&&n(n.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==t.target){var i=n.jstree._reference(t.currentTarget),r;i.data.dnd.foreign?(r=i._get_settings().dnd.drag_check.call(this,{o:u,r:i.get_container(),is_root:!0}),(r===!0||r.inside===!0||r.before===!0||r.after===!0)&&i._get_settings().dnd.drag_finish.call(this,{o:u,r:i.get_container(),is_root:!0})):i.move_node(u,i.get_container(),"last",t[i._get_settings().dnd.copy_modifier+"Key"])}},this)).bind("mouseleave.jstree",n.proxy(function(t){if(t.relatedTarget&&t.relatedTarget.id&&t.relatedTarget.id==="jstree-marker-line")return!1;n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),n.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&n.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"))},this)).bind("mousemove.jstree",n.proxy(function(t){if(n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree){var i=this.get_container()[0];t.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(n.proxy(function(){this.scrollLeft+=n.vakata.dnd.scroll_spd},i),100)):t.pageX-24<this.data.dnd.cof.left?(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i1=setInterval(n.proxy(function(){this.scrollLeft-=n.vakata.dnd.scroll_spd},i),100)):this.data.dnd.i1&&clearInterval(this.data.dnd.i1);t.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(n.proxy(function(){this.scrollTop+=n.vakata.dnd.scroll_spd},i),100)):t.pageY-24<this.data.dnd.cof.top?(this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.i2=setInterval(n.proxy(function(){this.scrollTop-=n.vakata.dnd.scroll_spd},i),100)):this.data.dnd.i2&&clearInterval(this.data.dnd.i2)}},this)).bind("scroll.jstree",n.proxy(function(){n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&r&&i&&(r.hide(),i.hide())},this)).delegate("a","mousedown.jstree",n.proxy(function(n){if(n.which===1)return this.start_drag(n.currentTarget,n),!1},this)).delegate("a","mouseenter.jstree",n.proxy(function(t){n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&this.dnd_enter(t.currentTarget)},this)).delegate("a","mousemove.jstree",n.proxy(function(i){n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&(t&&t.length&&t.children("a")[0]===i.currentTarget||this.dnd_enter(i.currentTarget),typeof this.data.dnd.off.top=="undefined"&&(this.data.dnd.off=n(i.target).offset()),this.data.dnd.w=(i.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height,this.data.dnd.w<0&&(this.data.dnd.w+=this.data.core.li_height),this.dnd_show())},this)).delegate("a","mouseleave.jstree",n.proxy(function(t){if(n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree){if(t.relatedTarget&&t.relatedTarget.id&&t.relatedTarget.id==="jstree-marker-line")return!1;r&&r.hide();i&&i.hide();this.data.dnd.mto=setTimeout(function(n){return function(){n.dnd_leave(t)}}(this),0)}},this)).delegate("a","mouseup.jstree",n.proxy(function(t){n.vakata.dnd.is_drag&&n.vakata.dnd.user_data.jstree&&this.dnd_finish(t)},this));n(document).bind("drag_stop.vakata",n.proxy(function(){this.data.dnd.to1&&clearTimeout(this.data.dnd.to1);this.data.dnd.to2&&clearTimeout(this.data.dnd.to2);this.data.dnd.i1&&clearInterval(this.data.dnd.i1);this.data.dnd.i2&&clearInterval(this.data.dnd.i2);this.data.dnd.after=!1;this.data.dnd.before=!1;this.data.dnd.inside=!1;this.data.dnd.off=!1;this.data.dnd.prepared=!1;this.data.dnd.w=!1;this.data.dnd.to1=!1;this.data.dnd.to2=!1;this.data.dnd.i1=!1;this.data.dnd.i2=!1;this.data.dnd.active=!1;this.data.dnd.foreign=!1;r&&r.css({top:"-2000px"});i&&i.css({top:"-2000px"})},this)).bind("drag_start.vakata",n.proxy(function(t,i){if(i.data.jstree){var r=n(i.event.target);r.closest(".jstree").hasClass("jstree-"+this.get_index())&&this.dnd_enter(r)}},this));var f=this._get_settings().dnd;f.drag_target&&n(document).delegate(f.drag_target,"mousedown.jstree-"+this.get_index(),n.proxy(function(t){u=t.target;n.vakata.dnd.drag_start(t,{jstree:!0,obj:t.target},"<ins class='jstree-icon'><\/ins>"+n(t.target).text());this.data.themes&&(r&&r.attr("class","jstree-"+this.data.themes.theme),i&&i.attr("class","jstree-"+this.data.themes.theme),n.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme));n.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var f=this.get_container();this.data.dnd.cof=f.offset();this.data.dnd.cw=parseInt(f.width(),10);this.data.dnd.ch=parseInt(f.height(),10);this.data.dnd.foreign=!0;t.preventDefault()},this));f.drop_target&&n(document).delegate(f.drop_target,"mouseenter.jstree-"+this.get_index(),n.proxy(function(t){this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:u,r:n(t.target),e:t})&&n.vakata.dnd.helper.children("ins").attr("class","jstree-ok")},this)).delegate(f.drop_target,"mouseleave.jstree-"+this.get_index(),n.proxy(function(){this.data.dnd.active&&n.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")},this)).delegate(f.drop_target,"mouseup.jstree-"+this.get_index(),n.proxy(function(t){this.data.dnd.active&&n.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&this._get_settings().dnd.drop_finish.call(this,{o:u,r:n(t.target),e:t})},this))},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(){return!0},drop_finish:n.noop,drag_target:".jstree-draggable",drag_finish:n.noop,drag_check:function(){return{after:!1,before:!1,inside:!0}}},_fn:{dnd_prepare:function(){if(t&&t.length){if(this.data.dnd.off=t.offset(),this._get_settings().core.rtl&&(this.data.dnd.off.right=this.data.dnd.off.left+t.width()),this.data.dnd.foreign){var n=this._get_settings().dnd.drag_check.call(this,{o:u,r:t});return this.data.dnd.after=n.after,this.data.dnd.before=n.before,this.data.dnd.inside=n.inside,this.data.dnd.prepared=!0,this.dnd_show()}return this.prepare_move(u,t,"before"),this.data.dnd.before=this.check_move(),this.prepare_move(u,t,"after"),this.data.dnd.after=this.check_move(),this._is_loaded(t)?(this.prepare_move(u,t,"inside"),this.data.dnd.inside=this.check_move()):this.data.dnd.inside=!1,this.data.dnd.prepared=!0,this.dnd_show()}},dnd_show:function(){if(this.data.dnd.prepared){var f=["before","inside","after"],u=!1,e=this._get_settings().core.rtl,t;f=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"];n.each(f,n.proxy(function(t,i){if(this.data.dnd[i])return n.vakata.dnd.helper.children("ins").attr("class","jstree-ok"),u=i,!1},this));u===!1&&n.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");t=e?this.data.dnd.off.right-18:this.data.dnd.off.left+10;switch(u){case"before":r.css({left:t+"px",top:this.data.dnd.off.top-6+"px"}).show();i&&i.css({left:t+8+"px",top:this.data.dnd.off.top-1+"px"}).show();break;case"after":r.css({left:t+"px",top:this.data.dnd.off.top+this.data.core.li_height-6+"px"}).show();i&&i.css({left:t+8+"px",top:this.data.dnd.off.top+this.data.core.li_height-1+"px"}).show();break;case"inside":r.css({left:t+(e?-4:4)+"px",top:this.data.dnd.off.top+this.data.core.li_height/2-5+"px"}).show();i&&i.hide();break;default:r.hide();i&&i.hide()}return h=u,u}},dnd_open:function(){this.data.dnd.to2=!1;this.open_node(t,n.proxy(this.dnd_prepare,this),!0)},dnd_finish:function(n){this.data.dnd.foreign?(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside)&&this._get_settings().dnd.drag_finish.call(this,{o:u,r:t,p:h}):(this.dnd_prepare(),this.move_node(u,t,h,n[this._get_settings().dnd.copy_modifier+"Key"]));u=!1;t=!1;r.hide();i&&i.hide()},dnd_enter:function(i){this.data.dnd.mto&&(clearTimeout(this.data.dnd.mto),this.data.dnd.mto=!1);var r=this._get_settings().dnd;this.data.dnd.prepared=!1;t=this._get_node(i);r.check_timeout?(this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to1=setTimeout(n.proxy(this.dnd_prepare,this),r.check_timeout)):this.dnd_prepare();r.open_timeout?(this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),t&&t.length&&t.hasClass("jstree-closed")&&(this.data.dnd.to2=setTimeout(n.proxy(this.dnd_open,this),r.open_timeout))):t&&t.length&&t.hasClass("jstree-closed")&&this.dnd_open()},dnd_leave:function(u){this.data.dnd.after=!1;this.data.dnd.before=!1;this.data.dnd.inside=!1;n.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");r.hide();i&&i.hide();t&&t[0]===u.target.parentNode&&(this.data.dnd.to1&&(clearTimeout(this.data.dnd.to1),this.data.dnd.to1=!1),this.data.dnd.to2&&(clearTimeout(this.data.dnd.to2),this.data.dnd.to2=!1))},start_drag:function(t,f){u=this._get_node(t);this.data.ui&&this.is_selected(u)&&(u=this._get_node(null,!0));var e=u.length>1?this._get_string("multiple_selection"):this.get_text(u),o=this.get_container();this._get_settings().core.html_titles||(e=e.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"));n.vakata.dnd.drag_start(f,{jstree:!0,obj:u},"<ins class='jstree-icon'><\/ins>"+e);this.data.themes&&(r&&r.attr("class","jstree-"+this.data.themes.theme),i&&i.attr("class","jstree-"+this.data.themes.theme),n.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme));this.data.dnd.cof=o.offset();this.data.dnd.cw=parseInt(o.width(),10);this.data.dnd.ch=parseInt(o.height(),10);this.data.dnd.active=!0}}});n(function(){n.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;  -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43;  cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666;  -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }",title:"jstree"});r=n("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(n){return r.hide(),i.hide(),n.preventDefault(),n.stopImmediatePropagation(),!1}).appendTo("body");i=n("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(n){if(t&&t.length)return t.children("a").trigger(n),n.preventDefault(),n.stopImmediatePropagation(),!1}).bind("mouseleave",function(u){var f=n(u.relatedTarget);if((f.is(".jstree")||f.closest(".jstree").length===0)&&t&&t.length)return t.children("a").trigger(u),r.hide(),i.hide(),u.preventDefault(),u.stopImmediatePropagation(),!1}).appendTo("body");n(document).bind("drag_start.vakata",function(n,t){t.data.jstree&&(r.show(),i&&i.show())});n(document).bind("drag_stop.vakata",function(n,t){t.data.jstree&&(r.hide(),i&&i.hide())})})}(jQuery),function(n){n.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;this.data.ui&&this.data.checkbox.noui&&(this.select_node=this.deselect_node=this.deselect_all=n.noop,this.get_selected=this.get_checked);this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",n.proxy(function(n,t){this._prepare_checkboxes(t.rslt.obj)},this)).bind("loaded.jstree",n.proxy(function(){this._prepare_checkboxes()},this)).delegate(this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox","click.jstree",n.proxy(function(n){if(n.preventDefault(),this._get_node(n.target).hasClass("jstree-checked")?this.uncheck_node(n.target):this.check_node(n.target),this.data.ui&&this.data.checkbox.noui)this.save_selected(),this.data.cookies&&this.save_cookie("select_node");else return n.stopImmediatePropagation(),!1},this))},defaults:{override_ui:!1,two_state:!1,real_checkboxes:!1,checked_parent_open:!0,real_checkboxes_names:function(n){return["check_"+(n[0].id||Math.ceil(Math.random()*1e4)),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(n,t){t.checked&&this.check_node(n,!1)},_prepare_checkboxes:function(t){if(t=!t||t==-1?this.get_container().find("> ul > li"):this._get_node(t),t!==!1){var r,u=this,i,f=this._get_settings().checkbox.two_state,e=this._get_settings().checkbox.real_checkboxes,o=this._get_settings().checkbox.real_checkboxes_names;t.each(function(){i=n(this);r=i.is("li")&&(i.hasClass("jstree-checked")||e&&i.children(":checked").length)?"jstree-checked":"jstree-unchecked";i.find("li").addBack().each(function(){var t=n(this),i;t.children("a"+(u.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;<\/ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(f?"jstree-unchecked":r);e&&(t.children(":checkbox").length?t.children(":checkbox").addClass("jstree-real-checkbox"):(i=o.call(u,t),t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+i[0]+"' name='"+i[0]+"' value='"+i[1]+"' />")));f?(t.hasClass("jstree-checked")||t.children(":checked").length)&&t.addClass("jstree-checked").children(":checkbox").prop("checked",!0):(r==="jstree-checked"||t.hasClass("jstree-checked")||t.children(":checked").length)&&t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked",!0)})});f||t.find(".jstree-checked").parent().parent().each(function(){u._repair_state(this)})}},change_state:function(t,i){t=this._get_node(t);var r=!1,u=this._get_settings().checkbox.real_checkboxes;if(!t||t===-1)return!1;if(i=i===!1||i===!0?i:t.hasClass("jstree-checked"),this._get_settings().checkbox.two_state)i?(t.removeClass("jstree-checked").addClass("jstree-unchecked"),u&&t.children(":checkbox").prop("checked",!1)):(t.removeClass("jstree-unchecked").addClass("jstree-checked"),u&&t.children(":checkbox").prop("checked",!0));else{if(i){if(r=t.find("li").addBack(),!r.filter(".jstree-checked, .jstree-undetermined").length)return!1;r.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");u&&r.children(":checkbox").prop("checked",!1)}else{if(r=t.find("li").addBack(),!r.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;r.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");u&&r.children(":checkbox").prop("checked",!0);this.data.ui&&(this.data.ui.last_selected=t);this.data.checkbox.last_selected=t}t.parentsUntil(".jstree","li").each(function(){var t=n(this);if(i){if(t.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),u&&t.parentsUntil(".jstree","li").addBack().children(":checkbox").prop("checked",!1),!1;t.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");u&&t.children(":checkbox").prop("checked",!1)}else{if(t.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),u&&t.parentsUntil(".jstree","li").addBack().children(":checkbox").prop("checked",!1),!1;t.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");u&&t.children(":checkbox").prop("checked",!0)}})}return this.data.ui&&this.data.checkbox.noui&&(this.data.ui.selected=this.get_checked()),this.__callback(t),!0},check_node:function(n){if(this.change_state(n,!1)){if(n=this._get_node(n),this._get_settings().checkbox.checked_parent_open){var t=this;n.parents(".jstree-closed").each(function(){t.open_node(this,!1,!0)})}this.__callback({obj:n})}},uncheck_node:function(n){this.change_state(n,!0)&&this.__callback({obj:this._get_node(n)})},check_all:function(){var n=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){n.change_state(this,!1)});this.__callback()},uncheck_all:function(){var n=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){n.change_state(this,!0)});this.__callback()},is_checked:function(n){return n=this._get_node(n),n.length?n.is(".jstree-checked"):!1},get_checked:function(n,t){return n=!n||n===-1?this.get_container():this._get_node(n),t||this._get_settings().checkbox.two_state?n.find(".jstree-checked"):n.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(n,t){return n=!n||n===-1?this.get_container():this._get_node(n),t||this._get_settings().checkbox.two_state?n.find(".jstree-unchecked"):n.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(n){if(n=this._get_node(n),n.length){if(this._get_settings().checkbox.two_state){n.find("li").addBack().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",!0);return}var r=this._get_settings().checkbox.real_checkboxes,t=n.find("> ul > .jstree-checked").length,u=n.find("> ul > .jstree-undetermined").length,i=n.find("> ul > li").length;i===0?n.hasClass("jstree-undetermined")&&this.change_state(n,!1):t===0&&u===0?this.change_state(n,!0):t===i?this.change_state(n,!1):(n.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),r&&n.parentsUntil(".jstree","li").addBack().children(":checkbox").prop("checked",!1))}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var i=this,t=this.data.ui.to_select;t=n.map(n.makeArray(t),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();n.each(t,function(n,t){i.check_node(t)});this.__callback()}else this.__call_old()},save_loaded:function(){var n=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&n.data.core.to_load.push("#"+this.id)})}}});n(function(){n.vakata.css.add_sheet({str:".jstree .jstree-real-checkbox { display:none; } ",title:"jstree"})})}(jQuery),function(n){n.vakata.xslt=function(t,i,r){var u=!1,f,e,o;if(u===!1&&window.ActiveXObject)try{u=new ActiveXObject("Msxml2.XSLTemplate");e=new ActiveXObject("Msxml2.DOMDocument");e.loadXML(t);o=new ActiveXObject("Msxml2.FreeThreadedDOMDocument");o.loadXML(i);u.stylesheet=o;f=u.createProcessor();f.input=e;f.transform();u=f.output}catch(s){}t=n.parseXML(t);i=n.parseXML(i);u===!1&&typeof XSLTProcessor!="undefined"&&(f=new XSLTProcessor,f.importStylesheet(i),u=f.transformToFragment(t,document),u=n("<div />").append(u).html());u===!1&&typeof t.transformNode!="undefined"&&(u=t.transformNode(i));r.call(null,u)};var i={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:copy-of select="./child::node()" />\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:copy-of select="./child::node()" />\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>'},t=function(n){return n.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};n.jstree.plugin("xml_data",{defaults:{data:!1,ajax:!1,xsl:"flat",clean_node:!1,correct_state:!0,get_skip_empty:!1,get_include_preamble:!0},_fn:{load_node:function(n,t,i){var r=this;this.load_node_xml(n,function(){r.__callback({obj:r._get_node(n)});t.call(this)},i)},_is_loaded:function(t){var i=this._get_settings().xml_data;return t=this._get_node(t),t==-1||!t||!i.ajax&&!n.isFunction(i.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").size()>0},load_node_xml:function(t,i,r){var u=this.get_settings().xml_data,f=function(){},e=function(){};if(t=this._get_node(t),t&&t!==-1){if(t.data("jstree_is_loading"))return;t.data("jstree_is_loading",!0)}switch(!0){case!u.data&&!u.ajax:throw"Neither data nor ajax settings supplied.";case n.isFunction(u.data):u.data.call(this,t,n.proxy(function(r){this.parse_xml(r,n.proxy(function(r){r&&(r=r.replace(/ ?xmlns="[^"]*"/ig,""),r.length>10?(r=n(r),t!==-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(r),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(r.children()),u.clean_node&&this.clean_node(t),i&&i.call(this)):t&&t!==-1?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&(this.correct_state(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this)))},this))},this));break;case!!u.data&&!u.ajax||!!u.data&&!!u.ajax&&(!t||t===-1):t&&t!=-1||this.parse_xml(u.data,n.proxy(function(r){r?(r=r.replace(/ ?xmlns="[^"]*"/ig,""),r.length>10&&(r=n(r),this.get_container().children("ul").empty().append(r.children()),u.clean_node&&this.clean_node(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this))},this));break;case!u.data&&!!u.ajax||!!u.data&&!!u.ajax&&t&&t!==-1:f=function(n,i,f){var e=this.get_settings().xml_data.ajax.error;e&&e.call(this,n,i,f);t!==-1&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),i==="success"&&u.correct_state&&this.correct_state(t)):i==="success"&&u.correct_state&&this.get_container().children("ul").empty();r&&r.call(this)};e=function(r,e,o){r=o.responseText;var s=this.get_settings().xml_data.ajax.success;if(s&&(r=s.call(this,r,e,o)||r),r===""||r&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")==="")return f.call(this,o,e,"");this.parse_xml(r,n.proxy(function(r){r&&(r=r.replace(/ ?xmlns="[^"]*"/ig,""),r.length>10?(r=n(r),t!==-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(r),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(r.children()),u.clean_node&&this.clean_node(t),i&&i.call(this)):t&&t!==-1?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&(this.correct_state(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this)))},this))};u.ajax.context=this;u.ajax.error=f;u.ajax.success=e;u.ajax.dataType||(u.ajax.dataType="xml");n.isFunction(u.ajax.url)&&(u.ajax.url=u.ajax.url.call(this,t));n.isFunction(u.ajax.data)&&(u.ajax.data=u.ajax.data.call(this,t));n.ajax(u.ajax)}},parse_xml:function(t,r){var u=this._get_settings().xml_data;n.vakata.xslt(t,i[u.xsl],r)},get_xml:function(i,r,u,f,e){var o="",c=this._get_settings(),v=this,h,l,s,y,a;return i||(i="flat"),e||(e=0),r=this._get_node(r),r&&r!==-1||(r=this.get_container().find("> ul > li")),u=n.isArray(u)?u:["id","class"],!e&&this.data.types&&n.inArray(c.types.type_attr,u)===-1&&u.push(c.types.type_attr),f=n.isArray(f)?f:[],e||(c.xml_data.get_include_preamble&&(o+='<?xml version="1.0" encoding="UTF-8"?>'),o+="<root>"),r.each(function(){o+="<item";s=n(this);n.each(u,function(n,i){var r=s.attr(i);c.xml_data.get_skip_empty&&typeof r=="undefined"||(o+=" "+i+'="'+t((" "+(r||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"')});s.hasClass("jstree-open")&&(o+=' state="open"');s.hasClass("jstree-closed")&&(o+=' state="closed"');i==="flat"&&(o+=' parent_id="'+t(e)+'"');o+=">";o+="<content>";y=s.children("a");y.each(function(){h=n(this);a=!1;o+="<name";n.inArray("languages",c.plugins)!==-1&&n.each(c.languages,function(n,i){if(h.hasClass(i))return o+=' lang="'+t(i)+'"',a=i,!1});f.length&&n.each(f,function(n,i){var r=h.attr(i);c.xml_data.get_skip_empty&&typeof r=="undefined"||(o+=" "+i+'="'+t((" "+r||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"')});h.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length&&(o+=' icon="'+t(h.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"');h.children("ins").get(0).style.backgroundImage.length&&(o+=' icon="'+t(h.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,""))+'"');o+=">";o+="<![CDATA["+v.get_text(h,a)+"]\]>";o+="<\/name>"});o+="<\/content>";l=s[0].id||!0;s=s.find("> ul > li");l=s.length?v.get_xml(i,s,u,f,l):"";i=="nest"&&(o+=l);o+="<\/item>";i=="flat"&&(o+=l)}),e||(o+="<\/root>"),o}}})}(jQuery),function(n){n().jquery.split(".")[1]>=8?(n.expr[":"].jstree_contains=n.expr.createPseudo(function(n){return function(t){return(t.textContent||t.innerText||"").toLowerCase().indexOf(n.toLowerCase())>=0}}),n.expr[":"].jstree_title_contains=n.expr.createPseudo(function(n){return function(t){return(t.getAttribute("title")||"").toLowerCase().indexOf(n.toLowerCase())>=0}})):(n.expr[":"].jstree_contains=function(n,t,i){return(n.textContent||n.innerText||"").toLowerCase().indexOf(i[3].toLowerCase())>=0},n.expr[":"].jstree_title_contains=function(n,t,i){return(n.getAttribute("title")||"").toLowerCase().indexOf(i[3].toLowerCase())>=0});n.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=n();this._get_settings().search.show_only_matches&&this.get_container().bind("search.jstree",function(t,i){n(this).children("ul").find("li").hide().removeClass("jstree-last");i.rslt.nodes.parentsUntil(".jstree").addBack().show().filter("ul").each(function(){n(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){n(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})},defaults:{ajax:!1,search_method:"jstree_contains",show_only_matches:!1},_fn:{search:function(t,i){if(n.trim(t)===""){this.clear_search();return}var r=this.get_settings().search,e=this,u=function(){},f=function(){};if(this.data.search.str=t,!i&&r.ajax!==!1&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=!0;u=function(){};f=function(n,t,i){var r=this.get_settings().search.ajax.success;r&&(n=r.call(this,n,t,i)||n);this.data.search.to_open=n;this._Text_open()};r.ajax.context=this;r.ajax.error=u;r.ajax.success=f;n.isFunction(r.ajax.url)&&(r.ajax.url=r.ajax.url.call(this,t));n.isFunction(r.ajax.data)&&(r.ajax.data=r.ajax.data.call(this,t));r.ajax.data||(r.ajax.data={search_string:t});(!r.ajax.dataType||/^json/.exec(r.ajax.dataType))&&(r.ajax.dataType="json");n.ajax(r.ajax);return}this.data.search.result.length&&this.clear_search();this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+r.search_method+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){e.open_node(this,!1,!0)});this.__callback({nodes:this.data.search.result,str:t})},clear_search:function(){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=n()},_Text_open:function(){var i=this,r=!0,t=[],u=[];this.data.search.to_open.length&&(n.each(this.data.search.to_open,function(i,r){if(r=="#")return!0;n(r).length&&n(r).is(".jstree-closed")?t.push(r):u.push(r)}),t.length&&(this.data.search.to_open=u,n.each(t,function(n,t){i.open_node(t,function(){i._Text_open(!0)})}),r=!1));r&&this.search(this.data.search.str,!0)}}})}(jQuery),function(n){n.vakata.context={hide_on_mouseleave:!1,cnt:n("<div id='vakata-contextmenu' />"),vis:!1,tgt:!1,par:!1,func:!1,data:!1,rtl:!1,show:function(t,i,r,u,f,e,o){n.vakata.context.rtl=!!o;var c=n.vakata.context.parse(t),s,h;if(c){if(n.vakata.context.vis=!0,n.vakata.context.tgt=i,n.vakata.context.par=e||i||null,n.vakata.context.data=f||null,n.vakata.context.cnt.html(c).css({visibility:"hidden",display:"block",left:0,top:0}),n.vakata.context.hide_on_mouseleave)n.vakata.context.cnt.one("mouseleave",function(){n.vakata.context.hide()});s=n.vakata.context.cnt.height();h=n.vakata.context.cnt.width();r+h>n(document).width()&&(r=n(document).width()-(h+5),n.vakata.context.cnt.find("li > ul").addClass("right"));u+s>n(document).height()&&(u=u-(s+i[0].offsetHeight),n.vakata.context.cnt.find("li > ul").addClass("bottom"));n.vakata.context.cnt.css({left:r,top:u}).find("li:has(ul)").bind("mouseenter",function(){var i=n(document).width(),r=n(document).height(),t=n(this).children("ul").show();i!==n(document).width()&&t.toggleClass("right");r!==n(document).height()&&t.toggleClass("bottom")}).bind("mouseleave",function(){n(this).children("ul").hide()}).end().css({visibility:"visible"}).show();n(document).triggerHandler("context_show.vakata")}},hide:function(){n.vakata.context.vis=!1;n.vakata.context.cnt.attr("class","").css({visibility:"hidden"});n(document).triggerHandler("context_hide.vakata")},parse:function(t,i){if(!t)return!1;var r="",u=!1,f=!0;return i||(n.vakata.context.func={}),r+="<ul>",n.each(t,function(t,i){if(!i)return!0;n.vakata.context.func[t]=i.action;!f&&i.separator_before&&(r+="<li class='vakata-separator vakata-separator-before'><\/li>");f=!1;r+="<li class='"+(i._class||"")+(i._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";i.icon&&i.icon.indexOf("/")===-1&&(r+=" class='"+i.icon+"' ");i.icon&&i.icon.indexOf("/")!==-1&&(r+=" style='background:url("+i.icon+") center center no-repeat;' ");r+=">&#160;<\/ins><a href='#' rel='"+t+"'>";i.submenu&&(r+="<span style='float:"+(n.vakata.context.rtl?"left":"right")+";'>&raquo;<\/span>");r+=i.label+"<\/a>";i.submenu&&(u=n.vakata.context.parse(i.submenu,!0),u&&(r+=u));r+="<\/li>";i.separator_after&&(r+="<li class='vakata-separator vakata-separator-after'><\/li>",f=!0)}),r=r.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,""),r+="<\/ul>",n(document).triggerHandler("context_parse.vakata"),r.length>10?r:!1},exec:function(t){return n.isFunction(n.vakata.context.func[t])?(n.vakata.context.func[t].call(n.vakata.context.data,n.vakata.context.par),!0):!1}};n(function(){n.vakata.css.add_sheet({str:"#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; 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; } ",title:"vakata"});n.vakata.context.cnt.delegate("a","click",function(n){n.preventDefault()}).delegate("a","mouseup",function(){!n(this).parent().hasClass("jstree-contextmenu-disabled")&&n.vakata.context.exec(n(this).attr("rel"))?n.vakata.context.hide():n(this).blur()}).delegate("a","mouseover",function(){n.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");n(document).bind("mousedown",function(t){n.vakata.context.vis&&!n.contains(n.vakata.context.cnt[0],t.target)&&n.vakata.context.hide()});typeof n.hotkeys!="undefined"&&n(document).bind("keydown","up",function(t){if(n.vakata.context.vis){var i=n.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();i.length||(i=n.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last());i.addClass("vakata-hover");t.stopImmediatePropagation();t.preventDefault()}}).bind("keydown","down",function(t){if(n.vakata.context.vis){var i=n.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();i.length||(i=n.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first());i.addClass("vakata-hover");t.stopImmediatePropagation();t.preventDefault()}}).bind("keydown","right",function(t){n.vakata.context.vis&&(n.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault())}).bind("keydown","left",function(t){n.vakata.context.vis&&(n.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault())}).bind("keydown","esc",function(t){n.vakata.context.hide();t.preventDefault()}).bind("keydown","space",function(t){n.vakata.context.cnt.find(".vakata-hover").last().children("a").click();t.preventDefault()})});n.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",n.proxy(function(t){t.preventDefault();n(t.currentTarget).hasClass("jstree-loading")||this.show_contextmenu(t.currentTarget,t.pageX,t.pageY)},this)).delegate("a","click.jstree",n.proxy(function(){this.data.contextmenu&&n.vakata.context.hide()},this)).bind("destroy.jstree",n.proxy(function(){this.data.contextmenu&&n.vakata.context.hide()},this));n(document).bind("context_hide.vakata",n.proxy(function(){this.data.contextmenu=!1},this))},defaults:{select_node:!1,show_at_node:!0,items:{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(n){this.create(n)}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(n){this.rename(n)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(n){this.is_selected(n)?this.remove():this.remove(n)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(n){this.cut(n)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(n){this.copy(n)}},paste:{separator_before:!1,icon:!1,separator_after:!1,label:"Paste",action:function(n){this.paste(n)}}}}}},_fn:{show_contextmenu:function(t,i,r){t=this._get_node(t);var f=this.get_settings().contextmenu,o=t.children("a:visible:eq(0)"),e=!1,u=!1;f.select_node&&this.data.ui&&!this.is_selected(t)&&(this.deselect_all(),this.select_node(t,!0));(f.show_at_node||typeof i=="undefined"||typeof r=="undefined")&&(e=o.offset(),i=e.left,r=e.top+this.data.core.li_height);u=t.data("jstree")&&t.data("jstree").contextmenu?t.data("jstree").contextmenu:f.items;n.isFunction(u)&&(u=u.call(this,t));this.data.contextmenu=!0;n.vakata.context.show(u,o,i,r,this,t,this._get_settings().core.rtl);this.data.themes&&n.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}})}(jQuery),function(t){t.jstree.plugin("types",{__init:function(){var i=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",t.proxy(function(){var u=i.types,f=i.type_attr,n="",r=this;t.each(u,function(i,u){if(t.each(u,function(n){/^(max_depth|max_children|icon|valid_children)$/.test(n)||r.data.types.attach_to.push(n)}),!u.icon)return!0;(u.icon.image||u.icon.position)&&(n+=i=="default"?".jstree-"+r.get_index()+" a > .jstree-icon { ":".jstree-"+r.get_index()+" li["+f+'="'+i+'"] > a > .jstree-icon { ',u.icon.image&&(n+=" background-image:url("+u.icon.image+"); "),n+=u.icon.position?" background-position:"+u.icon.position+"; ":" background-position:0 0; ",n+="} ")});n!==""&&t.vakata.css.add_sheet({str:n,title:"jstree-types"})},this)).bind("before.jstree",t.proxy(function(n,i){var r,f,u=this._get_settings().types.use_data?this._get_node(i.args[0]):!1,e=u&&u!==-1&&u.length?u.data("jstree"):!1;if(e&&e.types&&e.types[i.func]===!1)return n.stopImmediatePropagation(),!1;if(t.inArray(i.func,this.data.types.attach_to)!==-1){if(!i.args[0]||!i.args[0].tagName&&!i.args[0].jquery)return;if(r=this._get_settings().types.types,f=this._get_type(i.args[0]),(r[f]&&typeof r[f][i.func]!="undefined"||r["default"]&&typeof r["default"][i.func]!="undefined")&&this._check(i.func,i.args[0])===!1)return n.stopImmediatePropagation(),!1}},this));n&&this.get_container().bind("load_node.jstree set_type.jstree",t.proxy(function(n,i){var u=i&&i.rslt&&i.rslt.obj&&i.rslt.obj!==-1?this._get_node(i.rslt.obj).parent():this.get_container_ul(),r=!1,f=this._get_settings().types;t.each(f.types,function(n,t){t.icon&&(t.icon.image||t.icon.position)&&(r=n==="default"?u.find("li > a > .jstree-icon"):u.find("li["+f.type_attr+"='"+n+"'] > a > .jstree-icon"),t.icon.image&&r.css("backgroundImage","url("+t.icon.image+")"),r.css("backgroundPosition",t.icon.position||"0 0"))})},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:!1,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(n,t){t.type&&this._get_settings().types.use_data&&this.set_type(t.type,n)},_get_type:function(n){return n=this._get_node(n),!n||!n.length?!1:n.attr(this._get_settings().types.type_attr)||"default"},set_type:function(n,t){t=this._get_node(t);var i=!t.length||!n?!1:t.attr(this._get_settings().types.type_attr,n);return i&&this.__callback({obj:t,type:n}),i},_check:function(n,i,r){i=this._get_node(i);var u=!1,s=this._get_type(i),e=0,h=this,f=this._get_settings().types,o=!1;if(i===-1){if(!f[n])return;u=f[n]}else{if(s===!1)return;o=f.use_data?i.data("jstree"):!1;o&&o.types&&typeof o.types[n]!="undefined"?u=o.types[n]:!f.types[s]||typeof f.types[s][n]=="undefined"?!f.types["default"]||typeof f.types["default"][n]=="undefined"||(u=f.types["default"][n]):u=f.types[s][n]}return t.isFunction(u)&&(u=u.call(this,i)),n==="max_depth"&&i!==-1&&r!==!1&&f.max_depth!==-2&&u!==0&&i.children("a:eq(0)").parentsUntil(".jstree","li").each(function(t){if(f.max_depth!==-1&&f.max_depth-(t+1)<=0||(e=t===0?u:h._check(n,this,!1),e!==-1&&e-(t+1)<=0))return u=0,!1;e>=0&&(e-(t+1)<u||u<0)&&(u=e-(t+1));f.max_depth>=0&&(f.max_depth-(t+1)<u||u<0)&&(u=f.max_depth-(t+1))}),u},check_move:function(){if(!this.__call_old())return!1;var n=this._get_move(),e=n.rt._get_settings().types,o=n.rt._check("max_children",n.cr),u=n.rt._check("max_depth",n.cr),f=n.rt._check("valid_children",n.cr),s=0,i=1,r;if(f==="none"||t.isArray(f)&&n.ot&&n.ot._get_type&&(n.o.each(function(){if(t.inArray(n.ot._get_type(this),f)===-1)return i=!1,!1}),i===!1)||e.max_children!==-2&&o!==-1&&(s=n.cr===-1?this.get_container().find("> ul > li").not(n.o).length:n.cr.find("> ul > li").not(n.o).length,s+n.o.length>o))return!1;if(e.max_depth!==-2&&u!==-1){if(i=0,u===0)return!1;if(typeof n.o.d=="undefined"){for(r=n.o;r.length>0;)r=r.find("> ul > li"),i++;n.o.d=i}if(u-n.o.d<0)return!1}return!0},create_node:function(n,i,r,u,f,e){if(!e&&(f||this._is_loaded(n))){var o=typeof i=="string"&&i.match(/^before|after$/i)&&n!==-1?this._get_parent(n):this._get_node(n),s=this._get_settings().types,c=this._check("max_children",o),l=this._check("max_depth",o),h=this._check("valid_children",o),a;if(typeof r=="string"&&(r={data:r}),r||(r={}),h==="none")return!1;if(t.isArray(h))if(r.attr&&r.attr[s.type_attr]){if(t.inArray(r.attr[s.type_attr],h)===-1)return!1}else r.attr||(r.attr={}),r.attr[s.type_attr]=h[0];if(s.max_children!==-2&&c!==-1&&(a=o===-1?this.get_container().find("> ul > li").length:o.find("> ul > li").length,a+1>c)||s.max_depth!==-2&&l!==-1&&l-1<0)return!1}return this.__call_old(!0,n,i,r,u,f,e)}}})}(jQuery),function(n){n.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(!0);this.data.html_data.original_container_html.find("li").addBack().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:!1,ajax:!1,correct_state:!0},_fn:{load_node:function(n,t,i){var r=this;this.load_node_html(n,function(){r.__callback({obj:r._get_node(n)});t.call(this)},i)},_is_loaded:function(t){return t=this._get_node(t),t==-1||!t||!this._get_settings().html_data.ajax&&!n.isFunction(this._get_settings().html_data.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").size()>0},load_node_html:function(t,i,r){var f,u=this.get_settings().html_data,e=function(){},o=function(){};if(t=this._get_node(t),t&&t!==-1){if(t.data("jstree_is_loading"))return;t.data("jstree_is_loading",!0)}switch(!0){case n.isFunction(u.data):u.data.call(this,t,n.proxy(function(r){r&&r!==""&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")!==""?(r=n(r),r.is("ul")||(r=n("<ul />").append(r)),t!=-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(r).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;<\/ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(r.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||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(t),i&&i.call(this)):t&&t!==-1?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&(this.correct_state(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this))},this));break;case!u.data&&!u.ajax:t&&t!=-1||(this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||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());i&&i.call(this);break;case!!u.data&&!u.ajax||!!u.data&&!!u.ajax&&(!t||t===-1):t&&t!=-1||(f=n(u.data),f.is("ul")||(f=n("<ul />").append(f)),this.get_container().children("ul").empty().append(f.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||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());i&&i.call(this);break;case!u.data&&!!u.ajax||!!u.data&&!!u.ajax&&t&&t!==-1:t=this._get_node(t);e=function(n,i,f){var e=this.get_settings().html_data.ajax.error;e&&e.call(this,n,i,f);t!=-1&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),i==="success"&&u.correct_state&&this.correct_state(t)):i==="success"&&u.correct_state&&this.get_container().children("ul").empty();r&&r.call(this)};o=function(r,f,o){var s=this.get_settings().html_data.ajax.success;if(s&&(r=s.call(this,r,f,o)||r),r===""||r&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")==="")return e.call(this,o,f,"");r?(r=n(r),r.is("ul")||(r=n("<ul />").append(r)),t!=-1&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(r).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;<\/ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(r.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||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(t),i&&i.call(this)):t&&t!==-1?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),u.correct_state&&(this.correct_state(t),i&&i.call(this))):u.correct_state&&(this.get_container().children("ul").empty(),i&&i.call(this))};u.ajax.context=this;u.ajax.error=e;u.ajax.success=o;u.ajax.dataType||(u.ajax.dataType="html");n.isFunction(u.ajax.url)&&(u.ajax.url=u.ajax.url.call(this,t));n.isFunction(u.ajax.data)&&(u.ajax.data=u.ajax.data.call(this,t));n.ajax(u.ajax)}}}});n.jstree.defaults.plugins.push("html_data")}(jQuery),function(n){n.jstree.plugin("themeroller",{__init:function(){var t=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(i){n(i.currentTarget).hasClass("jstree-loading")||n(this).addClass(t.item_h)}).delegate("a","mouseleave.jstree",function(){n(this).removeClass(t.item_h)}).bind("init.jstree",n.proxy(function(n,t){t.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(t.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",n.proxy(function(n,t){this._themeroller(t.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",n.proxy(function(){this._themeroller()},this)).bind("close_node.jstree",n.proxy(function(n,t){this._themeroller(t.rslt.obj)},this)).bind("delete_node.jstree",n.proxy(function(n,t){this._themeroller(t.rslt.parent)},this)).bind("correct_state.jstree",n.proxy(function(n,i){i.rslt.obj.children("ins.jstree-icon").removeClass(t.opened+" "+t.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(t.item_open+" "+t.item_clsd).addClass(t.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",n.proxy(function(n,i){i.rslt.obj.children("a").addClass(t.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",n.proxy(function(){this.get_container().find("a."+t.item_a).removeClass(t.item_a).end().find("a.jstree-clicked").addClass(t.item_a)},this)).bind("dehover_node.jstree",n.proxy(function(n,i){i.rslt.obj.children("a").removeClass(t.item_h)},this)).bind("hover_node.jstree",n.proxy(function(n,i){this.get_container().find("a."+t.item_h).not(i.rslt.obj).removeClass(t.item_h);i.rslt.obj.children("a").addClass(t.item_h)},this)).bind("move_node.jstree",n.proxy(function(n,t){this._themeroller(t.rslt.o);this._themeroller(t.rslt.op)},this))},__destroy:function(){var i=this._get_settings().themeroller,t=["ui-icon"];n.each(i,function(n,i){i=i.split(" ");i.length&&(t=t.concat(i))});this.get_container().removeClass("ui-widget-content").find("."+t.join(", .")).removeClass(t.join(" "))},_fn:{_themeroller:function(n){var t=this._get_settings().themeroller;n=!n||n==-1?this.get_container_ul():this._get_node(n);n=!n||n==-1?this.get_container_ul():n.parent();n.find("li.jstree-closed").children("ins.jstree-icon").removeClass(t.opened).addClass("ui-icon "+t.closed).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(t.item_leaf+" "+t.item_open).addClass(t.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(t.closed).addClass("ui-icon "+t.opened).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(t.item_leaf+" "+t.item_clsd).addClass(t.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(t.closed+" ui-icon "+t.opened).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(t.item_clsd+" "+t.item_open).addClass(t.item_leaf||"jstree-no-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_open:"ui-icon-folder-open",item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});n(function(){n.vakata.css.add_sheet({str:".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }",title:"jstree"})})}(jQuery),function(n){n.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",n.proxy(function(t,i){var u=[],f=!0,r,e;return i.func=="move_node"&&i.args[4]===!0&&i.args[0].o&&i.args[0].o.length&&(i.args[0].o.children("a").each(function(){u.push(n(this).text().replace(/^\s+/g,""))}),f=this._check_unique(u,i.args[0].np.find("> ul > li").not(i.args[0].o),"move_node")),i.func=="create_node"&&(i.args[4]||this._is_loaded(i.args[0]))&&(r=this._get_node(i.args[0]),i.args[1]&&(i.args[1]==="before"||i.args[1]==="after")&&(r=this._get_parent(i.args[0]),r&&r!==-1||(r=this.get_container())),typeof i.args[2]=="string"?u.push(i.args[2]):i.args[2]&&i.args[2].data?u.push(i.args[2].data):u.push(this._get_string("new_node")),f=this._check_unique(u,r.find("> ul > li"),"create_node")),i.func=="rename_node"&&(u.push(i.args[1]),e=this._get_node(i.args[0]),r=this._get_parent(e),r&&r!==-1||(r=this.get_container()),f=this._check_unique(u,r.find("> ul > li").not(e),"rename_node")),f?void 0:(t.stopPropagation(),!1)},this))},defaults:{error_callback:n.noop},_fn:{_check_unique:function(t,i,r){var u=[],f=!0;return(i.children("a").each(function(){u.push(n(this).text().replace(/^\s+/g,""))}),!u.length||!t.length)?!0:(n.each(t,function(t,i){if(n.inArray(i,u)!==-1)return f=!1,!1}),f||this._get_settings().unique.error_callback.call(null,t,i,r),f)},check_move:function(){if(!this.__call_old())return!1;var t=this._get_move(),i=[];return t.o&&t.o.length?(t.o.children("a").each(function(){i.push(n(this).text().replace(/^\s+/g,""))}),this._check_unique(i,t.np.find("> ul > li").not(t.o),"check_move")):!0}}})}(jQuery),function(r){r.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui)throw"jsTree wholerow: jsTree UI plugin not included.";this.data.wholerow.html=!1;this.data.wholerow.to=!1;this.get_container().bind("init.jstree",r.proxy(function(){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",r.proxy(function(n,t){this._prepare_wholerow_span(t&&t.rslt&&t.rslt.obj?t.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",r.proxy(function(n,t){this.data.to&&clearTimeout(this.data.to);this.data.to=setTimeout(function(n,t){return function(){n._prepare_wholerow_ul(t)}}(this,t&&t.rslt&&t.rslt.obj?t.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",r.proxy(function(){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",r.proxy(function(n,t){t.rslt.obj.each(function(){var n=t.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+parseInt((r(this).offset().top-t.inst.get_container().offset().top+t.inst.get_container()[0].scrollTop)/t.inst.data.core.li_height,10)+")");n.children("a").attr("class",t.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",r.proxy(function(n,t){if(this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:"")),n.type==="hover_node"){var i=this.get_container().find(" > .jstree-wholerow li:visible:eq("+parseInt((t.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height,10)+")");i.children("a").attr("class",t.rslt.obj.children(".jstree-hovered").attr("class"))}},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(n){var t=r(n.currentTarget);n.target.tagName==="A"||n.target.tagName==="INS"&&t.closest("li").is(".jstree-open, .jstree-closed")||(t.closest("li").children("a:visible:eq(0)").click(),n.stopImmediatePropagation())}).delegate("li","mouseover.jstree",r.proxy(function(n){return(n.stopImmediatePropagation(),r(n.currentTarget).children(".jstree-hovered, .jstree-clicked").length)?!1:(this.hover_node(n.currentTarget),!1)},this)).delegate("li","mouseleave.jstree",r.proxy(function(n){r(n.currentTarget).children("a").hasClass("jstree-hovered").length||this.dehover_node(n.currentTarget)},this));(t||n)&&r.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(n){(n=!n||n==-1?this.get_container().find("> ul > li"):this._get_node(n),n!==!1)&&n.each(function(){r(this).find("li").addBack().each(function(){var n=r(this);if(n.children(".jstree-wholerow-span").length)return!0;n.prepend("<span class='jstree-wholerow-span' style='width:"+n.parentsUntil(".jstree","li").length*18+"px;'>&#160;<\/span>")})})},_prepare_wholerow_ul:function(){var n=this.get_container().children("ul").eq(0),i=n.html();n.addClass("jstree-wholerow-real");this.data.wholerow.last_html!==i&&(this.data.wholerow.last_html=i,this.get_container().children(".jstree-wholerow").remove(),this.get_container().append(n.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(n.parent()[0].scrollWidth).css("top",(n.height()+(t?5:0))*-1).find("li[id]").each(function(){this.removeAttribute("id")}).end()))}}});r(function(){var u=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";i&&(u+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } ");(t||n)&&(u+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ");r.vakata.css.add_sheet({str:u,title:"jstree"})})}(jQuery),function(n){var t=["getChildren","getChildrenCount","getAttr","getName","getProps"],i=function(t,i){var r=!0;return t=t||{},i=[].concat(i),n.each(i,function(i,u){if(!n.isFunction(t[u]))return r=!1,!1}),r};n.jstree.plugin("model",{__init:function(){if(!this.data.json_data)throw"jsTree model: jsTree json_data plugin not included.";this._get_settings().json_data.data=function(r,u){var f=r==-1?this._get_settings().model.object:r.data("jstree_model");if(!i(f,t))return u.call(null,!1);this._get_settings().model.async?f.getChildren(n.proxy(function(n){this.model_done(n,u)},this)):this.model_done(f.getChildren(),u)}},defaults:{object:!1,id_prefix:!1,async:!1},_fn:{model_done:function(t,i){var u=[],r=this._get_settings(),f=this;n.isArray(t)||(t=[t]);n.each(t,function(t,i){var e=i.getProps()||{};e.attr=i.getAttr()||{};i.getChildrenCount()&&(e.state="closed");e.data=i.getName();n.isArray(e.data)||(e.data=[e.data]);f.data.types&&n.isFunction(i.getType)&&(e.attr[r.types.type_attr]=i.getType());e.attr.id&&r.model.id_prefix&&(e.attr.id=r.model.id_prefix+e.attr.id);e.metadata||(e.metadata={});e.metadata.jstree_model=i;u.push(e)});i.call(null,u)}}})}(jQuery)}}()