metamaps--metamaps/public/assets/application.js

34 lines
646 KiB
JavaScript
Raw Normal View History

/*!
* jQuery JavaScript Library v1.8.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
*/
function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function openAnalyze(){analyzeOpen=!0,findOpen&&closeFind(),organizeOpen&&closeOrganize(),$("#sideOptionFind").css("z-index","8"),$("#sideOptionAnalyze, #closeAnalyze").css("z-index","10"),$("#sideOptionOrganize").css("z-index","8"),$("#sideOptionAnalyze").animate({width:"100px",height:"76px"},100),$("#closeAnalyze").css("display","block"),$("#sideOptionAnalyze").css("cursor","default")}function closeAnalyze(){analyzeOpen=!1,$("#closeAnalyze").css("display","none"),$("#sideOptionAnalyze").css("cursor","pointer"),$("#sideOptionAnalyze").animate({width:"64px",height:"32px"},100)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){!e.getData("inCommons")&&!e.getData("onCanvas")&&(e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",1,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function onCanvasSearch(e,t,n){Mconsole.graph.eachNode(function(r){e!=null?r.name.indexOf(e)!==-1&&e!=""?r.setData("onCanvas",!0):r.setData("onCanvas",!1):t!=null?r.getData("inmaps").indexOf(parseInt(t))!==-1?r.setData("onCanvas",!0):r.setData("onCanvas",!1):n!=null&&(r.getData("userid").toString()==n?r.setData("onCanvas",!0):r.setData("onCanvas",!1)),Mconsole.plot()})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id)}),Mconsole.plot()}function clearFoundData(){Mconsole.graph.eachNode(function(e){e.getData("inCommons")===!0&&(Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id))}),Mconsole.plot()}function openFind(){findOpen=!0,analyzeOpen&&closeAnalyze(),organizeOpen&&closeOrganize(),$("#sideOptionFind, #closeFind").css("z-index","10"),$("#sideOptionAnalyze").css("z-index","9"),$("#sideOptionOrganize").css("z-index","8"),firstVal=$('#sideOptionFind option[value="name"]').attr("selected"),secondVal=$('#sideOptionFind option[value="metacode"]').attr("selected"),thirdVal=$('#sideOptionFind option[value="map (by name)"]').attr("selected"),fourthVal=$('#sideOptionFind option[value="mapper (by name)"]').attr("selected"),firstVal==="selected"||thirdVal==="selected"||fourthVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#topic_by_name_input").focus()}):secondVal==="selected"?$("#sideOptionFind").animate({width:"380px",height:"463px"},100,function(){}):thirdVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#map_by_name_input").focus()}):fourthVal==="selected"&&$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#mapper_by_name_input").focus()}),$("#closeFind, #findWhere").css("display","block"),$("#sideOptionFind").css("cursor","default")}function closeFind(){findOpen=!1,Mconsole.graph.eachNode(function(e){e.setData("inCommons",!1),e.setData("onCanvas",!1)}),Mconsole.plot(),$("#closeFind, #findWhere").css("display","none"),$("#sideOptionFind").css("cursor","pointer"),$("#sideOptionFind").animate({width:
t,n){var r,i,s,o,u,a,f,l,c=this,h=e.style,p={},d=[],m=e.nodeType&&Gt(e);n.queue||(f=v._queueHooks(e,"fx"),f.unqueued==null&&(f.unqueued=0,l=f.empty.fire,f.empty.fire=function(){f.unqueued||l()}),f.unqueued++,c.always(function(){c.always(function(){f.unqueued--,v.queue(e,"fx").length||f.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?h.display="inline-block":h.zoom=1)),n.overflow&&(h.overflow="hidden",v.support.shrinkWrapBlocks||c.done(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r];if(s===(m?"hide":"show"))continue;d.push(r)}}o=d.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),m?v(e).show():c.done(function(){v(e).hide()}),c.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in p)v.style(e,t,p[t])});for(r=0;r<o;r++)i=d[r],a=c.createTween(i,m?u[i]:0),p[i]=u[i]||v.style(e,i),i in u||(u[i]=a.start,m&&(a.end=a.start,a.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},
tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length==1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;r
;return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();retu
n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return this.options.iframeFix===!0&&e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.browser.msie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWid
o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost"
.helper=null;if(!n){for(var s=0;s<r.length;s++)r[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}}),e.extend(e.ui.sortable,{version:"1.8.23"})}(jQuery),jQuery.effects||function(e,t){function n(t){var n;return t&&t.constructor==Array&&t.length==3?t:(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]:(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?[parseFloat(n[1])*2.55,parseFloat(n[2])*2.55,parseFloat(n[3])*2.55]:(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]:(n=/rgba\(0, 0, 0, 0\)/.exec(t))?i.transparent:i[e.trim(t).toLowerCase()]}function r(t,r){var i;do{i=(e.curCSS||e.css)(t,r);if(i!=""&&i!="transparent"||e.nodeName(t,"body"))break;r="backgroundColor"}while(t=t.parentNode);return n(i)}function u(){var e=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,t={},n,r;if(e&&e.length&&e[0]&&e[e[0]]){var i=e.length;while(i--)n=e[i],typeof e[n]=="string"&&(r=n.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()}),t[r]=e[n])}else for(n in e)typeof e[n]=="string"&&(t[n]=e[n]);return t}function a(t){var n,r;for(n in t)r=t[n],(r==null||e.isFunction(r)||n in o||/scrollbar/.test(n)||!/color/i.test(n)&&isNaN(parseFloat(r)))&&delete t[n];return t}function f(e,t){var n={_:0},r;for(r in t)e[r]!=t[r]&&(n[r]=t[r]);return n}function l(t,n,r,i){typeof t=="object"&&(i=n,r=null,n=t,t=n.effect),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n=n||{},r=r||n.duration,r=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,i=i||n.complete,[t,n,r,i]}function c(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects[t]?!0:!1}e.effects={},e.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(t,i){e.fx.step[i]=function(e){e.colorInit||(e.start=r(e.elem,i),e.end=n(e.end),e.colorInit=!0),e.elem.style[i]="rgb("+Math.max(Math.min(parseInt(e.pos*(e.end[0]-e.start[0])+e.start[0],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[1]-e.start[1])+e.start[1],10),255),0)+","+Math.max(Math.min(parseInt(e.pos*(e.end[2]-e.start[2])+e.start[2],10),255),0)+")"}});var i={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},s=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.effects.animateClass=function(t,n,r,i){return e.isFunction(r)&&(i=r,r=null),this.queue(function(){var o=e(this),l=o.attr("style")||" ",c=a(u.call(t
.zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),e.fn.bgiframe&&this.menu.element.bgiframe(),t.beforeunloadHandler=function(){t.element.removeAttr("autocomplete")},e(window).bind("beforeunload",t.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),e(window).unbind("beforeunload",this.beforeunloadHandler),e.Widget.prototype.destroy.call(this)},_setOption:function(t,n){e.Widget.prototype._setOption.apply(this,arguments),t==="source"&&this._initSource(),t==="appendTo"&&this.menu.element.appendTo(e(n||"body",this.element[0].ownerDocument)[0]),t==="disabled"&&n&&this.xhr&&this.xhr.abort()},_initSource:function(){var t=this,n,r;e.isArray(this.options.source)?(n=this.options.source,this.source=function(t,r){r(e.ui.autocomplete.filter(n,t.term))}):typeof this.options.source=="string"?(r=this.options.source,this.source=function(n,i){t.xhr&&t.xhr.abort(),t.xhr=e.ajax({url:r,data:n,dataType:"json",success:function(e,t){i(e)},error:function(){i([])}})}):this.source=this.options.source},search:function(e,t){e=e!=null?e:this.element.val(),this.term=this.element.val();if(e.length<this.options.minLength)return this.close(t);clearTimeout(this.closing);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){!this.options.disabled&&e&&e.length?(e=this._normalize(e),this._suggest(e),this._trigger("open")):this.close()},close:function(e){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",e))},_change:function(e){this.previous!==this.element.val()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.deactivate(),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new e.Event("mouseover"))},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItem(t,n)})},_renderItem:function(t,n){return e("<li></li>").data("item.autocomplete",n).append(e("<a></a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term),this.menu.deactivate();return}this.menu[e](t)},widget:function(){return this.menu.element},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}})}(jQuery),function(e){e.widget("ui.menu",{_create:function(){var t=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(n){if(!e(n.target).closest(".ui-menu-item a").length)return;n.preventDefault(),t.select(n)}),this.refresh()},refresh:function(){var t=this,n=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");n.children("a").addClass("ui-corner-all").attr("tabinde
$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length)throw"Extra/unparsed characters found in date: "+t.substring(g);a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var w=this._getDaysInMonth(a,f-1);if(l<=w)break;f++,l-=w}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;ca
),n.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",u=e(n).offset(function(e,t){return t}).offset(),r.innerHTML="",i.removeChild(r),a=u.top+u.left+(t?2e3:0),s.fractions=a>21&&a<22}()}(jQuery),function(e,t){e.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),e.Widget.prototype.destroy.apply(this,arguments)},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(t,n){t==="value"&&(this.options.value=n,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),e.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}}),e.extend(e.ui.progressbar,{version:"1.8.23"})}(jQuery),function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t=this,r=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=r.values&&r.values.length||1,u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(r.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),r.range&&(r.range===!0&&(r.values||(r.values=[this._valueMin(),this._valueMin()]),r.values.length&&r.values.length!==2&&(r.values=[r.values[0],r.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(r.range==="min"||r.range==="max"?" ui-slider-range-"+r.range:"")));for(var a=i.length;a<o;a+=1)u.push(s);this.handles=i.add(e(u.join("")).appendTo(t.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){r.disabled||e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-state-hover")}).focus(function(){r.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("index.ui-slider-handle",t)}),this.handles.keydown(function(r){var i=e(this).data("index.ui-slider-handle"),s,o,u,a;if(t.options.disabled)return;switch(r.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:r.preventDefault();if(!t._keySliding){t._keySliding=!0,e(this).addClass("ui-state-active"),s=t._start(r,i);if(s===!1)return}}a=t.options.step,t.options.values&&t.options.values.length?o=u=t.values(i):o=u=t.value();switch(r.keyCode){case e.ui.keyCode.HOME:u=t._valueMin();break;case e.ui.keyCode.END:u=t._valueMax();break;case e.ui.keyCode.PAGE
]);t[0]==currentCollectionValue&&n.attr("selected","selected"),select_elt.append(n)}),e.append(select_elt),this.element.html(e),this.setHtmlAttributes(),this.element.find("select").bind("change",{editor:this},BestInPlaceEditor.forms.select.blurHandler),this.element.find("select").bind("blur",{editor:this},BestInPlaceEditor.forms.select.blurHandler),this.element.find("select").bind("keyup",{editor:this},BestInPlaceEditor.forms.select.keyupHandler),this.element.find("select")[0].focus()},getValue:function(){return this.sanitizeValue(this.element.find("select").val())},blurHandler:function(e){e.data.editor.update()},keyupHandler:function(e){e.keyCode==27&&e.data.editor.abort()}},checkbox:{activateForm:function(){var e=Boolean(this.oldValue.toLowerCase()!=this.values[1].toLowerCase()),t=e?this.values[1]:this.values[0];this.element.html(t),this.setHtmlAttributes(),this.update()},getValue:function(){return Boolean(this.element.html().toLowerCase()==this.values[1].toLowerCase())}},textarea:{activateForm:function(){width=this.element.css("width"),height=this.element.css("height");var e=jQuery(document.createElement("form")).attr("action","javascript:void(0)").attr("style","display:inline").append(jQuery(document.createElement("textarea")).val(this.sanitizeValue(this.display_value)));this.okButton&&e.append(jQuery(document.createElement("input")).attr("type","submit").attr("value",this.okButton)),this.cancelButton&&e.append(jQuery(document.createElement("input")).attr("type","button").attr("value",this.cancelButton)),this.element.html(e),this.setHtmlAttributes(),jQuery(this.element.find("textarea")[0]).css({"min-width":width,"min-height":height}),jQuery(this.element.find("textarea")[0]).elastic(),this.element.find("textarea")[0].focus(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.textarea.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.textarea.cancelButtonHandler),this.element.find("textarea").bind("blur",{editor:this},BestInPlaceEditor.forms.textarea.blurHandler),this.element.find("textarea").bind("keyup",{editor:this},BestInPlaceEditor.forms.textarea.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){return this.sanitizeValue(this.element.find("textarea").val())},blurHandler:function(e){e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abortIfConfirm()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.update()},500):e.data.editor.update()},submitHandler:function(e){e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.update()},cancelButtonHandler:function(e){e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.abortIfConfirm(),e.stopPropagation()},keyupHandler:function(e){e.keyCode==27&&e.data.editor.abortIfConfirm()}}},jQuery.fn.best_in_place=function(){function e(e){if(!e.data("bestInPlaceEditor"))return e.data("bestInPlaceEditor",new BestInPlaceEditor(e)),!0}return jQuery(this.context).delegate(this.selector,"click",function(){var t=jQuery(this);e(t)&&t.click()}),this.each(function(){e(jQuery(this))}),this},function(e){e.fn.extend({elastic:function(){var t=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"];return this.each(function(){function f(e,t){curratedHeight=Math.floor(parseInt(e,10)),n.height()!=curratedHeight&&n.css({height:curratedHeight+"px",overflow:t})}function l(){var e=n.val().replace(/&/g,"&amp;").replace(/ /g,"&nbsp;").replace(/<|>/g,"&gt;").replace(/\n/g,"<br />"),t=r.html().replace(/<br>/ig,"<br />");if(e+"&nbsp;"!=t){r.html(e+"&nbsp;");if(Math.abs(r.height()+i-n.height())>3){var u=r.height()+i;u>=o?f(o,"auto"):u<=s?f(s,"hidden"):f(u,"hidden")}}}if(this.type!="textarea")return!1;var n=e(this),r=e("<div />").css({position:"absolute",display:"none","word-wrap":"break-word"}),i=parseInt(n.css("line-height"),10)||parseInt(n.c
,!0)):secondVal=="checked"?$("#topic_by_name_input").autocomplete("option","disabled",!0):alert("You either need to have searching On Your Canvas or In the Commons enabled")},stop:function(e,t){firstVal=$("#onCanvas").attr("checked"),secondVal=$("#inCommons").attr("checked");var n=$("#topic_by_name_input").val();firstVal=="checked"&&secondVal=="checked"?(setTimeout(function(){onCanvasSearch(n,null,null)},0),$("#topicsByName").val(n),$("#topicsByUser").val(""),$("#topicsByMap").val(""),$("#get_topics_form").submit()):firstVal=="checked"?setTimeout(function(){onCanvasSearch(n,null,null)},0):secondVal=="checked"&&($("#topicsByName").val(n),$("#topicsByUser").val(""),$("#topicsByMap").val(""),$("#get_topics_form").submit()),n==""&&clearFoundData()},delay:2e3}),$("#sideOptionFind .select_content").change(function(){firstVal=$(this).children("option[value='topics']").attr("selected"),secondVal=$(this).children("option[value='maps']").attr("selected"),thirdVal=$(this).children("option[value='mappers']").attr("selected"),firstVal=="selected"?($("#sideOptionFind .select_type").children("option[value='metacode']").removeAttr("disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").removeAttr("disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").removeAttr("disabled"),$(".find").css("display","none"),$(".find_topic_by_name").css("display","block"),$("#topic_by_name_input").focus()):secondVal=="selected"?($("#sideOptionFind .select_type").val()!="name"&&($("#sideOptionFind .select_type").val("name"),$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){})),$("#sideOptionFind .select_type").children("option[value='metacode']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").attr("disabled","disabled"),$(".find").css("display","none"),$(".find_map_by_name").css("display","block"),$("#map_by_name_input").focus()):thirdVal=="selected"&&($("#sideOptionFind .select_type").val("name"),$("#sideOptionFind .select_type").children("option[value='metacode']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='map (by name)']").attr("disabled","disabled"),$("#sideOptionFind .select_type").children("option[value='mapper (by name)']").attr("disabled","disabled"),$(".find").css("display","none"),$(".find_mapper_by_name").css("display","block"),$("#mapper_by_name_input").focus())}),$("#sideOptionFind .select_type").change(function(){firstVal=$(this).children("option[value='name']").attr("selected"),secondVal=$(this).children("option[value='metacode']").attr("selected"),thirdVal=$(this).children("option[value='map (by name)']").attr("selected"),fourthVal=$(this).children("option[value='mapper (by name)']").attr("selected"),firstVal==="selected"?$(".find").fadeOut("fast",function(){showAll(),$(".find_topic_by_metacode ul li").not("#hideAll, #showAll").removeClass("toggledOff");for(var e in categoryVisible)categoryVisible[e]=!0;$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_topic_by_name").css("display","block"),$("#topic_by_name_input").focus()})}):secondVal==="selected"?$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"380px",height:"463px"},300,function(){$(".find_topic_by_metacode").fadeIn("fast")})}):thirdVal==="selected"?$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_map_by_name").css("display","block"),$("#map_by_name_input").focus()})}):fourthVal==="selected"&&$(".find").fadeOut("fast",function(){$("#sideOptionFind").animate({width:"305px",height:"76px"},300,function(){$(".find_mapper_by_name").css("display","block"),$("#mapper_by_name_input").focus()})})}),$(".find_topic_by_name #topic_by_name_input").bind("railsAutocomplete.select",function(e,t){t.item.id!=undefined&&window.open("/topics/"+t.item.id),$(".find_topic_by_name #topic_
return i("div",{id:t,style:{overflow:"visible",position:"absolute",top:0,left:0,width:n.width+"px",height:0}});if(e=="SVG"){var s=document.createElementNS(r,"svg:svg");s.setAttribute("width",n.width),s.setAttribute("height",n.height);var o=s.style;o.position="absolute",o.left=o.top="0px";var u=document.createElementNS(r,"svg:g");return u.setAttribute("width",n.width),u.setAttribute("height",n.height),u.setAttribute("x",0),u.setAttribute("y",0),u.setAttribute("id",t),s.appendChild(u),s}}}),f.Base=new t({translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(e){this.viz=e,this.opt=e.config,this.size=!1,this.createCanvas(),this.translateToCenter()},createCanvas:function(){var e=this.opt,t=e.width,n=e.height;this.canvas=i("canvas",{id:e.injectInto+e.idSuffix,width:t,height:n,style:{position:"absolute",top:0,left:0,width:t+"px",height:n+"px"}})},getCtx:function(){return this.ctx?this.ctx:this.ctx=this.canvas.getContext("2d")},getSize:function(){if(this.size)return this.size;var e=this.canvas;return this.size={width:e.width,height:e.height}},translateToCenter:function(e){var t=this.getSize(),n=e?t.width-e.width-this.translateOffsetX*2:t.width;height=e?t.height-e.height-this.translateOffsetY*2:t.height;var r=this.getCtx();e&&r.scale(1/this.scaleOffsetX,1/this.scaleOffsetY),r.translate(n/2,height/2)},resize:function(e,t){var n=this.getSize(),i=this.canvas,s=i.style;this.size=!1,i.width=e,i.height=t,s.width=e+"px",s.height=t+"px",r?this.translateToCenter():this.translateToCenter(n),this.translateOffsetX=this.translateOffsetY=0,this.scaleOffsetX=this.scaleOffsetY=1,this.clear(),this.viz.resize(e,t,this)},translate:function(e,t,n){var r=this.scaleOffsetX,i=this.scaleOffsetY;this.translateOffsetX+=e*r,this.translateOffsetY+=t*i,this.getCtx().translate(e,t),!n&&this.plot()},scale:function(e,t,n){this.scaleOffsetX*=e,this.scaleOffsetY*=t,this.getCtx().scale(e,t),!n&&this.plot()},clear:function(){var e=this.getSize(),t=this.translateOffsetX,n=this.translateOffsetY,r=this.scaleOffsetX,i=this.scaleOffsetY;this.getCtx().clearRect((-e.width/2-t)*1/r,(-e.height/2-n)*1/i,e.width*1/r,e.height*1/i)},plot:function(){this.clear(),this.viz.plot(this)}}),f.Background={},f.Background.Circles=new t({initialize:function(t,n){this.viz=t,this.config=e.merge({idSuffix:"-bkcanvas",levelDistance:100,numberOfCircles:6,CanvasStyles:{},offset:0},n)},resize:function(e,t,n){this.plot(n)},plot:function(e){var t=e.canvas,n=e.getCtx(),r=this.config,i=r.CanvasStyles;for(var s in i)n[s]=i[s];var o=r.numberOfCircles,u=r.levelDistance;for(var a=1;a<=o;a++)n.beginPath(),n.arc(0,0,u*a,0,2*Math.PI,!1),n.stroke(),n.closePath()}})})();var l=function(e,t){this.theta=e,this.rho=t};$jit.Polar=l,l.prototype={getc:function(e){return this.toComplex(e)},getp:function(){return this},set:function(e){e=e.getp(),this.theta=e.theta,this.rho=e.rho},setc:function(e,t){this.rho=Math.sqrt(e*e+t*t),this.theta=Math.atan2(t,e),this.theta<0&&(this.theta+=Math.PI*2)},setp:function(e,t){this.theta=e,this.rho=t},clone:function(){return new l(this.theta,this.rho)},toComplex:function(e){var t=Math.cos(this.theta)*this.rho,n=Math.sin(this.theta)*this.rho;return e?{x:t,y:n}:new h(t,n)},add:function(e){return new l(this.theta+e.theta,this.rho+e.rho)},scale:function(e){return new l(this.theta,this.rho*e)},equals:function(e){return this.theta==e.theta&&this.rho==e.rho},$add:function(e){return this.theta=this.theta+e.theta,this.rho+=e.rho,this},$madd:function(e){return this.theta=(this.theta+e.theta)%(Math.PI*2),this.rho+=e.rho,this},$scale:function(e){return this.rho*=e,this},interpolate:function(e,t){var n=Math.PI,r=n*2,i=function(e){var t=e<0?e%r+r:e%r;return t},s=this.theta,o=e.theta,u,a=Math.abs(s-o);a==n?s>o?u=i(o+(s-r-o)*t):u=i(o-r+(s-o)*t):a>=n?s>o?u=i(o+(s-r-o)*t):u=i(o-r+(s-(o-r))*t):u=i(o+(s-o)*t);var f=(this.rho-e.rho)*t+e.rho;return{theta:u,rho:f}}};var c=function(e,t){return new l(e,t)};l.KER=c(0,0);var h=function(e,t){this.x=e,this.y=t};$jit.Complex=h,h.prototype={getc:function(){return this},getp:function(e){return this.toPolar(e)},set:function(e){e=e.g
r}),t}},b=$jit.Layouts={},w={label:null,compute:function(t,n,r){this.initializeLabel(r);var i=this.label,s=i.style;t.eachNode(function(t){var n=t.getData("autoWidth"),r=t.getData("autoHeight");if(n||r){delete t.data.$width,delete t.data.$height,delete t.data.$dim;var o=t.getData("width"),u=t.getData("height");s.width=n?"auto":o+"px",s.height=r?"auto":u+"px",i.innerHTML=t.name;var a=i.offsetWidth,f=i.offsetHeight,l=t.getData("type");if(e.indexOf(["circle","square","triangle","star"],l)===-1)t.setData("width",a),t.setData("height",f);else{var c=a>f?a:f;t.setData("width",c),t.setData("height",c),t.setData("dim",c)}}})},initializeLabel:function(e){this.label||(this.label=document.createElement("div"),document.body.appendChild(this.label)),this.setLabelStyles(e)},setLabelStyles:function(t){e.extend(this.label.style,{visibility:"hidden",position:"absolute",width:"auto",height:"auto"}),this.label.className="jit-autoadjust-label"}};b.Tree=function(){function r(e,t,n,r,i){var s=t.Node,o=t.multitree;if(s.overridable){var u=-1,a=-1;return e.eachNode(function(e){if(e._depth==n&&(!o||"$orn"in e.data&&e.data.$orn==r)){var t=e.getData("width",i),s=e.getData("height",i);u=u<t?t:u,a=a<s?s:a}}),{width:u<0?s.width:u,height:a<0?s.height:a}}return s}function i(e,t,n,r){var i=r=="left"||r=="right"?"y":"x";e.getPos(t)[i]+=n}function s(t,r){var i=[];return e.each(t,function(e){e=n.call(e),e[0]+=r,e[1]+=r,i.push(e)}),i}function o(e,t){if(e.length==0)return t;if(t.length==0)return e;var n=e.shift(),r=t.shift();return[[n[0],r[1]]].concat(o(e,t))}function u(e,t){t=t||[];if(e.length==0)return t;var n=e.pop();return u(e,o(n,t))}function a(e,t,n,r,i){if(e.length<=i||t.length<=i)return 0;var s=e[i][1],o=t[i][0];return Math.max(a(e,t,n,r,++i)+n,s-o+r)}function f(e,t,n){function r(e,i,u){if(i.length<=u)return[];var f=i[u],l=a(e,f,t,n,0);return[l].concat(r(o(e,s(f,l)),i,++u))}return r([],e,0)}function l(e,t,r){function i(e,n,u){if(n.length<=u)return[];var f=n[u],l=-a(f,e,t,r,0);return[l].concat(i(o(s(f,l),e),n,++u))}e=n.call(e);var u=i([],e.reverse(),0);return u.reverse()}function c(e,t,n,r){var i=f(e,t,n),s=l(e,t,n);r=="left"?s=i:r=="right"&&(i=s);for(var o=0,u=[];o<i.length;o++)u[o]=(i[o]+s[o])/2;return u}function h(e,t,n,o,a){function S(t,l,h){var p=t.getData(g,n),m=l||t.getData(y,n),x=[],T=[],N=!1,C=m+o.levelDistance;t.eachSubnode(function(t){if(t.exist&&(!f||"$orn"in t.data&&t.data.$orn==a)){N||(N=r(e,o,t._depth,a,n));var i=S(t,N[y],h+C);x.push(i.tree),T.push(i.extent)}});var k=c(T,w,b,E);for(var A=0,_=[],j=[];A<x.length;A++)i(x[A],n,k[A],a),j.push(s(T[A],k[A]));var F=[[-p/2,p/2]].concat(u(j));return t.getPos(n)[d]=0,a=="top"||a=="left"?t.getPos(n)[v]=h:t.getPos(n)[v]=-h,{tree:t,extent:F}}var f=o.multitree,l=["x","y"],h=["width","height"],p=+(a=="left"||a=="right"),d=l[p],v=l[1-p],m=o.Node,g=h[p],y=h[1-p],b=o.siblingOffset,w=o.subtreeOffset,E=o.align;S(t,!1,0)}var n=Array.prototype.slice;return new t({compute:function(t,n){var r=t||"start",i=this.graph.getNode(this.root);e.extend(i,{drawn:!0,exist:!0,selected:!0}),w.compute(this.graph,r,this.config),(!!n||!("_depth"in i))&&this.graph.computeLevels(this.root,0,"ignore"),this.computePositions(i,r)},computePositions:function(t,n){var r=this.config,i=r.multitree,s=r.align,o=s!=="center"&&r.indent,u=r.orientation,a=i?["top","right","bottom","left"]:[u],f=this;e.each(a,function(e){h(f.graph,t,n,f.config,e,n);var r=["x","y"][+(e=="left"||e=="right")];(function u(t){t.eachSubnode(function(a){a.exist&&(!i||"$orn"in a.data&&a.data.$orn==e)&&(a.getPos(n)[r]+=t.getPos(n)[r],o&&(a.getPos(n)[r]+=s=="left"?o:-o),u(a))})})(t)})}})}(),$jit.ST=function(){function r(e){e=e||this.clickedNode;if(!this.config.constrained)return[];var t=this.geom,r=this.graph,i=this.canvas,s=e._depth,o=[];r.eachNode(function(t){t.exist&&!t.selected&&(t.isDescendantOf(e.id)?t._depth<=s&&o.push(t):o.push(t))});var u=t.getRightLevelToShow(e,i);e.eachLevel(u,u,function(e){e.exist&&!e.selected&&o.push(e)});for(var a=0;a<n.length;a++){var f=this.graph.getNode(n[a]);f.isDescendantOf(e.id)||o.push(f)}return o}function s(e){var t=[],n=this.config;
.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=l.length,h=t.getData("colorArray"),p=h.length,d=t.getData("stringArray"),v=n.getCtx(),m={},g=t.getData("border"),y=t.getData("gradient"),b=t.getData("config"),w=b.orientation=="horizontal",E=b.showAggregates,S=b.showLabels,x=b.Label,T=(w?s:i)/c;if(h&&f&&d){for(var N=0,C=c,k=0,L=0;N<C;N++){v.fillStyle=v.strokeStyle=h[N%p];if(y){var A;w?A=v.createLinearGradient(u+f[N]/2,a+T*N,u+f[N]/2,a+T*(N+1)):A=v.createLinearGradient(u+T*N,a-f[N]/2,u+T*(N+1),a-f[N]/2);var O=e.rgbToHex(e.map(e.hexToRgb(h[N%p].slice(1)),function(e){return e*.5>>0}));A.addColorStop(0,O),A.addColorStop(.5,h[N%p]),A.addColorStop(1,O),v.fillStyle=A}w?v.fillRect(u,a+T*N,f[N],T):v.fillRect(u+T*N,a-f[N],T,f[N]),g&&g.name==d[N]&&(m.acum=T*N,m.dimValue=f[N]),k+=f[N]||0,L+=l[N]||0}g&&(v.save(),v.lineWidth=2,v.strokeStyle=g.color,w?v.strokeRect(u+1,a+m.acum+1,m.dimValue-2,T-2):v.strokeRect(u+m.acum+1,a-m.dimValue+1,T-2,m.dimValue-2),v.restore()),x.type=="Native"&&(v.save(),v.fillStyle=v.strokeStyle=x.color,v.font=x.style+" "+x.size+"px "+x.family,v.textBaseline="middle",E(t.name,L)&&(w?(v.textAlign="right",v.fillText(L,u+Math.max.apply(null,f)-b.labelOffset,a+s/2)):(v.textAlign="center",v.fillText(L,u+i/2,a-Math.max.apply(null,f)-x.size/2-b.labelOffset))),S(t.name,L,t)&&(w?(v.textAlign="center",v.translate(u-b.labelOffset-x.size/2,a+s/2),v.rotate(Math.PI/2),v.fillText(t.name,0,0)):(v.textAlign="center",v.fillText(t.name,u+i/2,a+x.size/2+b.labelOffset))),v.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=a.length,l=e.getData("config"),c=t.x-o,h=l.orientation=="horizontal",p=(h?i:r)/f;if(h){if(t.x<o||t.x>o+r||t.y>u+i||t.y<u)return!1}else if(t.x<o||t.x>o+r||t.y>u||t.y<u-i)return!1;for(var d=0,v=a.length;d<v;d++){var m=a[d];if(h){var g=u+p*d;if(t.x<=o+m&&t.y>=g&&t.y<=g+p)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}else{var g=o+p*d;if(t.x>=g&&t.x<=g+p&&t.y>=u-m)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}}return!1}}}),$jit.BarChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i=t.orientation=="horizontal",s={},o=new $jit.ST({injectInto:t.injectInto,orientation:i?"left":"bottom",levelDistance:0,siblingOffset:t.barsOffset,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"barchart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,n,r){if(!t.Events.enable)return;var i=n.getContains();t.Events.onClick(i,n,r)},onMouseMove:function(e,r,i){if(!t.hoveredColor)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var i=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t},0),a={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},f=a.wrapper,l=a.label,c=a.aggregate,h=f.style,p=l.style,d=c.style;s[r.id]=a,f.appendChild(l),f.appendChild(c),t.showLabels(r.name,u,r)||(p.display="none"),t.showAggregates(r.name,u,r)||(d.display="none"),h.position="relative",h.overflow="visible",h.fontSize=i.size+"px",h.fontFamily=i.family,h.color=i.color,h.textAlign="
){e.compute(),e.plot(),e.busy=!1}}):(e.compute(),e.plot(),e.busy=!1)}},n.animate?(this.clickedNode=o,this.compute("end"),this.clickedNode=u,this.fx.animate({modes:["linear","node-property:width:height"],duration:1e3,onComplete:function(){e.clickedNode=o,r.nodeList.setDataset(["current","end"],{alpha:[0,1]}),t.eachSubgraph(u,function(e){e.setData("alpha",1)},"ignore"),e.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})):callback.onComplete()},requestNodes:function(t,n){var r=e.merge(this.controller,n),i=this.config.constrained?this.config.levelsToShow:Number.MAX_VALUE;if(r.request){var s=[],o=t._depth;d.Util.eachLevel(t,0,i,function(e){e.drawn&&!d.Util.anySubnode(e)&&(s.push(e),e._level=e._depth-o,this.config.constrained&&(e._level=i-e._level))}),this.group.requestNodes(s,r)}else r.onComplete()}}),$jit.Icicle.Op=new t({Implements:d.Op}),$jit.Icicle.Group=new t({initialize:function(e){this.viz=e,this.canvas=e.canvas,this.config=e.config},requestNodes:function(e,t){var n=0,r=e.length,i={},s=function(){t.onComplete()},o=this.viz;r==0&&s();for(var u=0;u<r;u++)i[e[u].id]=e[u],t.request(e[u].id,e[u]._level,{onComplete:function(e,t){t&&t.children&&(t.id=e,o.op.sum(t,{type:"nothing"})),++n==r&&(d.Util.computeLevels(o.graph,o.root,0),s())}})}}),$jit.Icicle.Plot=new t({Implements:d.Plot,plot:function(t,n){t=t||this.viz.controller;var r=this.viz,i=r.graph,s=i.getNode(r.clickedNode&&r.clickedNode.id||r.root),o=s._depth;r.canvas.clear(),this.plotTree(s,e.merge(t,{withLabels:!0,hideLabels:!1,plotSubtree:function(e,t){return!r.config.constrained||t._depth-o<r.config.levelsToShow}}),n)}}),$jit.Icicle.Label={},$jit.Icicle.Label.Native=new t({Implements:d.Label.Native,renderLabel:function(e,t,n){var r=e.getCtx(),i=t.getData("width"),s=t.getData("height"),o=t.getLabelData("size"),u=r.measureText(t.name);if(s<o*1.5||i<u.width)return;var a=t.pos.getc(!0);r.fillText(t.name,a.x+i/2,a.y+s/2)}}),$jit.Icicle.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.getSize(),o={x:Math.round(r.x+s.width/2),y:Math.round(r.y+s.height/2)};e.setAttribute("x",o.x),e.setAttribute("y",o.y),n.onPlaceLabel(e,t)}}),$jit.Icicle.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.getSize(),o={x:Math.round(r.x+s.width/2),y:Math.round(r.y+s.height/2)},u=e.style;u.left=o.x+"px",u.top=o.y+"px",u.display="",n.onPlaceLabel(e,t)}}),$jit.Icicle.Plot.NodeTypes=new t({none:{render:e.empty},rectangle:{render:function(t,n,r){var i=this.viz.config,s=i.offset,o=t.getData("width"),u=t.getData("height"),a=t.getData("border"),f=t.pos.getc(!0),l=f.x+s/2,c=f.y+s/2,h=n.getCtx();if(o-s<2||u-s<2)return;if(i.cushion){var p=t.getData("color"),d=h.createRadialGradient(l+(o-s)/2,c+(u-s)/2,1,l+(o-s)/2,c+(u-s)/2,o<u?u:o),v=e.rgbToHex(e.map(e.hexToRgb(p),function(e){return e*.3>>0}));d.addColorStop(0,p),d.addColorStop(1,v),h.fillStyle=d}a&&(h.strokeStyle=a,h.lineWidth=3),h.fillRect(l,c,Math.max(0,o-s),Math.max(0,u-s)),a&&h.strokeRect(f.x,f.y,o,u)},contains:function(e,t){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(e,this.viz.clickedNode.id))return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+i/2},t,r,i)}}}),$jit.Icicle.Plot.EdgeTypes=new t({none:e.empty}),b.ForceDirected=new t({getOptions:function(e){var t=this.canvas.getSize(),n=t.width,r=t.height,i=0;this.graph.eachNode(function(e){i++});var s=n*r/i,o=Math.sqrt(s),u=this.config.levelDistance;return{width:n,height:r,tstart:n*.1,nodef:function(e){return s/(e||1)},edgef:function(e){return o*(e-u)}}},compute:function(t,n){var r=e.splat(t||["current","start","end"]),i=this.getOptions();w.compute(this.graph,r,this.config),this.graph.computeLevels(this.root,0,"ignore"),this.graph.eachNode(function(t){e.each(r,function(n){var s=t.getPos(n);s.equals(h.KER)&&(s.x=i.width/5*(Math.random()-.5),s.y=i.height/5*(Math.random()-.
,t.y+=e.scrollTop,e=e.parentNode;return t}function s(e){return/^(?:body|html)$/i.test(e.tagName)}var t=r(e),n=i(e);return{x:t.x-n.x,y:t.y-n.y}},e.event={get:function(e,t){return t=t||window,e||t.event},getWheel:function(e){return e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3},isRightClick:function(e){return e.which==3||e.button==2},getPos:function(e,t){t=t||window,e=e||t.event;var n=t.document;n=n.documentElement||n.body,e.touches&&e.touches.length&&(e=e.touches[0]);var r={x:e.pageX||e.clientX+n.scrollLeft,y:e.pageY||e.clientY+n.scrollTop};return r},stop:function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1}},$jit.util=$jit.id=e;var t=function(n){n=n||{};var r=function(){for(var n in this)typeof this[n]!="function"&&(this[n]=e.unlink(this[n]));this.constructor=r;if(t.prototyping)return this;var i=this.initialize?this.initialize.apply(this,arguments):this;return this.$$family="class",i};for(var i in t.Mutators){if(!n[i])continue;n=t.Mutators[i](n,n[i]),delete n[i]}return e.extend(r,this),r.constructor=t,r.prototype=n,r};t.Mutators={Implements:function(n,r){return e.each(e.splat(r),function(e){t.prototyping=e;var r=typeof e=="function"?new e:e;for(var i in r)i in n||(n[i]=r[i]);delete t.prototyping}),n}},e.extend(t,{inherit:function(n,r){for(var i in r){var s=r[i],o=n[i],u=e.type(s);o&&u=="function"?s!=o&&t.override(n,i,s):u=="object"?n[i]=e.merge(o,s):n[i]=s}return n},override:function(e,n,r){var i=t.prototyping;i&&e[n]!=i[n]&&(i=null);var s=function(){var t=this.parent;this.parent=i?i[n]:e[n];var s=r.apply(this,arguments);return this.parent=t,s};e[n]=s}}),t.prototype.implement=function(){var n=this.prototype;return e.each(Array.prototype.slice.call(arguments||[]),function(e){t.inherit(n,e)}),this},$jit.Class=t,$jit.json={prune:function(e,t){this.each(e,function(e,n){n==t&&e.children&&(delete e.children,e.children=[])})},getParent:function(e,t){if(e.id==t)return!1;var n=e.children;if(n&&n.length>0)for(var r=0;r<n.length;r++){if(n[r].id==t)return e;var i=this.getParent(n[r],t);if(i)return i}return!1},getSubtree:function(e,t){if(e.id==t)return e;for(var n=0,r=e.children;n<r.length;n++){var i=this.getSubtree(r[n],t);if(i!=null)return i}return null},eachLevel:function(e,t,n,r){if(t<=n){r(e,t);if(!e.children)return;for(var i=0,s=e.children;i<s.length;i++)this.eachLevel(s[i],t+1,n,r)}},each:function(e,t){this.eachLevel(e,0,Number.MAX_VALUE,t)}},$jit.Trans={$extend:!0,linear:function(e){return e}};var n=$jit.Trans;(function(){var t=function(t,n){return n=e.splat(n),e.extend(t,{easeIn:function(e){return t(e,n)},easeOut:function(e){return 1-t(1-e,n)},easeInOut:function(e){return e<=.5?t(2*e,n)/2:(2-t(2*(1-e),n))/2}})},r={Pow:function(e,t){return Math.pow(e,t[0]||6)},Expo:function(e){return Math.pow(2,8*(e-1))},Circ:function(e){return 1-Math.sin(Math.acos(e))},Sine:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Back:function(e,t){return t=t[0]||1.618,Math.pow(e,2)*((t+1)*e-t)},Bounce:function(e){var t;for(var n=0,r=1;1;n+=r,r/=2)if(e>=(7-4*n)/11){t=r*r-Math.pow((11-6*n-11*e)/4,2);break}return t},Elastic:function(e,t){return Math.pow(2,10*--e)*Math.cos(20*e*Math.PI*(t[0]||1)/3)}};e.each(r,function(e,r){n[r]=t(e)}),e.each(["Quad","Cubic","Quart","Quint"],function(e,r){n[e]=t(function(e){return Math.pow(e,[r+2])})})})();var r=new t({initialize:function(e){this.setOptions(e)},setOptions:function(t){var r={duration:2500,fps:40,transition:n.Quart.easeInOut,compute:e.empty,complete:e.empty,link:"ignore"};return this.opt=e.merge(r,t||{}),this},step:function(){var t=e.time(),n=this.opt;if(t<this.time+n.duration){var r=n.transition((t-this.time)/n.duration);n.compute(r)}else this.timer=clearInterval(this.timer),n.compute(1),n.complete()},start:function(){return this.check()?(this.time=0,this.startTimer(),this):this},startTimer:function(){var t=this,n=this.opt.fps;return this.timer?!1:(this.time=e.time()-this.time,this.timer=setInterval(function(){t.step()},Math.round(1e3/n)),!0)},pause:function(){return this.stopTimer(),this},resume:function(){return this.startTimer(),thi
d.Util,[this].concat(Array.prototype.slice.call(arguments)))}}),d.Op={options:{type:"nothing",duration:2e3,hideLabels:!0,fps:30},initialize:function(e){this.viz=e},removeNode:function(t,n){var r=this.viz,i=e.merge(this.options,r.controller,n),s=e.splat(t),o,u,a;switch(i.type){case"nothing":for(o=0;o<s.length;o++)r.graph.removeNode(s[o]);break;case"replot":this.removeNode(s,{type:"nothing"}),r.labels.clearLabels(),r.refresh(!0);break;case"fade:seq":case"fade":u=this;for(o=0;o<s.length;o++)a=r.graph.getNode(s[o]),a.setData("alpha",0,"end");r.fx.animate(e.merge(i,{modes:["node-property:alpha"],onComplete:function(){u.removeNode(s,{type:"nothing"}),r.labels.clearLabels(),r.reposition(),r.fx.animate(e.merge(i,{modes:["linear"]}))}}));break;case"fade:con":u=this;for(o=0;o<s.length;o++)a=r.graph.getNode(s[o]),a.setData("alpha",0,"end"),a.ignore=!0;r.reposition(),r.fx.animate(e.merge(i,{modes:["node-property:alpha","linear"],onComplete:function(){u.removeNode(s,{type:"nothing"})}}));break;case"iter":u=this,r.fx.sequence({condition:function(){return s.length!=0},step:function(){u.removeNode(s.shift(),{type:"nothing"}),r.labels.clearLabels()},onComplete:function(){i.onComplete()},duration:Math.ceil(i.duration/s.length)});break;default:this.doError()}},removeEdge:function(t,n){var r=this.viz,i=e.merge(this.options,r.controller,n),s=e.type(t[0])=="string"?[t]:t,o,u,a;switch(i.type){case"nothing":for(o=0;o<s.length;o++)r.graph.removeAdjacence(s[o][0],s[o][1]);break;case"replot":this.removeEdge(s,{type:"nothing"}),r.refresh(!0);break;case"fade:seq":case"fade":u=this;for(o=0;o<s.length;o++)a=r.graph.getAdjacence(s[o][0],s[o][1]),a&&a.setData("alpha",0,"end");r.fx.animate(e.merge(i,{modes:["edge-property:alpha"],onComplete:function(){u.removeEdge(s,{type:"nothing"}),r.reposition(),r.fx.animate(e.merge(i,{modes:["linear"]}))}}));break;case"fade:con":u=this;for(o=0;o<s.length;o++)a=r.graph.getAdjacence(s[o][0],s[o][1]),a&&(a.setData("alpha",0,"end"),a.ignore=!0);r.reposition(),r.fx.animate(e.merge(i,{modes:["edge-property:alpha","linear"],onComplete:function(){u.removeEdge(s,{type:"nothing"})}}));break;case"iter":u=this,r.fx.sequence({condition:function(){return s.length!=0},step:function(){u.removeEdge(s.shift(),{type:"nothing"}),r.labels.clearLabels()},onComplete:function(){i.onComplete()},duration:Math.ceil(i.duration/s.length)});break;default:this.doError()}},sum:function(t,n){var r=this.viz,i=e.merge(this.options,r.controller,n),s=r.root,o;r.root=n.id||r.root;switch(i.type){case"nothing":o=r.construct(t),o.eachNode(function(e){e.eachAdjacency(function(e){r.graph.addAdjacence(e.nodeFrom,e.nodeTo,e.data)})});break;case"replot":r.refresh(!0),this.sum(t,{type:"nothing"}),r.refresh(!0);break;case"fade:seq":case"fade":case"fade:con":that=this,o=r.construct(t);var u=this.preprocessSum(o),a=u?["node-property:alpha","edge-property:alpha"]:["node-property:alpha"];r.reposition(),i.type!="fade:con"?r.fx.animate(e.merge(i,{modes:["linear"],onComplete:function(){r.fx.animate(e.merge(i,{modes:a,onComplete:function(){i.onComplete()}}))}})):(r.graph.eachNode(function(e){e.id!=s&&e.pos.getp().equals(l.KER)&&(e.pos.set(e.endPos),e.startPos.set(e.endPos))}),r.fx.animate(e.merge(i,{modes:["linear"].concat(a)})));break;default:this.doError()}},morph:function(t,n,r){var i=this.viz,s=e.merge(this.options,i.controller,n),o=i.root,u;i.root=n.id||i.root;switch(s.type){case"nothing":u=i.construct(t),u.eachNode(function(e){var t=i.graph.hasNode(e.id);e.eachAdjacency(function(e){var t=!!i.graph.getAdjacence(e.nodeFrom.id,e.nodeTo.id);i.graph.addAdjacence(e.nodeFrom,e.nodeTo,e.data);if(t){var n=i.graph.getAdjacence(e.nodeFrom.id,e.nodeTo.id);for(var r in e.data||{})n.data[r]=e.data[r]}});if(t){var n=i.graph.getNode(e.id);for(var r in e.data||{})n.data[r]=e.data[r]}}),i.graph.eachNode(function(e){e.eachAdjacency(function(e){u.getAdjacence(e.nodeFrom.id,e.nodeTo.id)||i.graph.removeAdjacence(e.nodeFrom.id,e.nodeTo.id)}),u.hasNode(e.id)||i.graph.removeNode(e.id)});break;case"replot":i.labels.clearLabels(!0),this.morph(t,{type:"nothing"}),i.refresh(!0),i.refresh(!0);b
merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!1,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.json=null,this.root=null,this.busy=!1,this.parent=!1,this.initializeExtras()},createLevelDistanceFunc:function(){var e=this.config.levelDistance;return function(t){return(t._depth+1)*e}},refresh:function(){this.compute(),this.plot()},reposition:function(){this.compute("end")},plot:function(){this.fx.plot()},getNodeAndParentAngle:function(e){var t=!1,n=this.graph.getNode(e),r=n.getParents(),i=r.length>0?r[0]:!1;if(i){var s=i.pos.getc(),o=n.pos.getc(),u=s.add(o.scale(-1));t=Math.atan2(u.y,u.x),t<0&&(t+=2*Math.PI)}return{parent:i,theta:t}},tagChildren:function(e,t){if(e.angleSpan){var n=[];e.eachAdjacency(function(e){n.push(e.nodeTo)},"ignore");var r=n.length;for(var i=0;i<r&&t!=n[i].id;i++);for(var s=(i+1)%r,o=0;t!=n[s].id;s=(s+1)%r)n[s].dist=o++}},onClick:function(t,n){if(this.root!=t&&!this.busy){this.busy=!0,this.root=t,that=this,this.controller.onBeforeCompute(this.graph.getNode(t));var r=this.getNodeAndParentAngle(t);this.tagChildren(r.parent,t),this.parent=r.parent,this.compute("end");var i=r.theta-r.parent.endPos.theta;this.graph.eachNode(function(e){e.endPos.set(e.endPos.getp().add(c(i,0)))});var s=this.config.interpolation;n=e.merge({onComplete:e.empty},n||{}),this.fx.animate(e.merge({hideLabels:!0,modes:[s]},n,{onComplete:function(){that.busy=!1,n.onComplete()}}))}}}),$jit.RGraph.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)};e.setAttribute("x",l.x),e.setAttribute("y",l.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)},c=e.style;c.left=l.x+"px",c.top=l.y+"px",c.display=this.fitsInCanvas(l,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.circle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}},ellipse:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.ellipse.contains(n,t,r,i)}},square:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.square.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.square.contains(n,t,r)}},rectangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.rectangle.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains(n,t,r,i)}},triangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.triangle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.triangle.contains(n,t,r)}},star:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.star.render("fill",n,r,t)},contains:function(e,t){var n=e
[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.browser.msie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r),left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r)}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var f=this.relative_container.offset();u=[this.containment[0]+f.left,this.containment[1]+f.top,this.containment[2]+f.left,this.containment[3]+f.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-
bind("mouseup mouseout",C)}t.unbind("focusin").bind("focusin",function(){t.scrollTop(0).scrollLeft(0);var s=e(document.activeElement);if(s.is("input,textarea,select,button,a[tabindex],area,object"))if(f.data("horizontalScroll")){var o=n.position().left,u=s.position().left,a=t.width(),l=s.outerWidth();if(!(o+u>=0&&o+u<=a-l)){var c=u/f.data("scrollAmount");c>=r.width()-i.width()&&(c=r.width()-i.width()),i.css("left",c),f.mCustomScrollbar("scroll")}}else{var h=n.position().top,p=s.position().top,d=t.height(),v=s.outerHeight();if(!(h+p>=0&&h+p<=d-v)){var c=p/f.data("scrollAmount");c>=r.height()-i.height()&&(c=r.height()-i.height()),i.css("top",c),f.mCustomScrollbar("scroll")}}})},scroll:function(t){var n=e(this),r=n.find(".mCSB_dragger"),i=n.find(".mCSB_container"),s=n.find(".mCustomScrollBox");if(n.data("horizontalScroll"))var o=r.position().left,u=-o*n.data("scrollAmount"),a=i.position().left,f=Math.round(a-u);else var l=r.position().top,c=-l*n.data("scrollAmount"),h=i.position().top,p=Math.round(h-c);if(e.browser.webkit)var d=(window.outerWidth-8)/window.innerWidth,v=d<.98||d>1.02;n.data("scrollInertia")===0||v?(n.data("horizontalScroll")?i.css("left",u):i.css("top",c),t||n.mCustomScrollbar("callbacks",s,i)):n.data("horizontalScroll")?i.stop().animate({left:"-="+f},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)}):i.stop().animate({top:"-="+p},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)})},scrollTo:function(t,n){var r={moveDragger:!1,callback:!0},n=e.extend(r,n),i=e(this),s,o=i.find(".mCustomScrollBox"),u=o.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device"))var a=i.find(".mCSB_draggerContainer"),f=a.children(".mCSB_dragger");var l;if(t){if(typeof t=="number")n.moveDragger?s=t:(l=t,s=Math.round(l/i.data("scrollAmount")));else if(typeof t=="string"){var c;t==="top"?c=0:t==="bottom"&&!i.data("horizontalScroll")?c=u.outerHeight()-o.height():t==="left"?c=0:t==="right"&&i.data("horizontalScroll")?c=u.outerWidth()-o.width():t==="first"?c=i.find(".mCSB_container").find(":first"):t==="last"?c=i.find(".mCSB_container").find(":last"):c=i.find(t),c.length===1?(i.data("horizontalScroll")?l=c.position().left:l=c.position().top,e(document).data("mCS-is-touch-device")?s=l:s=Math.ceil(l/i.data("scrollAmount"))):s=c}e(document).data("mCS-is-touch-device")?i.data("horizontalScroll")?o.stop().animate({scrollLeft:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):o.stop().animate({scrollTop:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):(i.data("horizontalScroll")?(s>=a.width()-f.width()&&(s=a.width()-f.width()),f.css("left",s)):(s>=a.height()-f.height()&&(s=a.height()-f.height()),f.css("top",s)),n.callback?i.mCustomScrollbar("scroll"):i.mCustomScrollbar("scroll",!0))}},callbacks:function(t,n){var r=e(this);if(!e(document).data("mCS-is-touch-device"))if(r.data("horizontalScroll")){var i=Math.round(n.position().left);i<0&&i<=t.width()-n.outerWidth()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var s=Math.round(n.position().top);s<0&&s<=t.height()-n.outerHeight()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else if(r.data("horizontalScroll")){var o=Math.round(t.scrollLeft());o>0&&o>=n.outerWidth()-r.width()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var u=Math.round(t.scrollTop());u>0&&u>=n.outerHeight()-r.height()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}}};e.fn.mCustomScrollbar=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init.apply(this,arguments);e.error("Method "+n+" does not exist")}}(jQuery),function(e){function t(t){var n=t||window.event,r=[].slice.call(arguments,1)