From 5b2c20e475805d609d272cc7ea29b28f19d8e8ea Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 3 Mar 2014 02:17:44 -0800 Subject: [PATCH] precompiled --- app/assets/jit2.0.0-yc.js | 27 ++++++++++++++ ...cation-1b051639cbbcf2adbd41629e051c0485.js | 33 ++++++++++++++++++ ...ion-1b051639cbbcf2adbd41629e051c0485.js.gz | Bin 0 -> 175965 bytes public/assets/application.js | 20 +++++------ public/assets/application.js.gz | Bin 211751 -> 175965 bytes public/assets/manifest.yml | 4 +-- 6 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 app/assets/jit2.0.0-yc.js create mode 100644 public/assets/application-1b051639cbbcf2adbd41629e051c0485.js create mode 100644 public/assets/application-1b051639cbbcf2adbd41629e051c0485.js.gz diff --git a/app/assets/jit2.0.0-yc.js b/app/assets/jit2.0.0-yc.js new file mode 100644 index 00000000..468cd1d6 --- /dev/null +++ b/app/assets/jit2.0.0-yc.js @@ -0,0 +1,27 @@ +/* + Copyright (c) 2010, Nicolas Garcia Belmonte + All rights reserved + + > Redistribution and use in source and binary forms, with or without + > modification, are permitted provided that the following conditions are met: + > * Redistributions of source code must retain the above copyright + > notice, this list of conditions and the following disclaimer. + > * Redistributions in binary form must reproduce the above copyright + > notice, this list of conditions and the following disclaimer in the + > documentation and/or other materials provided with the distribution. + > * Neither the name of the organization nor the + > names of its contributors may be used to endorse or promote products + > derived from this software without specific prior written permission. + > + > THIS SOFTWARE IS PROVIDED BY NICOLAS GARCIA BELMONTE ``AS IS'' AND ANY + > EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + > DISCLAIMED. IN NO EVENT SHALL NICOLAS GARCIA BELMONTE BE LIABLE FOR ANY + > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + > (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + > ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + > (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + > SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function(){window.$jit=function(x){x=x||window;for(var y in $jit){if($jit[y].$extend){x[y]=$jit[y]}}};$jit.version="2.0.0b";var c=function(w){return document.getElementById(w)};c.empty=function(){};c.extend=function(y,w){for(var x in (w||{})){y[x]=w[x]}return y};c.lambda=function(w){return(typeof w=="function")?w:function(){return w}};c.time=Date.now||function(){return +new Date};c.splat=function(x){var w=c.type(x);return w?((w!="array")?[x]:x):[]};c.type=function(x){var w=c.type.s.call(x).match(/^\[object\s(.*)\]$/)[1].toLowerCase();if(w!="object"){return w}if(x&&x.$$family){return x.$$family}return(x&&x.nodeName&&x.nodeType==1)?"element":w};c.type.s=Object.prototype.toString;c.each=function(B,A){var z=c.type(B);if(z=="object"){for(var y in B){A(B[y],y)}}else{for(var x=0,w=B.length;x>16,y>>8&255,y&255]}};c.destroy=function(w){c.clean(w);if(w.parentNode){w.parentNode.removeChild(w)}if(w.clearAttributes){w.clearAttributes()}};c.clean=function(z){for(var y=z.childNodes,x=0,w=y.length;x-1};c.addClass=function(x,w){if(!c.hasClass(x,w)){x.className=(x.className+" "+w)}};c.removeClass=function(x,w){x.className=x.className.replace(new RegExp("(^|\\s)"+w+"(?:\\s|$)"),"$1")};c.getPos=function(y){var B=A(y);var w=z(y);return{x:B.x-w.x,y:B.y-w.y};function A(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.offsetLeft;C.y+=D.offsetTop;D=D.offsetParent}return C}function z(D){var C={x:0,y:0};while(D&&!x(D)){C.x+=D.scrollLeft;C.y+=D.scrollTop;D=D.parentNode}return C}function x(C){return(/^(?:body|html)$/i).test(C.tagName)}};c.event={get:function(x,w){w=w||window;return x||w.event},getWheel:function(w){return w.wheelDelta?w.wheelDelta/120:-(w.detail||0)/3},isRightClick:function(w){return(w.which==3||w.button==2)},getPos:function(z,y){y=y||window;z=z||y.event;var x=y.document;x=x.documentElement||x.body;if(z.touches&&z.touches.length){z=z.touches[0]}var w={x:z.pageX||(z.clientX+x.scrollLeft),y:z.pageY||(z.clientY+x.scrollTop)};return w},stop:function(w){if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;if(w.preventDefault){w.preventDefault()}else{w.returnValue=false}}};$jit.util=$jit.id=c;var q=function(x){x=x||{};var w=function(){for(var A in this){if(typeof this[A]!="function"){this[A]=c.unlink(this[A])}}this.constructor=w;if(q.prototyping){return this}var z=this.initialize?this.initialize.apply(this,arguments):this;this.$$family="class";return z};for(var y in q.Mutators){if(!x[y]){continue}x=q.Mutators[y](x,x[y]);delete x[y]}c.extend(w,this);w.constructor=q;w.prototype=x;return w};q.Mutators={Implements:function(w,x){c.each(c.splat(x),function(z){q.prototyping=z;var y=(typeof z=="function")?new z:z;for(var A in y){if(!(A in w)){w[A]=y[A]}}delete q.prototyping});return w}};c.extend(q,{inherit:function(w,z){for(var y in z){var x=z[y];var B=w[y];var A=c.type(x);if(B&&A=="function"){if(x!=B){q.override(w,y,x)}}else{if(A=="object"){w[y]=c.merge(B,x)}else{w[y]=x}}}return w},override:function(x,w,A){var z=q.prototyping;if(z&&x[w]!=z[w]){z=null}var y=function(){var B=this.parent;this.parent=z?z[w]:x[w];var C=A.apply(this,arguments);this.parent=B;return C};x[w]=y}});q.prototype.implement=function(){var w=this.prototype;c.each(Array.prototype.slice.call(arguments||[]),function(x){q.inherit(w,x)});return this};$jit.Class=q;$jit.json={prune:function(x,w){this.each(x,function(z,y){if(y==w&&z.children){delete z.children;z.children=[]}})},getParent:function(w,A){if(w.id==A){return false}var z=w.children;if(z&&z.length>0){for(var y=0;y=(7-4*z)/11){A=y*y-Math.pow((11-6*z-11*B)/4,2);break}}return A},Elastic:function(z,y){return Math.pow(2,10*--z)*Math.cos(20*z*Math.PI*(y[0]||1)/3)}};c.each(x,function(z,y){i[y]=w(z)});c.each(["Quad","Cubic","Quart","Quint"],function(z,y){i[z]=w(function(A){return Math.pow(A,[y+2])})})})();var u=new q({initialize:function(w){this.setOptions(w)},setOptions:function(w){var x={duration:2500,fps:40,transition:i.Quart.easeInOut,compute:c.empty,complete:c.empty,link:"ignore"};this.opt=c.merge(x,w||{});return this},step:function(){var x=c.time(),w=this.opt;if(xD.height)?(F.y-C.height-E):F.y+E)+"px";A.left=((F.x+C.width+w>D.width)?(F.x-C.width-w):F.x+w)+"px"},hide:function(w){this.tip.style.display="none";w&&this.config.onHide()}});o.Classes.NodeStyles=new q({Implements:[t,h],initializePost:function(){this.fx=this.viz.fx;this.types=this.viz.fx.nodeTypes;this.nStyles=this.config;this.nodeStylesOnHover=this.nStyles.stylesHover;this.nodeStylesOnClick=this.nStyles.stylesClick;this.hoveredNode=false;this.fx.nodeFxAnimation=new u();this.down=false;this.move=false},onMouseOut:function(y,x){this.down=this.move=false;if(!this.hoveredNode){return}if(this.dom&&this.isLabel(y,x)){this.toggleStylesOnHover(this.hoveredNode,false)}var w=y.relatedTarget,z=this.canvas.getElement();while(w&&w.parentNode){if(z==w.parentNode){return}w=w.parentNode}this.toggleStylesOnHover(this.hoveredNode,false);this.hoveredNode=false},onMouseOver:function(z,y){var w;if(this.dom&&(w=this.isLabel(z,y))){var x=this.viz.graph.getNode(w.id);if(x.selected){return}this.hoveredNode=x;this.toggleStylesOnHover(this.hoveredNode,true)}},onMouseDown:function(A,z,x,y){if(y){return}var w;if(this.dom&&(w=this.isLabel(A,z))){this.down=this.viz.graph.getNode(w.id)}else{if(!this.dom){this.down=x.getNode()}}this.move=false},onMouseUp:function(z,y,w,x){if(x){return}if(!this.move){this.onClick(w.getNode())}this.down=this.move=false},getRestoredStyles:function(x,w){var z={},y=this["nodeStylesOn"+w];for(var A in y){z[A]=x.styles["$"+A]}return z},toggleStylesOnHover:function(w,x){if(this.nodeStylesOnHover){this.toggleStylesOn("Hover",w,x)}},toggleStylesOnClick:function(w,x){if(this.nodeStylesOnClick){this.toggleStylesOn("Click",w,x)}},toggleStylesOn:function(A,w,C){var D=this.viz;var B=this.nStyles;if(C){var z=this;if(!w.styles){w.styles=c.merge(w.data,{})}for(var E in this["nodeStylesOn"+A]){var x="$"+E;if(!(x in w.styles)){w.styles[x]=w.getData(E)}}D.fx.nodeFx(c.extend({elements:{id:w.id,properties:z["nodeStylesOn"+A]},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}else{var y=this.getRestoredStyles(w,A);D.fx.nodeFx(c.extend({elements:{id:w.id,properties:y},transition:i.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(w){if(!w){return}var x=this.nodeStylesOnClick;if(!x){return}if(w.selected){this.toggleStylesOnClick(w,false);delete w.selected}else{this.viz.graph.eachNode(function(z){if(z.selected){for(var y in x){z.setData(y,z.styles["$"+y],"end")}delete z.selected}});this.toggleStylesOnClick(w,true);w.selected=true;delete w.hovered;this.hoveredNode=false}},onMouseMove:function(C,B,z){if(this.down){this.move=true}if(this.dom&&this.isLabel(C,B)){return}var A=this.nodeStylesOnHover;if(!A){return}if(!this.dom){if(this.hoveredNode){var x=this.types[this.hoveredNode.getData("type")];var w=x&&x.contains&&x.contains.call(this.fx,this.hoveredNode,z.getPos());if(w){return}}var y=z.getNode();if(!this.hoveredNode&&!y){return}if(y.hovered){return}if(y&&!y.selected){this.fx.nodeFxAnimation.stopTimer();this.viz.graph.eachNode(function(E){if(E.hovered&&!E.selected){for(var D in A){E.setData(D,E.styles["$"+D],"end")}delete E.hovered}});y.hovered=true;this.hoveredNode=y;this.toggleStylesOnHover(y,true)}else{if(this.hoveredNode&&!this.hoveredNode.selected){this.fx.nodeFxAnimation.stopTimer();this.toggleStylesOnHover(this.hoveredNode,false);delete this.hoveredNode.hovered;this.hoveredNode=false}}}}});o.Classes.Navigation=new q({Implements:[t,h],initializePost:function(){this.pos=false;this.pressed=false},onMouseWheel:function(z,y,w){if(!this.config.zooming){return}c.event.stop(c.event.get(z,y));var A=this.config.zooming/1000,x=1+w*A;this.canvas.scale(x,x)},onMouseDown:function(B,A,z){if(!this.config.panning){return}if(this.config.panning=="avoid nodes"&&z.getNode()){return}this.pressed=true;this.pos=z.getPos();var y=this.canvas,x=y.translateOffsetX,w=y.translateOffsetY,D=y.scaleOffsetX,C=y.scaleOffsetY;this.pos.x*=D;this.pos.x+=x;this.pos.y*=C;this.pos.y+=w},onMouseMove:function(D,C,F){if(!this.config.panning){return}if(!this.pressed){return}if(this.config.panning=="avoid nodes"&&F.getNode()){return}var B=this.pos,E=F.getPos(),z=this.canvas,A=z.translateOffsetX,w=z.translateOffsetY,J=z.scaleOffsetX,H=z.scaleOffsetY;E.x*=J;E.y*=H;E.x+=A;E.y+=w;var I=E.x-B.x,G=E.y-B.y;this.pos=E;this.canvas.translate(I*1/J,G*1/H)},onMouseUp:function(z,y,x,w){if(!this.config.panning){return}this.pressed=false}});var l;(function(){var w=typeof HTMLCanvasElement,y=(w=="object"||w=="function");function x(z,A){var B=document.createElement(z);for(var C in A){if(typeof A[C]=="object"){c.extend(B[C],A[C])}else{B[C]=A[C]}}if(z=="canvas"&&!y&&G_vmlCanvasManager){B=G_vmlCanvasManager.initElement(document.body.appendChild(B))}return B}$jit.Canvas=l=new q({canvases:[],pos:false,element:false,labelContainer:false,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(K,E){this.viz=K;this.opt=E;var B=c.type(E.injectInto)=="string"?E.injectInto:E.injectInto.id,C=B+"-label",z=c(B),D=E.width||z.offsetWidth,L=E.height||z.offsetHeight;this.id=B;var F={injectInto:B,width:D,height:L};this.element=x("div",{id:B+"-canvaswidget",style:{position:"relative",width:D+"px",height:L+"px"}});this.labelContainer=this.createLabelContainer(E.Label.type,C,F);this.canvases.push(new l.Base({config:c.extend({idSuffix:"-canvas"},F),plot:function(M){K.fx.plot()},resize:function(){K.refresh()}}));var G=E.background;if(G){var J=new l.Background[G.type](K,c.extend(G,F));this.canvases.push(new l.Base(J))}var I=this.canvases.length;while(I--){this.element.appendChild(this.canvases[I].canvas);if(I>0){this.canvases[I].plot()}}this.element.appendChild(this.labelContainer);z.appendChild(this.element);var A=null,H=this;c.addEvent(window,"scroll",function(){clearTimeout(A);A=setTimeout(function(){H.getPos(true)},500)})},getCtx:function(z){return this.canvases[z||0].getCtx()},getConfig:function(){return this.opt},getElement:function(){return this.element},getSize:function(z){return this.canvases[z||0].getSize()},resize:function(D,z){this.getPos(true);this.translateOffsetX=this.translateOffsetY=0;this.scaleOffsetX=this.scaleOffsetY=1;for(var B=0,A=this.canvases.length;BE){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E))*F))}}else{if(D>=z){if(B>E){A=x((E+((B-C)-E)*F))}else{A=x((E-C+(B-(E-C))*F))}}else{A=x((E+(B-E)*F))}}var w=(this.rho-y.rho)*F+y.rho;return{theta:A,rho:w}}};var k=function(x,w){return new b(x,w)};b.KER=k(0,0);var p=function(w,z){this.x=w;this.y=z};$jit.Complex=p;p.prototype={getc:function(){return this},getp:function(w){return this.toPolar(w)},set:function(w){w=w.getc(true);this.x=w.x;this.y=w.y},setc:function(w,z){this.x=w;this.y=z},setp:function(x,w){this.x=Math.cos(x)*w;this.y=Math.sin(x)*w},clone:function(){return new p(this.x,this.y)},toPolar:function(y){var w=this.norm();var x=Math.atan2(this.y,this.x);if(x<0){x+=Math.PI*2}if(y){return{theta:x,rho:w}}return new b(x,w)},norm:function(){return Math.sqrt(this.squaredNorm())},squaredNorm:function(){return this.x*this.x+this.y*this.y},add:function(w){return new p(this.x+w.x,this.y+w.y)},prod:function(w){return new p(this.x*w.x-this.y*w.y,this.y*w.x+this.x*w.y)},conjugate:function(){return new p(this.x,-this.y)},scale:function(w){return new p(this.x*w,this.y*w)},equals:function(w){return this.x==w.x&&this.y==w.y},$add:function(w){this.x+=w.x;this.y+=w.y;return this},$prod:function(A){var w=this.x,z=this.y;this.x=w*A.x-z*A.y;this.y=z*A.x+w*A.y;return this},$conjugate:function(){this.y=-this.y;return this},$scale:function(w){this.x*=w;this.y*=w;return this},$div:function(B){var w=this.x,A=this.y;var z=B.squaredNorm();this.x=w*B.x+A*B.y;this.y=A*B.x-w*B.y;return this.$scale(1/z)}};var r=function(x,w){return new p(x,w)};p.KER=r(0,0);$jit.Graph=new q({initialize:function(y,x,w,C){var A={complex:false,Node:{}};this.Node=x;this.Edge=w;this.Label=C;this.opt=c.merge(A,y||{});this.nodes={};this.edges={};var z=this;this.nodeList={};for(var B in j){z.nodeList[B]=(function(D){return function(){var E=Array.prototype.slice.call(arguments);z.eachNode(function(F){F[D].apply(F,E)})}})(B)}},getNode:function(w){if(this.hasNode(w)){return this.nodes[w]}return false},getByName:function(w){for(var y in this.nodes){var x=this.nodes[y];if(x.name==w){return x}}return false},getAdjacence:function(x,w){if(x in this.edges){return this.edges[x][w]}return false},addNode:function(x){if(!this.nodes[x.id]){var w=this.edges[x.id]={};this.nodes[x.id]=new e.Node(c.extend({id:x.id,name:x.name,data:c.merge(x.data||{},{}),adjacencies:w},this.opt.Node),this.opt.complex,this.Node,this.Edge,this.Label)}return this.nodes[x.id]},addAdjacence:function(z,y,x){if(!this.hasNode(z.id)){this.addNode(z)}if(!this.hasNode(y.id)){this.addNode(y)}z=this.nodes[z.id];y=this.nodes[y.id];if(!z.adjacentTo(y)){var A=this.edges[z.id]=this.edges[z.id]||{};var w=this.edges[y.id]=this.edges[y.id]||{};A[y.id]=w[z.id]=new e.Adjacence(z,y,x,this.Edge,this.Label);return A[y.id]}return this.edges[z.id][y.id]},removeNode:function(y){if(this.hasNode(y)){delete this.nodes[y];var x=this.edges[y];for(var w in x){delete this.edges[w][y]}delete this.edges[y]}},removeAdjacence:function(x,w){delete this.edges[x][w];delete this.edges[w][x]},hasNode:function(w){return w in this.nodes},empty:function(){this.nodes={};this.edges={}}});var e=$jit.Graph;var j;(function(){var w=function(D,F,A,C,E){var B;A=A||"current";D="$"+(D?D+"-":"");if(A=="current"){B=this.data}else{if(A=="start"){B=this.startData}else{if(A=="end"){B=this.endData}}}var z=D+F;if(C){return B[z]}if(!this.Config.overridable){return E[F]||0}return(z in B)?B[z]:((z in this.data)?this.data[z]:(E[F]||0))};var y=function(C,D,B,z){z=z||"current";C="$"+(C?C+"-":"");var A;if(z=="current"){A=this.data}else{if(z=="start"){A=this.startData}else{if(z=="end"){A=this.endData}}}A[C+D]=B};var x=function(B,z){B="$"+(B?B+"-":"");var A=this;c.each(z,function(D){var C=B+D;delete A.data[C];delete A.endData[C];delete A.startData[C]})};j={getData:function(B,z,A){return w.call(this,"",B,z,A,this.Config)},setData:function(B,A,z){y.call(this,"",B,A,z)},setDataset:function(C,D){C=c.splat(C);for(var z in D){for(var B=0,E=c.splat(D[z]),A=C.length;B=F&&I<=G&&w(H)){B(H,I)}if(II){y(K,F,G)}})}})(A,E+D,x+D)},eachSubgraph:function(x,y,w){this.eachLevel(x,0,false,y,w)},eachSubnode:function(x,y,w){this.eachLevel(x,1,1,y,w)},anySubnode:function(z,y,x){var w=false;y=y||c.lambda(true);var A=c.type(y)=="string"?function(B){return B[y]}:y;this.eachSubnode(z,function(B){if(A(B)){w=true}},x);return w},getSubnodes:function(B,C,w){var y=[],A=this;C=C||0;var z,x;if(c.type(C)=="array"){z=C[0];x=C[1]}else{z=C;x=Number.MAX_VALUE-B._depth}this.eachLevel(B,z,x,function(D){y.push(D)},w);return y},getParents:function(x){var w=[];this.eachAdjacency(x,function(y){var z=y.nodeTo;if(z._depth-1)){H.endData[J]=G[J]}else{H.data[J]=G[J]}}}});B.graph.eachNode(function(G){if(G.ignore){return}G.eachAdjacency(function(H){if(H.nodeFrom.ignore||H.nodeTo.ignore){return}var I=C.getNode(H.nodeFrom.id);var J=C.getNode(H.nodeTo.id);if(!I.adjacentTo(J)){var H=B.graph.getAdjacence(I.id,J.id);w=true;H.setData("alpha",1);H.setData("alpha",1,"start");H.setData("alpha",0,"end")}})});var w=this.preprocessSum(C);var y=!w?["node-property:alpha"]:["node-property:alpha","edge-property:alpha"];y[0]=y[0]+((z&&("node-property" in z))?(":"+c.splat(z["node-property"]).join(":")):"");y[1]=(y[1]||"edge-property:alpha")+((z&&("edge-property" in z))?(":"+c.splat(z["edge-property"]).join(":")):"");if(z&&("label-property" in z)){y.push("label-property:"+c.splat(z["label-property"]).join(":"))}B.reposition();B.graph.eachNode(function(G){if(G.id!=A&&G.pos.getp().equals(b.KER)){G.pos.set(G.endPos);G.startPos.set(G.endPos)}});B.fx.animate(c.merge(F,{modes:["polar"].concat(y),onComplete:function(){B.graph.eachNode(function(G){if(G.ignore){B.graph.removeNode(G.id)}});B.graph.eachNode(function(G){G.eachAdjacency(function(H){if(H.ignore){B.graph.removeAdjacence(H.nodeFrom.id,H.nodeTo.id)}})});F.onComplete()}}));break;default:}},contract:function(y,x){var w=this.viz;if(y.collapsed||!y.anySubnode(c.lambda(true))){return}x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});y.collapsed=true;(function z(A){A.eachSubnode(function(B){B.ignore=true;B.setData("alpha",0,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}(function z(A){A.eachSubnode(function(B){B.setPos(y.getPos("end"),"end");z(B)})})(y);w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},expand:function(y,x){if(!("collapsed" in y)){return}var w=this.viz;x=c.merge(this.options,w.config,x||{},{modes:["node-property:alpha:span","linear"]});delete y.collapsed;(function z(A){A.eachSubnode(function(B){delete B.ignore;B.setData("alpha",1,x.type=="animate"?"end":"current");z(B)})})(y);if(x.type=="animate"){w.compute("end");if(w.rotated){w.rotate(w.rotated,"none",{property:"end"})}w.fx.animate(x)}else{if(x.type=="replot"){w.refresh()}}},preprocessSum:function(x){var w=this.viz;x.eachNode(function(z){if(!w.graph.hasNode(z.id)){w.graph.addNode(z);var A=w.graph.getNode(z.id);A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}});var y=false;x.eachNode(function(z){z.eachAdjacency(function(A){var B=w.graph.getNode(A.nodeFrom.id);var C=w.graph.getNode(A.nodeTo.id);if(!B.adjacentTo(C)){var A=w.graph.addAdjacence(B,C,A.data);if(B.startAlpha==B.endAlpha&&C.startAlpha==C.endAlpha){y=true;A.setData("alpha",0);A.setData("alpha",0,"start");A.setData("alpha",1,"end")}}})});return y}};var a={none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,A,w,y){var x=y.getCtx();x.beginPath();x.arc(A.x,A.y,w,0,Math.PI*2,true);x.closePath();x[z]()},contains:function(B,A,w){var y=B.x-A.x,x=B.y-A.y,z=y*y+x*x;return z<=w*w}},ellipse:{render:function(A,B,z,w,y){var x=y.getCtx();w/=2;z/=2;x.save();x.scale(z/w,w/z);x.beginPath();x.arc(B.x*(w/z),B.y*(z/w),w,0,Math.PI*2,true);x.closePath();x[A]();x.restore()},contains:function(D,C,z,w){z/=2;w/=2;var B=(z+w)/2,y=D.x-C.x,x=D.y-C.y,A=y*y+x*x;return A<=B*B}},square:{render:function(x,z,y,w){w.getCtx()[x+"Rect"](z.x-y,z.y-y,2*y,2*y)},contains:function(y,x,w){return Math.abs(x.x-y.x)<=w&&Math.abs(x.y-y.y)<=w}},rectangle:{render:function(z,A,y,w,x){x.getCtx()[z+"Rect"](A.x-y/2,A.y-w/2,y,w)},contains:function(z,y,x,w){return Math.abs(y.x-z.x)<=x/2&&Math.abs(y.y-z.y)<=w/2}},triangle:{render:function(C,D,z,w){var G=w.getCtx(),y=D.x,x=D.y-z,F=y-z,E=D.y+z,B=y+z,A=E;G.beginPath();G.moveTo(y,x);G.lineTo(F,E);G.lineTo(B,A);G.closePath();G[C]()},contains:function(y,x,w){return a.circle.contains(y,x,w)}},star:{render:function(A,C,B,x){var w=x.getCtx(),z=Math.PI/5;w.save();w.translate(C.x,C.y);w.beginPath();w.moveTo(B,0);for(var y=0;y<9;y++){w.rotate(z);if(y%2==0){w.lineTo((B/0.525731)*0.200811,0)}else{w.lineTo(B,0)}}w.closePath();w[A]();w.restore()},contains:function(y,x,w){return a.circle.contains(y,x,w)}}};var m={line:{render:function(z,y,x){var w=x.getCtx();w.beginPath();w.moveTo(z.x,z.y);w.lineTo(y.x,y.y);w.stroke()},contains:function(G,y,B,E){var z=Math.min,C=Math.max,x=z(G.x,y.x),F=C(G.x,y.x),w=z(G.y,y.y),D=C(G.y,y.y);if(B.x>=x&&B.x<=F&&B.y>=w&&B.y<=D){if(Math.abs(y.x-G.x)<=E){return true}var A=(y.y-G.y)/(y.x-G.x)*(B.x-G.x)+G.y;return Math.abs(A-B.y)<=E}return false}},arrow:{render:function(F,G,z,x,w){var H=w.getCtx();if(x){var y=F;F=G;G=y}var C=new p(G.x-F.x,G.y-F.y);C.$scale(z/C.norm());var A=new p(G.x-C.x,G.y-C.y),B=new p(-C.y/2,C.x/2),E=A.add(B),D=A.$add(B.$scale(-1));H.beginPath();H.moveTo(F.x,F.y);H.lineTo(G.x,G.y);H.stroke();H.beginPath();H.moveTo(E.x,E.y);H.lineTo(D.x,D.y);H.lineTo(G.x,G.y);H.closePath();H.fill()},contains:function(x,w,z,y){return m.line.contains(x,w,z,y)}},hyperline:{render:function(D,E,w,y){var F=y.getCtx();var z=A(D,E);if(z.a>1000||z.b>1000||z.ratio<0){F.beginPath();F.moveTo(D.x*w,D.y*w);F.lineTo(E.x*w,E.y*w);F.stroke()}else{var C=Math.atan2(E.y-z.y,E.x-z.x);var B=Math.atan2(D.y-z.y,D.x-z.x);var x=x(C,B);F.beginPath();F.arc(z.x*w,z.y*w,z.ratio*w,C,B,x);F.stroke()}function A(S,R){var K=(S.x*R.y-S.y*R.x),G=K;var J=S.squaredNorm(),I=R.squaredNorm();if(K==0){return{x:0,y:0,ratio:-1}}var Q=(S.y*I-R.y*J+S.y-R.y)/K;var O=(R.x*J-S.x*I+R.x-S.x)/G;var P=-Q/2;var N=-O/2;var M=(Q*Q+O*O)/4-1;if(M<0){return{x:0,y:0,ratio:-1}}var L=Math.sqrt(M);var H={x:P,y:N,ratio:L>1000?-1:L,a:Q,b:O};return H}function x(G,H){return(GH)?false:true):((H+Math.PI>G)?true:false)}},contains:c.lambda(false)}};e.Plot={initialize:function(x,w){this.viz=x;this.config=x.config;this.node=x.config.Node;this.edge=x.config.Edge;this.animation=new u;this.nodeTypes=new w.Plot.NodeTypes;this.edgeTypes=new w.Plot.EdgeTypes;this.labels=x.labels},nodeHelper:a,edgeHelper:m,Interpolator:{map:{border:"color",color:"color",width:"number",height:"number",dim:"number",alpha:"number",lineWidth:"number",angularWidth:"number",span:"number",valueArray:"array-number",dimArray:"array-number"},canvas:{globalAlpha:"number",fillStyle:"color",strokeStyle:"color",lineWidth:"number",shadowBlur:"number",shadowColor:"color",shadowOffsetX:"number",shadowOffsetY:"number",miterLimit:"number"},label:{size:"number",color:"color"},compute:function(y,x,w){return y+(x-y)*w},moebius:function(D,C,F,z){var B=z.scale(-F);if(B.norm()<1){var w=B.x,E=B.y;var A=D.startPos.getc().moebiusTransformation(B);D.pos.setc(A.x,A.y);B.x=w;B.y=E}},linear:function(x,w,A){var z=x.startPos.getc(true);var y=x.endPos.getc(true);x.pos.setc(this.compute(z.x,y.x,A),this.compute(z.y,y.y,A))},polar:function(y,x,B){var A=y.startPos.getp(true);var z=y.endPos.getp();var w=z.interpolate(A,B);y.pos.setp(w.theta,w.rho)},number:function(x,C,B,w,A){var z=x[w](C,"start");var y=x[w](C,"end");x[A](C,this.compute(z,y,B))},color:function(y,w,E,B,z){var C=c.hexToRgb(y[B](w,"start"));var D=c.hexToRgb(y[B](w,"end"));var A=this.compute;var x=c.rgbToHex([parseInt(A(C[0],D[0],E)),parseInt(A(C[1],D[1],E)),parseInt(A(C[2],D[2],E))]);y[z](w,x)},"array-number":function(z,y,J,G,B){var H=z[G](y,"start"),I=z[G](y,"end"),K=[];for(var E=0,A=H.length;E=0.95){C.labels.plotLabel(y,I,x)}else{C.labels.hideLabel(I,false)}}F.restore();I.visited=!z})},plotTree:function(A,x,E){var B=this,C=this.viz,y=C.canvas,z=this.config,D=y.getCtx();var w=A.getData("alpha");A.eachSubnode(function(G){if(x.plotSubtree(A,G)&&G.exist&&G.drawn){var F=A.getAdjacency(G.id);!E&&x.onBeforePlotLine(F);D.globalAlpha=Math.min(w,G.getData("alpha"));B.plotLine(F,y,E);!E&&x.onAfterPlotLine(F);B.plotTree(G,x,E)}});if(A.drawn){!E&&x.onBeforePlotNode(A);this.plotNode(A,y,E);!E&&x.onAfterPlotNode(A);if(!x.hideLabels&&x.withLabels&&w>=0.95){this.labels.plotLabel(y,A,x)}else{this.labels.hideLabel(A,false)}}else{this.labels.hideLabel(A,true)}},plotNode:function(y,x,F){var C=y.getData("type"),B=this.node.CanvasStyles;if(C!="none"){var w=y.getData("lineWidth"),A=y.getData("color"),z=y.getData("alpha"),D=x.getCtx();D.lineWidth=w;D.fillStyle=D.strokeStyle=A;D.globalAlpha=z;for(var E in B){D[E]=y.getCanvasStyle(E)}this.nodeTypes[C].render.call(this,y,x,F)}},plotLine:function(B,x,E){var A=B.getData("type"),z=this.edge.CanvasStyles;if(A!="none"){var w=B.getData("lineWidth"),y=B.getData("color"),C=x.getCtx();C.lineWidth=w;C.fillStyle=C.strokeStyle=y;for(var D in z){C[D]=B.getCanvasStyle(D)}this.edgeTypes[A].render.call(this,B,x,E)}}};e.Label={};e.Label.Native=new q({plotLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.font=z.getLabelData("style")+" "+z.getLabelData("size")+"px "+z.getLabelData("family");w.textAlign=z.getLabelData("textAlign");w.fillStyle=w.strokeStyle=z.getLabelData("color");w.textBaseline=z.getLabelData("textBaseline");this.renderLabel(y,z,x)},renderLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.fillText(z.name,A.x,A.y+z.getData("height")/2)},hideLabel:c.empty,hideLabels:c.empty});e.Label.DOM=new q({labelsHidden:false,labelContainer:false,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(w){return(w in this.labels&&this.labels[w]!=null)?this.labels[w]:this.labels[w]=document.getElementById(w)},hideLabels:function(x){var w=this.getLabelContainer();if(x){w.style.display="none"}else{w.style.display=""}this.labelsHidden=x},clearLabels:function(w){for(var x in this.labels){if(w||!this.viz.graph.hasNode(x)){this.disposeLabel(x);delete this.labels[x]}}},disposeLabel:function(x){var w=this.getLabel(x);if(w&&w.parentNode){w.parentNode.removeChild(w)}},hideLabel:function(A,w){A=c.splat(A);var x=w?"":"none",y,z=this;c.each(A,function(C){var B=z.getLabel(C.id);if(B){B.style.display=x}})},fitsInCanvas:function(y,w){var x=w.getSize();if(y.x>=x.width||y.x<0||y.y>=x.height||y.y<0){return false}return true}});e.Label.HTML=new q({Implements:e.Label.DOM,plotLabel:function(z,A,y){var B=A.id,w=this.getLabel(B);if(!w&&!(w=document.getElementById(B))){w=document.createElement("div");var x=this.getLabelContainer();w.id=B;w.className="node";w.style.position="absolute";y.onCreateLabel(w,A);x.appendChild(w);this.labels[A.id]=w}this.placeLabel(w,A,y)}});e.Label.SVG=new q({Implements:e.Label.DOM,plotLabel:function(z,B,y){var D=B.id,w=this.getLabel(D);if(!w&&!(w=document.getElementById(D))){var A="http://www.w3.org/2000/svg";w=document.createElementNS(A,"svg:text");var C=document.createElementNS(A,"svg:tspan");w.appendChild(C);var x=this.getLabelContainer();w.setAttribute("id",D);w.setAttribute("class","node");x.appendChild(w);y.onCreateLabel(w,B);this.labels[B.id]=w}this.placeLabel(w,B,y)}});e.Geom=new q({initialize:function(w){this.viz=w;this.config=w.config;this.node=w.config.Node;this.edge=w.config.Edge},translate:function(x,w){w=c.splat(w);this.viz.graph.eachNode(function(y){c.each(w,function(z){y.getPos(z).$add(x)})})},setRightLevelToShow:function(z,w,B){var A=this.getRightLevelToShow(z,w),y=this.viz.labels,x=c.merge({execShow:true,execHide:true,onHide:c.empty,onShow:c.empty},B||{});z.eachLevel(0,this.config.levelsToShow,function(D){var C=D._depth-z._depth;if(C>A){x.onHide(D);if(x.execHide){D.drawn=false;D.exist=false;y.hideLabel(D,false)}}else{x.onShow(D);if(x.execShow){D.exist=true}}});z.drawn=true},getRightLevelToShow:function(z,x){var w=this.config;var A=w.levelsToShow;var y=w.constrained;if(!y){return A}while(!this.treeFitsInCanvas(z,x,A)&&A>1){A--}return A}});var d={construct:function(x){var y=(c.type(x)=="array");var w=new e(this.graphOptions,this.config.Node,this.config.Edge,this.config.Label);if(!y){(function(z,B){z.addNode(B);if(B.children){for(var A=0,C=B.children;AC?F:C;D.setData("width",E);D.setData("height",E);D.setData("dim",E)}}})},initializeLabel:function(w){if(!this.label){this.label=document.createElement("div");document.body.appendChild(this.label)}this.setLabelStyles(w)},setLabelStyles:function(w){c.extend(this.label.style,{visibility:"hidden",position:"absolute",width:"auto",height:"auto"});this.label.className="jit-autoadjust-label"}};g.Tree=(function(){var F=Array.prototype.slice;function D(P,K,H,N,I){var M=K.Node;var J=K.multitree;if(M.overridable){var O=-1,L=-1;P.eachNode(function(S){if(S._depth==H&&(!J||("$orn" in S.data)&&S.data.$orn==N)){var Q=S.getData("width",I);var R=S.getData("height",I);O=(O0)?E[0]:null;D(E)}for(var z=0,A=[C.id].concat(x);z=D._depth)});for(var B=0;B0&&J.drawn){J.drawn=false;x[A.id].push(J)}else{if((!E||!D)&&J.drawn){J.drawn=false;x[A.id].push(J)}}});A.drawn=true}if(w.length>0){F.fx.plot()}for(B in x){c.each(x[B],function(J){J.drawn=true})}for(B=0;Bw?y:w)+this.config.subtreeOffset},getEdge:function(C,B,A){var y=function(E,w){return function(){return C.pos.add(new p(E,w))}};var D=this.node;var x=C.getData("width");var z=C.getData("height");if(B=="begin"){if(D.align=="center"){return this.dispatch(A,y(0,z/2),y(-x/2,0),y(0,-z/2),y(x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,z),y(0,0),y(0,0),y(x,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,0),y(-x,0),y(0,-z),y(0,0))}else{throw"align: not implemented"}}}}else{if(B=="end"){if(D.align=="center"){return this.dispatch(A,y(0,-z/2),y(x/2,0),y(0,z/2),y(-x/2,0))}else{if(D.align=="left"){return this.dispatch(A,y(0,0),y(x,0),y(0,z),y(0,0))}else{if(D.align=="right"){return this.dispatch(A,y(0,-z),y(0,0),y(0,0),y(-x,0))}else{throw"align: not implemented"}}}}}},getScaledTreePosition:function(B,D){var C=this.node;var x=B.getData("width");var A=B.getData("height");var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var y=function(E,w){return function(){return B.pos.add(new p(E,w)).$scale(1-D)}};if(C.align=="left"){return this.dispatch(z,y(0,A),y(0,0),y(0,0),y(x,0))}else{if(C.align=="center"){return this.dispatch(z,y(0,A/2),y(-x/2,0),y(0,-A/2),y(x/2,0))}else{if(C.align=="right"){return this.dispatch(z,y(0,0),y(-x,0),y(0,-A),y(0,0))}else{throw"align: not implemented"}}}},treeFitsInCanvas:function(B,w,C){var y=w.getSize();var z=(this.config.multitree&&("$orn" in B.data)&&B.data.$orn)||this.config.orientation;var x=this.dispatch(z,y.width,y.height);var A=this.getTreeBaseSize(B,C,function(E,D){return E===0||!D.anySubnode()});return(A=0){z.drawn=false;var D=x.getCtx();var B=C.geom.getScaledTreePosition(z,A);D.translate(B.x,B.y);D.scale(A,A)}this.plotTree(z,c.merge(w,{withLabels:true,hideLabels:!!A,plotSubtree:function(I,G){var F=y.multitree&&!("$orn" in z.data);var H=F&&z.getData("orns");return !F||H.indexOf(elem.getData("orn"))>-1}}),E);if(A>=0){z.drawn=true}},getAlignedPos:function(B,z,w){var y=this.node;var A,x;if(y.align=="center"){A={x:B.x-z/2,y:B.y-w/2}}else{if(y.align=="left"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y}}else{A={x:B.x,y:B.y-w/2}}}else{if(y.align=="right"){x=this.config.orientation;if(x=="bottom"||x=="top"){A={x:B.x-z/2,y:B.y-w}}else{A={x:B.x-z,y:B.y-w/2}}}else{throw"align: not implemented"}}}return A},getOrientation:function(w){var y=this.config;var x=y.orientation;if(y.multitree){var z=w.nodeFrom;var A=w.nodeTo;x=(("$orn" in z.data)&&z.data.$orn)||(("$orn" in A.data)&&A.data.$orn)}return x}});$jit.ST.Label={};$jit.ST.Label.Native=new q({Implements:e.Label.Native,renderLabel:function(y,z,x){var w=y.getCtx();var A=z.pos.getc(true);w.fillText(z.name,A.x,A.y)}});$jit.ST.Label.DOM=new q({Implements:e.Label.DOM,placeLabel:function(P,J,F){var B=J.pos.getc(true),O=this.viz.config,K=O.Node,x=this.viz.canvas,C=J.getData("width"),M=J.getData("height"),y=x.getSize(),G,N;var A=x.translateOffsetX,z=x.translateOffsetY,E=x.scaleOffsetX,D=x.scaleOffsetY,I=B.x*E+A,H=B.y*D+z;if(K.align=="center"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M/2+y.height/2)}}else{if(K.align=="left"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H+y.height/2)}}else{G={x:Math.round(I+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{if(K.align=="right"){N=O.orientation;if(N=="bottom"||N=="top"){G={x:Math.round(I-C/2+y.width/2),y:Math.round(H-M+y.height/2)}}else{G={x:Math.round(I-C+y.width/2),y:Math.round(H-M/2+y.height/2)}}}else{throw"align: not implemented"}}}var L=P.style;L.left=G.x+"px";L.top=G.y+"px";L.display=this.fitsInCanvas(G,x)?"":"none";F.onPlaceLabel(P,J)}});$jit.ST.Label.SVG=new q({Implements:[$jit.ST.Label.DOM,e.Label.SVG],initialize:function(w){this.viz=w}});$jit.ST.Label.HTML=new q({Implements:[$jit.ST.Label.DOM,e.Label.HTML],initialize:function(w){this.viz=w}});$jit.ST.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(x,w){var z=x.getData("dim"),A=this.getAlignedPos(x.pos.getc(true),z,z),y=z/2;this.nodeHelper.circle.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.circle.contains({x:z.x+x,y:z.y+x},x)}},square:{render:function(x,w){var z=x.getData("dim"),y=z/2,A=this.getAlignedPos(x.pos.getc(true),z,z);this.nodeHelper.square.render("fill",{x:A.x+y,y:A.y+y},y,w)},contains:function(w,A){var y=w.getData("dim"),z=this.getAlignedPos(w.pos.getc(true),y,y),x=y/2;this.nodeHelper.square.contains({x:z.x+x,y:z.y+x},x)}},ellipse:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.ellipse.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.ellipse.contains({x:z.x+x/2,y:z.y+w/2},x,w,canvas)}},rectangle:{render:function(z,x){var y=z.getData("width"),w=z.getData("height"),A=this.getAlignedPos(z.pos.getc(true),y,w);this.nodeHelper.rectangle.render("fill",{x:A.x+y/2,y:A.y+w/2},y,w,x)},contains:function(y,A){var x=y.getData("width"),w=y.getData("height"),z=this.getAlignedPos(y.pos.getc(true),x,w);this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},x,w,canvas)}}});$jit.ST.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,z){var y=this.getOrientation(x),A=x.nodeFrom,B=x.nodeTo,w=A._depth1&&D[0]!=y.id);this.edgeHelper.arrow.render(E,F,A,z,x)},contains:function(x,D){var y=this.getOrientation(x),z=x.nodeFrom,A=x.nodeTo,w=z._depth0||F[ag][1]>0)){var Q=K+F[ag][0],O=E+F[ag][1],af=Math.atan((O-Q)/w),Y=55;var U=M.createLinearGradient(aa+w/2,Z-(Q+O)/2,aa+w/2+Y*Math.sin(af),Z-(Q+O)/2+Y*Math.cos(af));var P=c.rgbToHex(c.map(c.hexToRgb(I[ag%C].slice(1)),function(x){return(x*0.85)>>0}));U.addColorStop(0,I[ag%C]);U.addColorStop(1,P);M.fillStyle=U}M.beginPath();M.moveTo(aa,Z-K);M.lineTo(aa+w,Z-E);M.lineTo(aa+w,Z-E-F[ag][1]);M.lineTo(aa,Z-K-F[ag][0]);M.lineTo(aa,Z-K);M.fill();M.restore();if(H){var R=H.name==L[ag];var z=R?0.7:0.8;var P=c.rgbToHex(c.map(c.hexToRgb(I[ag%C].slice(1)),function(x){return(x*z)>>0}));M.strokeStyle=P;M.lineWidth=R?4:1;M.save();M.beginPath();if(H.index===0){M.moveTo(aa,Z-K);M.lineTo(aa,Z-K-F[ag][0])}else{M.moveTo(aa+w,Z-E);M.lineTo(aa+w,Z-E-F[ag][1])}M.stroke();M.restore()}K+=(F[ag][0]||0);E+=(F[ag][1]||0);if(F[ag][0]>0){W+=(B[ag][0]||0)}}if(S&&ad.type=="Native"){M.save();M.beginPath();M.fillStyle=M.strokeStyle=ad.color;M.font=ad.style+" "+ad.size+"px "+ad.family;M.textAlign="center";M.textBaseline="middle";if(N(V.name,ac,ab,V)){M.fillText(W,aa,Z-K-X.labelOffset-ad.size/2,w)}if(ah(V.name,ac,ab,V)){M.fillText(V.name,aa,Z+ad.size/2+X.labelOffset)}M.restore()}}},contains:function(C,E){var J=C.pos.getc(true),z=C.getData("width"),N=C.getData("height"),M=this.getAlignedPos(J,z,N),L=M.x,K=M.y,O=C.getData("dimArray"),w=E.x-L;if(E.xL+z||E.y>K||E.y=G){var H=+(w>z/2);return{name:C.getData("stringArray")[F],color:C.getData("colorArray")[F],value:C.getData("valueArray")[F][H],index:H}}}return false}}});$jit.AreaChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","AreaChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var y=this.config,B=this,w=y.type.split(":")[0],A={};var x=new $jit.ST({injectInto:y.injectInto,orientation:"bottom",levelDistance:0,siblingOffset:0,subtreeOffset:0,withLabels:y.Label.type!="Native",useCanvas:y.useCanvas,Label:{type:y.Label.type},Node:{overridable:true,type:"areachart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:y.Tips.enable,type:"Native",force:true,onShow:function(G,F,D){var E=D;y.Tips.onShow(G,E,F)}},Events:{enable:true,type:"Native",onClick:function(F,G,D){if(!y.filterOnClick&&!y.Events.enable){return}var E=G.getContains();if(E){y.filterOnClick&&B.filter(E.name)}y.Events.enable&&y.Events.onClick(E,G,D)},onRightClick:function(E,F,D){if(!y.restoreOnRightClick){return}B.restore()},onMouseMove:function(F,G,D){if(!y.selectOnHover){return}if(F){var E=G.getContains();B.select(F.id,E.name,E.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,G){var P=y.Label,O=G.getData("valueArray"),H=c.reduce(O,function(Q,R){return Q+R[0]},0),M=c.reduce(O,function(Q,R){return Q+R[1]},0);if(G.getData("prev")){var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var D=L.wrapper,N=L.label,E=L.aggregate,F=D.style,K=N.style,I=E.style;A[G.id]=L;D.appendChild(N);D.appendChild(E);if(!y.showLabels(G.name,H,M,G)){N.style.display="none"}if(!y.showAggregates(G.name,H,M,G)){E.style.display="none"}F.position="relative";F.overflow="visible";F.fontSize=P.size+"px";F.fontFamily=P.family;F.color=P.color;F.textAlign="center";I.position=K.position="absolute";J.style.width=G.getData("width")+"px";J.style.height=G.getData("height")+"px";N.innerHTML=G.name;J.appendChild(D)}},onPlaceLabel:function(U,O){if(!O.getData("prev")){return}var S=A[O.id],E=S.wrapper.style,D=S.label.style,N=S.aggregate.style,L=O.getData("width"),J=O.getData("height"),I=O.getData("dimArray"),F=O.getData("valueArray"),K=c.reduce(F,function(V,W){return V+W[0]},0),G=c.reduce(F,function(V,W){return V+W[1]},0),H=parseInt(E.fontSize,10),M=U.style;if(I&&F){if(y.showLabels(O.name,K,G,O)){D.display=""}else{D.display="none"}if(y.showAggregates(O.name,K,G,O)){N.display=""}else{N.display="none"}E.width=N.width=D.width=U.style.width=L+"px";N.left=D.left=-L/2+"px";for(var R=0,P=F.length,Q=0,T=0;R0){Q+=F[R][0];T+=I[R][0]}}N.top=(-H-y.labelOffset)+"px";D.top=(y.labelOffset+T)+"px";U.style.top=parseInt(U.style.top,10)-T+"px";U.style.height=E.height=T+"px";S.aggregate.innerHTML=Q}}});var z=x.canvas.getSize(),C=y.Margin;x.config.offsetY=-z.height/2+C.bottom+(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetX=(C.right-C.left)/2;this.st=x;this.canvas=this.st.canvas},loadJSON:function(N){var K=c.time(),B=[],G=this.st,Q=c.splat(N.label),J=c.splat(N.color||this.colors),O=this.config,x=!!O.type.split(":")[1],z=O.animate;for(var L=0,y=N.values,I=y.length;L-1)?E:[0,0]}),"end")});this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){y.busy=false}})},restore:function(){if(this.busy){return}this.busy=true;if(this.config.Tips.enable){this.st.tips.hide()}this.select(false,false,false);this.normalizeDims();var w=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){w.busy=false}})},select:function(B,x,w){if(!this.config.selectOnHover){return}var y=this.selected;if(y.id!=B||y.name!=x||y.index!=w){y.id=B;y.name=x;y.index=w;this.st.graph.eachNode(function(C){C.setData("border",false)});if(B){var A=this.st.graph.getNode(B);A.setData("border",y);var z=w===0?"prev":"next";z=A.getData(z);if(z){A=this.st.graph.getByName(z);if(A){A.setData("border",{name:x,index:1-w})}}}this.st.plot()}},getLegend:function(){var y={};var z;this.st.graph.getNode(this.st.root).eachAdjacency(function(A){z=A.nodeTo});var x=z.getData("colorArray"),w=x.length;c.each(z.getData("stringArray"),function(B,A){y[B]=x[A%w]});return y},getMaxValue:function(){var w=0;this.st.graph.eachNode(function(B){var y=B.getData("valueArray"),x=0,A=0;c.each(y,function(C){x+=+C[0];A+=+C[1]});var z=A>x?A:x;w=w>z?w:z});return w},normalizeDims:function(){var C=this.st.graph.getNode(this.st.root),z=0;C.eachAdjacency(function(){z++});var B=this.getMaxValue()||1,F=this.st.canvas.getSize(),y=this.config,A=y.Margin,D=y.labelOffset+y.Label.size,w=(F.width-(A.left+A.right))/z,x=y.animate,E=F.height-(A.top+A.bottom)-(y.showAggregates&&D)-(y.showLabels&&D);this.st.graph.eachNode(function(L){var I=0,K=0,G=[];c.each(L.getData("valueArray"),function(M){I+=+M[0];K+=+M[1];G.push([0,0])});var J=K>I?K:I;L.setData("width",w);if(x){L.setData("height",J*E/B,"end");L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}),"end");var H=L.getData("dimArray");if(!H){L.setData("dimArray",G)}}else{L.setData("height",J*E/B);L.setData("dimArray",c.map(L.getData("valueArray"),function(M){return[M[0]*E/B,M[1]*E/B]}))}})}});n.BarChart={$extend:true,animate:true,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:true,showLabels:true,Tips:{enable:false,onShow:c.empty,onHide:c.empty},Events:{enable:false,onClick:c.empty}};$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(Q,C){var H=Q.pos.getc(true),P=Q.getData("width"),N=Q.getData("height"),L=this.getAlignedPos(H,P,N),K=L.x,J=L.y,M=Q.getData("dimArray"),F=Q.getData("valueArray"),E=Q.getData("colorArray"),B=E.length,X=Q.getData("stringArray");var S=C.getCtx(),w={},T=Q.getData("border"),z=Q.getData("gradient"),Z=Q.getData("config"),A=Z.orientation=="horizontal",D=Z.showAggregates,O=Z.showLabels,I=Z.Label;if(E&&M&&X){for(var W=0,R=M.length,V=0,G=0;W>0}));Y.addColorStop(0,U);Y.addColorStop(0.5,E[W%B]);Y.addColorStop(1,U);S.fillStyle=Y}if(A){S.fillRect(K+V,J,M[W],N)}else{S.fillRect(K,J-V-M[W],P,M[W])}if(T&&T.name==X[W]){w.acum=V;w.dimValue=M[W]}V+=(M[W]||0);G+=(F[W]||0)}if(T){S.save();S.lineWidth=2;S.strokeStyle=T.color;if(A){S.strokeRect(K+w.acum+1,J+1,w.dimValue-2,N-2)}else{S.strokeRect(K+1,J-w.acum-w.dimValue+1,P-2,w.dimValue-2)}S.restore()}if(I.type=="Native"){S.save();S.fillStyle=S.strokeStyle=I.color;S.font=I.style+" "+I.size+"px "+I.family;S.textBaseline="middle";if(D(Q.name,G)){if(A){S.textAlign="right";S.fillText(G,K+V-Z.labelOffset,J+N/2)}else{S.textAlign="center";S.fillText(G,K+P/2,J-N-I.size/2-Z.labelOffset)}}if(O(Q.name,G,Q)){if(A){S.textAlign="center";S.translate(K-Z.labelOffset-I.size/2,J+N/2);S.rotate(Math.PI/2);S.fillText(Q.name,0,0)}else{S.textAlign="center";S.fillText(Q.name,K+P/2,J+I.size/2+Z.labelOffset)}}S.restore()}}},contains:function(D,F){var I=D.pos.getc(true),A=D.getData("width"),N=D.getData("height"),M=this.getAlignedPos(I,A,N),L=M.x,J=M.y,O=D.getData("dimArray"),B=D.getData("config"),z=F.x-L,w=B.orientation=="horizontal";if(w){if(F.xL+A||F.y>J+N||F.yL+A||F.y>J||F.y=H){return{name:D.getData("stringArray")[G],color:D.getData("colorArray")[G],value:D.getData("valueArray")[G],label:D.name}}}}return false}},"barchart-grouped":{render:function(R,C){var I=R.pos.getc(true),Q=R.getData("width"),O=R.getData("height"),M=this.getAlignedPos(I,Q,O),L=M.x,K=M.y,N=R.getData("dimArray"),G=R.getData("valueArray"),X=G.length,F=R.getData("colorArray"),B=F.length,Z=R.getData("stringArray");var T=C.getCtx(),w={},U=R.getData("border"),z=R.getData("gradient"),ab=R.getData("config"),A=ab.orientation=="horizontal",E=ab.showAggregates,P=ab.showLabels,J=ab.Label,D=(A?O:Q)/X;if(F&&N&&Z){for(var Y=0,S=X,W=0,H=0;Y>0}));aa.addColorStop(0,V);aa.addColorStop(0.5,F[Y%B]);aa.addColorStop(1,V);T.fillStyle=aa}if(A){T.fillRect(L,K+D*Y,N[Y],D)}else{T.fillRect(L+D*Y,K-N[Y],D,N[Y])}if(U&&U.name==Z[Y]){w.acum=D*Y;w.dimValue=N[Y]}W+=(N[Y]||0);H+=(G[Y]||0)}if(U){T.save();T.lineWidth=2;T.strokeStyle=U.color;if(A){T.strokeRect(L+1,K+w.acum+1,w.dimValue-2,D-2)}else{T.strokeRect(L+w.acum+1,K-w.dimValue+1,D-2,w.dimValue-2)}T.restore()}if(J.type=="Native"){T.save();T.fillStyle=T.strokeStyle=J.color;T.font=J.style+" "+J.size+"px "+J.family;T.textBaseline="middle";if(E(R.name,H)){if(A){T.textAlign="right";T.fillText(H,L+Math.max.apply(null,N)-ab.labelOffset,K+O/2)}else{T.textAlign="center";T.fillText(H,L+Q/2,K-Math.max.apply(null,N)-J.size/2-ab.labelOffset)}}if(P(R.name,H,R)){if(A){T.textAlign="center";T.translate(L-ab.labelOffset-J.size/2,K+O/2);T.rotate(Math.PI/2);T.fillText(R.name,0,0)}else{T.textAlign="center";T.fillText(R.name,L+Q/2,K+J.size/2+ab.labelOffset)}}T.restore()}}},contains:function(J,F){var B=J.pos.getc(true),I=J.getData("width"),H=J.getData("height"),E=this.getAlignedPos(B,I,H),D=E.x,C=E.y,G=J.getData("dimArray"),M=G.length,P=J.getData("config"),A=F.x-D,w=P.orientation=="horizontal",z=(w?H:I)/M;if(w){if(F.xD+I||F.y>C+H||F.yD+I||F.y>C||F.y=N&&F.y<=N+z){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}else{var N=D+z*L;if(F.x>=N&&F.x<=N+z&&F.y>=C-O){return{name:J.getData("stringArray")[L],color:J.getData("colorArray")[L],value:J.getData("valueArray")[L],label:J.name}}}}return false}}});$jit.BarChart=new q({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(y){this.controller=this.config=c.merge(n("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},y);var z=this.config.showLabels,x=c.type(z),A=this.config.showAggregates,w=c.type(A);this.config.showLabels=x=="function"?z:c.lambda(z);this.config.showAggregates=w=="function"?A:c.lambda(A);this.initializeViz()},initializeViz:function(){var y=this.config,B=this;var w=y.type.split(":")[0],D=y.orientation=="horizontal",A={};var x=new $jit.ST({injectInto:y.injectInto,orientation:D?"left":"bottom",levelDistance:0,siblingOffset:y.barsOffset,subtreeOffset:0,withLabels:y.Label.type!="Native",useCanvas:y.useCanvas,Label:{type:y.Label.type},Node:{overridable:true,type:"barchart-"+w,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:y.Tips.enable,type:"Native",force:true,onShow:function(H,G,E){var F=E;y.Tips.onShow(H,F,G)}},Events:{enable:true,type:"Native",onClick:function(G,H,E){if(!y.Events.enable){return}var F=H.getContains();y.Events.onClick(F,H,E)},onMouseMove:function(G,H,E){if(!y.hoveredColor){return}if(G){var F=H.getContains();B.select(G.id,F.name,F.index)}else{B.select(false,false,false)}}},onCreateLabel:function(J,H){var P=y.Label,N=H.getData("valueArray"),M=c.reduce(N,function(Q,R){return Q+R},0);var L={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")};var E=L.wrapper,O=L.label,F=L.aggregate,G=E.style,K=O.style,I=F.style;A[H.id]=L;E.appendChild(O);E.appendChild(F);if(!y.showLabels(H.name,M,H)){K.display="none"}if(!y.showAggregates(H.name,M,H)){I.display="none"}G.position="relative";G.overflow="visible";G.fontSize=P.size+"px";G.fontFamily=P.family;G.color=P.color;G.textAlign="center";I.position=K.position="absolute";J.style.width=H.getData("width")+"px";J.style.height=H.getData("height")+"px";I.left=K.left="0px";O.innerHTML=H.name;J.appendChild(E)},onPlaceLabel:function(L,H){if(!A[H.id]){return}var N=A[H.id],I=N.wrapper.style,P=N.label.style,M=N.aggregate.style,Q=y.type.split(":")[0]=="grouped",E=y.orientation=="horizontal",T=H.getData("dimArray"),U=H.getData("valueArray"),F=(Q&&E)?Math.max.apply(null,T):H.getData("width"),S=(Q&&!E)?Math.max.apply(null,T):H.getData("height"),G=parseInt(I.fontSize,10),O=L.style;if(T&&U){I.width=M.width=P.width=L.style.width=F+"px";for(var K=0,J=U.length,R=0;K0){R+=U[K]}}if(y.showLabels(H.name,R,H)){P.display=""}else{P.display="none"}if(y.showAggregates(H.name,R,H)){M.display=""}else{M.display="none"}if(y.orientation=="horizontal"){M.textAlign="right";P.textAlign="left";P.textIndex=M.textIndent=y.labelOffset+"px";M.top=P.top=(S-G)/2+"px";L.style.height=I.height=S+"px"}else{M.top=(-G-y.labelOffset)+"px";P.top=(y.labelOffset+S)+"px";L.style.top=parseInt(L.style.top,10)-S+"px";L.style.height=I.height=S+"px"}N.aggregate.innerHTML=R}}});var z=x.canvas.getSize(),C=y.Margin;if(D){x.config.offsetX=z.width/2-C.left-(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetY=(C.bottom-C.top)/2}else{x.config.offsetY=-z.height/2+C.bottom+(y.showLabels&&(y.labelOffset+y.Label.size));x.config.offsetX=(C.right-C.left)/2}this.st=x;this.canvas=this.st.canvas},loadJSON:function(K){if(this.busy){return}this.busy=true;var I=c.time(),C=[],D=this.st,N=c.splat(K.label),H=c.splat(K.color||this.colors),L=this.config,w=!!L.type.split(":")[1],z=L.animate,y=L.orientation=="horizontal",A=this;for(var J=0,x=K.values,F=x.length;Jz?x:z});return x},setBarType:function(w){this.config.type=w;this.st.config.Node.type="barchart-"+w.split(":")[0]},normalizeDims:function(){var G=this.st.graph.getNode(this.st.root),B=0;G.eachAdjacency(function(){B++});var D=this.getMaxValue()||1,J=this.st.canvas.getSize(),z=this.config,C=z.Margin,H=C.left+C.right,A=C.top+C.bottom,x=z.orientation=="horizontal",w=(J[x?"height":"width"]-(x?A:H)-(B-1)*z.barsOffset)/B,y=z.animate,I=J[x?"width":"height"]-(x?H:A)-(!x&&z.showAggregates&&(z.Label.size+z.labelOffset))-(z.showLabels&&(z.Label.size+z.labelOffset)),F=x?"height":"width",E=x?"width":"height";this.st.graph.eachNode(function(N){var M=0,K=[];c.each(N.getData("valueArray"),function(O){M+=+O;K.push(0)});N.setData(F,w);if(y){N.setData(E,M*I/D,"end");N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}),"end");var L=N.getData("dimArray");if(!L){N.setData("dimArray",K)}}else{N.setData(E,M*I/D);N.setData("dimArray",c.map(N.getData("valueArray"),function(O){return O*I/D}))}})}});n.PieChart={$extend:true,animate:true,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:false,onClick:c.empty},Tips:{enable:false,onShow:c.empty,onHide:c.empty},showLabels:true,resizeLabels:false,updateHeights:false};g.Radial=new q({compute:function(x){var y=c.splat(x||["current","start","end"]);f.compute(this.graph,y,this.config);this.graph.computeLevels(this.root,0,"ignore");var w=this.createLevelDistanceFunc();this.computeAngularWidths(y);this.computePositions(y,w)},computePositions:function(D,A){var F=D;var E=this.graph;var B=E.getNode(this.root);var C=this.parent;var w=this.config;for(var y=0,x=F.length;yJ[Z]?Y:J[Z]):Y}G.push(W)},"ignore");if(C&&C.id==K.id&&G.length>0&&G[0].dist){G.sort(function(W,V){return(W.dist>=V.dist)-(W.dist<=V.dist)})}for(var M=0,O=G.length;MF/2&&B.theta<3*F/2);var L=I?B.theta+F:B.theta;if(I){M-=Math.abs(Math.cos(B.theta)*A.width);K+=Math.sin(B.theta)*A.width}else{if(E.id==this.viz.root){M-=A.width/2}}}O.save();O.translate(M,K);O.rotate(L);O.fillText(E.name,0,0);O.restore()}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(N,C,E){var J=C.pos.getc(true),M=this.viz,A=this.viz.canvas;var F=A.getSize();var B={x:Math.round(J.x+F.width/2),y:Math.round(J.y+F.height/2)};N.setAttribute("x",B.x);N.setAttribute("y",B.y);var G=N.getBBox();if(G){var L=N.getAttribute("x");var I=N.getAttribute("y");var z=C.pos.getp(true);var D=Math.PI;var H=(z.theta>D/2&&z.theta<3*D/2);if(H){N.setAttribute("x",L-G.width);N.setAttribute("y",I-G.height)}else{if(C.id==M.root){N.setAttribute("x",L-G.width/2)}}var K=H?z.theta+D:z.theta;if(C._depth){N.setAttribute("transform","rotate("+K*360/(2*D)+" "+L+" "+I+")")}}E.onPlaceLabel(N,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(G,A,C){var E=A.pos.clone(),y=this.viz.canvas,F=A.getData("height"),B=((F||A._depth==0)?F:this.viz.config.levelDistance)/2,D=y.getSize();E.rho+=B;E=E.getc(true);var z={x:Math.round(E.x+D.width/2),y:Math.round(E.y+D.height/2)};var x=G.style;x.left=z.x+"px";x.top=z.y+"px";x.display=this.fitsInCanvas(z,y)?"":"none";C.onPlaceLabel(G,A)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false),anglecontains:function(B,D){var A=B.getData("span")/2,y=B.pos.theta;var z=y-A,x=y+A;if(z<0){z+=Math.PI*2}var C=Math.atan2(D.y,D.x);if(C<0){C+=Math.PI*2}if(z>x){return(C>z&&C<=Math.PI*2)||Cz&&C=z*C)&&(y<=(z*C+B))}return false}},"gradient-multipie":{render:function(A,x){var F=x.getCtx();var E=A.getData("height");var B=E?E:this.config.levelDistance;var y=F.createRadialGradient(0,0,A.getPos().rho,0,0,A.getPos().rho+B);var D=c.hexToRgb(A.getData("color")),C=[];c.each(D,function(G){C.push(parseInt(G*0.5,10))});var z=c.rgbToHex(C);y.addColorStop(0,z);y.addColorStop(1,A.getData("color"));F.fillStyle=y;this.nodeTypes.multipie.render.call(this,A,x)},contains:function(x,y){return this.nodeTypes.multipie.contains.call(this,x,y)}},"gradient-pie":{render:function(C,z){var x=z.getCtx();var D=x.createRadialGradient(0,0,0,0,0,C.getPos().rho);var B=c.hexToRgb(C.getData("color")),y=[];c.each(B,function(E){y.push(parseInt(E*0.5,10))});var A=c.rgbToHex(y);D.addColorStop(1,A);D.addColorStop(0,C.getData("color"));x.fillStyle=D;this.nodeTypes.pie.render.call(this,C,z)},contains:function(x,y){return this.nodeTypes.pie.contains.call(this,x,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true);this.edgeHelper.line.render(A,z,y)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.line.contains(z,y,A,this.edge.epsilon)}},arrow:{render:function(y,z){var D=y.nodeFrom.pos.getc(true),C=y.nodeTo.pos.getc(true),B=y.getData("dim"),A=y.data.$direction,x=(A&&A.length>1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=Math.max(B.norm(),A.norm());this.edgeHelper.hyperline.render(B.$scale(1/z),A.$scale(1/z),z,y)},contains:c.lambda(false)}})})($jit.Sunburst);$jit.Sunburst.Plot.NodeTypes.implement({"piechart-stacked":{render:function(U,A){var T=U.pos.getp(true),C=U.getData("dimArray"),S=U.getData("valueArray"),G=U.getData("colorArray"),z=G.length,M=U.getData("stringArray"),P=U.getData("span")/2,K=U.pos.theta,F=K-P,J=K+P,R=new b;var N=A.getCtx(),L={},I=U.getData("gradient"),D=U.getData("border"),Z=U.getData("config"),ai=Z.showLabels,Y=Z.resizeLabels,ab=Z.Label;var ae=Z.sliceOffset*Math.cos((F+J)/2);var E=Z.sliceOffset*Math.sin((F+J)/2);if(G&&C&&M){for(var af=0,ac=C.length,w=0,X=0;af>0}),y=c.rgbToHex(W);ad.addColorStop(0,ag);ad.addColorStop(0.5,ag);ad.addColorStop(1,y);N.fillStyle=ad}R.rho=w+Z.sliceOffset;R.theta=F;var ah=R.getc(true);R.theta=J;var O=R.getc(true);R.rho+=B;var aj=R.getc(true);R.theta=F;var Q=R.getc(true);N.beginPath();N.arc(ae,E,w+0.01,F,J,false);N.arc(ae,E,w+B+0.01,J,F,true);N.fill();if(D&&D.name==M[af]){L.acum=w;L.dimValue=C[af];L.begin=F;L.end=J}w+=(B||0);X+=(S[af]||0)}if(D){N.save();N.globalCompositeOperation="source-over";N.lineWidth=2;N.strokeStyle=D.color;var aa=F>0;H=H<+Y?+Y:H;N.font=ab.style+" "+H+"px "+ab.family;N.textBaseline="middle";N.textAlign="center";R.rho=w+Z.labelOffset+Z.sliceOffset;R.theta=U.pos.theta;var ak=R.getc(true);N.fillText(U.name,ak.x,ak.y);N.restore()}}},contains:function(z,D){if(this.nodeTypes.none.anglecontains.call(this,z,D)){var F=Math.sqrt(D.x*D.x+D.y*D.y);var w=this.config.levelDistance,C=z._depth;var x=z.getData("config");if(F<=w*C+x.sliceOffset){var G=z.getData("dimArray");for(var B=0,A=G.length,E=x.sliceOffset;B=E&&F<=E+y){return{name:z.getData("stringArray")[B],color:z.getData("colorArray")[B],value:z.getData("valueArray")[B],label:z.name}}E+=y}}return false}return false}}});$jit.PieChart=new q({sb:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:false,initialize:function(w){this.controller=this.config=c.merge(n("Canvas","PieChart","Label"),{Label:{type:"Native"}},w);this.initializeViz()},initializeViz:function(){var x=this.config,A=this;var w=x.type.split(":")[0];var B=new $jit.Sunburst({injectInto:x.injectInto,useCanvas:x.useCanvas,withLabels:x.Label.type!="Native",Label:{type:x.Label.type},Node:{overridable:true,type:"piechart-"+w,width:1,height:1},Edge:{type:"none"},Tips:{enable:x.Tips.enable,type:"Native",force:true,onShow:function(F,E,C){var D=C;x.Tips.onShow(F,D,E)}},Events:{enable:true,type:"Native",onClick:function(E,F,C){if(!x.Events.enable){return}var D=F.getContains();x.Events.onClick(D,F,C)},onMouseMove:function(E,F,C){if(!x.hoveredColor){return}if(E){var D=F.getContains();A.select(E.id,D.name,D.index)}else{A.select(false,false,false)}}},onCreateLabel:function(F,E){var C=x.Label;if(x.showLabels){var D=F.style;D.fontSize=C.size+"px";D.fontFamily=C.family;D.color=C.color;D.textAlign="center";F.innerHTML=E.name}},onPlaceLabel:function(S,M){if(!x.showLabels){return}var G=M.pos.getp(true),J=M.getData("dimArray"),P=M.getData("span")/2,H=M.pos.theta,R=H-P,D=H+P,U=new b;var L=x.showLabels,F=x.resizeLabels,I=x.Label;if(J){for(var Q=0,N=J.length,O=0;Q>0;C=C<+F?+F:C;S.style.fontSize=C+"px";U.rho=O+x.labelOffset+x.sliceOffset;U.theta=(R+D)/2;var G=U.getc(true);var E=A.canvas.getSize();var K={x:Math.round(G.x+E.width/2),y:Math.round(G.y+E.height/2)};S.style.left=K.x+"px";S.style.top=K.y+"px"}}});var z=B.canvas.getSize(),y=Math.min;B.config.levelDistance=y(z.width,z.height)/2-x.offset-x.sliceOffset;this.sb=B;this.canvas=this.sb.canvas;this.canvas.getCtx().globalCompositeOperation="lighter"},loadJSON:function(K){var I=c.time(),C=[],w=this.sb,N=c.splat(K.label),E=N.length,H=c.splat(K.color||this.colors),z=H.length,L=this.config,x=!!L.type.split(":")[1],A=L.animate,G=E==1;for(var J=0,y=K.values,F=y.length;Jy?w:y});return w},normalizeDims:function(){var x=this.sb.graph.getNode(this.sb.root),w=0;x.eachAdjacency(function(){w++});var B=this.getMaxValue()||1,A=this.config,y=A.animate,z=this.sb.config.levelDistance;this.sb.graph.eachNode(function(G){var F=0,C=[];c.each(G.getData("valueArray"),function(H){F+=+H;C.push(1)});var E=(C.length==1)&&!A.updateHeights;if(y){G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}),"end");var D=G.getData("dimArray");if(!D){G.setData("dimArray",C)}}else{G.setData("dimArray",c.map(G.getData("valueArray"),function(H){return E?z:(H*z/B)}))}G.setData("normalizedDim",F/B)})}});g.TM={};g.TM.SliceAndDice=new q({compute:function(B){var x=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(x);var z=this.canvas.getSize(),y=this.config,A=z.width,w=z.height;this.graph.computeLevels(this.root,0,"ignore");x.getPos(B).setc(-A/2,-w/2);x.setData("width",A,B);x.setData("height",w+y.titleHeight,B);this.computePositions(x,x,this.layout.orientation,B);this.controller.onAfterCompute(x)},computePositions:function(F,D,P,y){var M=0;F.eachSubnode(function(R){M+=R.getData("area",y)});var Q=this.config,N=Q.offset,J=F.getData("width",y),H=F.getData("height",y)-Q.titleHeight,x=F==D?1:(D.getData("area",y)/M);var I,G,L,B,A,E,C;var O=(P=="h");if(O){P="v";I=H;G=J*x;L="height";B="y";A="x";E=Q.titleHeight;C=0}else{P="h";I=H*x;G=J;L="width";B="x";A="y";E=0;C=Q.titleHeight}var w=D.getPos(y);D.setData("width",G,y);D.setData("height",I,y);var K=0,z=this;D.eachSubnode(function(S){var R=S.getPos(y);R[B]=K+w[B]+E;R[A]=w[A]+C;z.computePositions(D,S,P,y);K+=S.getData(L,y)})}});g.TM.Area={compute:function(w){w=w||"current";var C=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(C);var y=this.config,F=this.canvas.getSize(),x=F.width,E=F.height,D=y.offset,z=x-D,B=E-D;this.graph.computeLevels(this.root,0,"ignore");C.getPos(w).setc(-x/2,-E/2);C.setData("width",x,w);C.setData("height",E,w);var A={top:-E/2+y.titleHeight,left:-x/2,width:z,height:B-y.titleHeight};this.computePositions(C,A,w);this.controller.onAfterCompute(C)},computeDim:function(B,C,E,A,z,x){if(B.length+C.length==1){var y=(B.length==1)?B:C;this.layoutLast(y,E,A,x);return}if(B.length>=2&&C.length==0){C=[B.shift()]}if(B.length==0){if(C.length>0){this.layoutRow(C,E,A,x)}return}var D=B[0];if(z(C,E)>=z([D].concat(C),E)){this.computeDim(B.slice(1),C.concat([D]),E,A,z,x)}else{var F=this.layoutRow(C,E,A,x);this.computeDim(B,[],F.dim,F,z,x)}},worstAspectRatio:function(x,F){if(!x||x.length==0){return Number.MAX_VALUE}var y=0,G=0,B=Number.MAX_VALUE;for(var D=0,C=x.length;Dz?G:z}var E=F*F,A=y*y;return Math.max(E*G/A,A/(E*B))},avgAspectRatio:function(B,y){if(!B||B.length==0){return Number.MAX_VALUE}var D=0;for(var z=0,x=B.length;zA?y/A:A/y}return D/x},layoutLast:function(y,x,B,A){var z=y[0];z.getPos(A).setc(B.left,B.top);z.setData("width",B.width,A);z.setData("height",B.height,A)}};g.TM.Squarified=new q({Implements:g.TM.Area,computePositions:function(A,D,x){var z=this.config;if(D.width>=D.height){this.layout.orientation="h"}else{this.layout.orientation="v"}var w=A.getSubnodes([1,1],"ignore");if(w.length>0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;C0){this.processChildrenLayout(A,w,D,x);for(var C=0,B=w.length;CF){F=I}});var y=this.graph.getNode(this.clickedNode&&this.clickedNode.id||D.id);var x=Math.min(F,C-1);var B=y._depth;if(this.layout.horizontal()){this.computeSubtree(y,-w/2,-G/2,w/(x+1),G,B,x,E)}else{this.computeSubtree(y,-w/2,-G/2,w,G/(x+1),B,x,E)}},computeSubtree:function(G,I,F,w,L,E,A,H){G.getPos(H).setc(I,F);G.setData("width",w,H);G.setData("height",L,H);var C,K=0,J=0;var z=e.Util.getSubnodes(G,[1,1]);if(!z.length){return}c.each(z,function(x){J+=x.getData("dim")});for(var D=0,B=z.length;D>0}));I.addColorStop(0,A);I.addColorStop(1,E);J.fillStyle=I}if(B){J.strokeStyle=B;J.lineWidth=3}J.fillRect(F,D,Math.max(0,w-C),Math.max(0,H-C));B&&J.strokeRect(G.x,G.y,w,H)},contains:function(y,A){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(y,this.viz.clickedNode.id)){return false}var z=y.pos.getc(true),x=y.getData("width"),w=y.getData("height");return this.nodeHelper.rectangle.contains({x:z.x+x/2,y:z.y+w/2},A,x,w)}}});$jit.Icicle.Plot.EdgeTypes=new q({none:c.empty});g.ForceDirected=new q({getOptions:function(D){var B=this.canvas.getSize();var y=B.width,A=B.height;var C=0;this.graph.eachNode(function(w){C++});var E=y*A/C,z=Math.sqrt(E);var x=this.config.levelDistance;return{width:y,height:A,tstart:y*0.1,nodef:function(w){return E/(w||1)},edgef:function(w){return z*(w-x)}}},compute:function(x,y){var z=c.splat(x||["current","start","end"]);var w=this.getOptions();f.compute(this.graph,z,this.config);this.graph.computeLevels(this.root,0,"ignore");this.graph.eachNode(function(A){c.each(z,function(B){var C=A.getPos(B);if(C.equals(p.KER)){C.x=w.width/5*(Math.random()-0.5);C.y=w.height/5*(Math.random()-0.5)}A.disp={};c.each(z,function(D){A.disp[D]=r(0,0)})})});this.computePositions(z,w,y)},computePositions:function(A,y,B){var C=this.config.iterations,x=0,z=this;if(B){(function w(){for(var E=B.iter,D=0;D=C){B.onComplete();return}}B.onStep(Math.round(x/(C-1)*100));setTimeout(w,1)})()}else{for(;x1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.ForceDirected);$jit.TM={};var v=$jit.TM;$jit.TM.$extend=true;v.Base={layout:{orientation:"h",vertical:function(){return this.orientation=="v"},horizontal:function(){return this.orientation=="h"},change:function(){this.orientation=this.vertical()?"h":"v"}},initialize:function(w){var x={orientation:"h",titleHeight:13,offset:2,levelsToShow:0,constrained:false,animate:false,Node:{type:"rectangle",overridable:true,width:3,height:3,color:"#444"},Label:{textAlign:"center",textBaseline:"top"},Edge:{type:"none"},duration:700,fps:45};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),x,w);this.layout.orientation=this.config.orientation;var y=this.config;if(y.useCanvas){this.canvas=y.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(y.background){y.background=c.merge({type:"Circles"},y.background)}this.canvas=new l(this,y);this.config.labelContainer=(typeof y.injectInto=="string"?y.injectInto:y.injectInto.id)+"-label"}this.graphOptions={complex:true,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new v.Label[y.Label.type](this);this.fx=new v.Plot(this);this.op=new v.Op(this);this.group=new v.Group(this);this.geom=new v.Geom(this);this.clickedNode=null;this.busy=false;this.initializeExtras()},refresh:function(){if(this.busy){return}this.busy=true;var x=this;if(this.config.animate){this.compute("end");this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.fx.animate(c.merge(this.config,{modes:["linear","node-property:width:height"],onComplete:function(){x.busy=false}}))}else{var w=this.config.Label.type;if(w!="Native"){var x=this;this.graph.eachNode(function(y){x.labels.hideLabel(y,false)})}this.busy=false;this.compute();this.config.levelsToShow>0&&this.geom.setRightLevelToShow(this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root));this.plot()}},plot:function(){this.fx.plot()},leaf:function(w){return w.getSubnodes([1,1],"ignore").length==0},enter:function(C){if(this.busy){return}this.busy=true;var y=this,x=this.config,A=this.graph,w=C,z=this.clickedNode;var B={onComplete:function(){if(x.levelsToShow>0){y.geom.setRightLevelToShow(C)}if(x.levelsToShow>0||x.request){y.compute()}if(x.animate){A.nodeList.setData("alpha",0,"end");C.eachSubgraph(function(D){D.setData("alpha",1,"end")},"ignore");y.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){y.clickedNode=w;y.compute("end");y.clickedNode=z;y.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){y.busy=false;y.clickedNode=w}})}})}else{y.busy=false;y.clickedNode=C;y.refresh()}}};if(x.request){this.requestNodes(w,B)}else{B.onComplete()}},out:function(){if(this.busy){return}this.busy=true;this.events.hoveredNode=false;var A=this,y=this.config,C=this.graph,x=C.getNode(this.clickedNode&&this.clickedNode.id||this.root).getParents(),z=x[0],w=z,B=this.clickedNode;if(!z){this.busy=false;return}callback={onComplete:function(){A.clickedNode=z;if(y.request){A.requestNodes(z,{onComplete:function(){A.compute();A.plot();A.busy=false}})}else{A.compute();A.plot();A.busy=false}}};if(y.levelsToShow>0){this.geom.setRightLevelToShow(z)}if(y.animate){this.clickedNode=w;this.compute("end");this.clickedNode=B;this.fx.animate({modes:["linear","node-property:width:height"],duration:1000,onComplete:function(){A.clickedNode=w;C.eachNode(function(D){D.setDataset(["current","end"],{alpha:[0,1]})},"ignore");B.eachSubgraph(function(D){D.setData("alpha",1)},"ignore");A.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})}else{callback.onComplete()}},requestNodes:function(y,z){var x=c.merge(this.controller,z),w=this.config.levelsToShow;if(x.request){var B=[],A=y._depth;y.eachLevel(0,w,function(D){var C=w-(D._depth-A);if(D.drawn&&!D.anySubnode()&&C>0){B.push(D);D._level=C}});this.group.requestNodes(B,x)}else{x.onComplete()}}};v.Op=new q({Implements:e.Op,initialize:function(w){this.viz=w}});v.Geom=new q({Implements:e.Geom,getRightLevelToShow:function(){return this.viz.config.levelsToShow},setRightLevelToShow:function(x){var y=this.getRightLevelToShow(),w=this.viz.labels;x.eachLevel(0,y+1,function(A){var z=A._depth-x._depth;if(z>y){A.drawn=false;A.exist=false;A.ignore=true;w.hideLabel(A,false)}else{A.drawn=true;A.exist=true;delete A.ignore}});x.drawn=true;delete x.ignore}});v.Group=new q({initialize:function(w){this.viz=w;this.canvas=w.canvas;this.config=w.config},requestNodes:function(B,A){var z=0,x=B.length,D={};var y=function(){A.onComplete()};var w=this.viz;if(x==0){y()}for(var C=0;C>0}));K.addColorStop(0,A);K.addColorStop(1,F);L.fillStyle=K}L.fillRect(G,E,w-I,J-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(G,E,w-I,J-I);L.restore()}}else{if(C>0){L.fillRect(H.x+I/2,H.y+I/2,w-I,C-I);if(B){L.save();L.strokeStyle=B;L.strokeRect(H.x+I/2,H.y+I/2,w-I,J-I);L.restore()}}}},contains:function(z,B){if(this.viz.clickedNode&&!z.isDescendantOf(this.viz.clickedNode.id)||z.ignore){return false}var A=z.pos.getc(true),y=z.getData("width"),x=this.viz.leaf(z),w=x?z.getData("height"):this.config.titleHeight;return this.nodeHelper.rectangle.contains({x:A.x+y/2,y:A.y+w/2},B,y,w)}}});v.Plot.EdgeTypes=new q({none:c.empty});v.SliceAndDice=new q({Implements:[d,o,v.Base,g.TM.SliceAndDice]});v.Squarified=new q({Implements:[d,o,v.Base,g.TM.Squarified]});v.Strip=new q({Implements:[d,o,v.Base,g.TM.Strip]});$jit.RGraph=new q({Implements:[d,o,g.Radial],initialize:function(w){var x=$jit.RGraph;var y={interpolation:"linear",levelDistance:100};this.controller=this.config=c.merge(n("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),y,w);var z=this.config;if(z.useCanvas){this.canvas=z.useCanvas;this.config.labelContainer=this.canvas.id+"-label"}else{if(z.background){z.background=c.merge({type:"Circles"},z.background)}this.canvas=new l(this,z);this.config.labelContainer=(typeof z.injectInto=="string"?z.injectInto:z.injectInto.id)+"-label"}this.graphOptions={complex:false,Node:{selected:false,exist:true,drawn:true}};this.graph=new e(this.graphOptions,this.config.Node,this.config.Edge);this.labels=new x.Label[z.Label.type](this);this.fx=new x.Plot(this,x);this.op=new x.Op(this);this.json=null;this.root=null;this.busy=false;this.parent=false;this.initializeExtras()},createLevelDistanceFunc:function(){var w=this.config.levelDistance;return function(x){return(x._depth+1)*w}},refresh:function(){this.compute();this.plot()},reposition:function(){this.compute("end")},plot:function(){this.fx.plot()},getNodeAndParentAngle:function(D){var y=false;var C=this.graph.getNode(D);var A=C.getParents();var z=(A.length>0)?A[0]:false;if(z){var w=z.pos.getc(),B=C.pos.getc();var x=w.add(B.scale(-1));y=Math.atan2(x.y,x.x);if(y<0){y+=2*Math.PI}}return{parent:z,theta:y}},tagChildren:function(A,C){if(A.angleSpan){var B=[];A.eachAdjacency(function(D){B.push(D.nodeTo)},"ignore");var w=B.length;for(var z=0;z1&&A[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render(D,C,B,x,z)},contains:function(x,A){var z=x.nodeFrom.pos.getc(true),y=x.nodeTo.pos.getc(true);return this.edgeHelper.arrow.contains(z,y,A,this.edge.epsilon)}}})})($jit.RGraph);p.prototype.moebiusTransformation=function(y){var w=this.add(y);var x=y.$conjugate().$prod(this);x.x++;return w.$div(x)};e.Util.moebiusTransformation=function(y,A,z,x,w){this.eachNode(y,function(C){for(var B=0;B=2){return B(z-0.01)}}return B(0.75)},getRadius:function(){var w=this.config.radius;if(w!=="auto"){return w}var x=this.canvas.getSize();return Math.min(x.width,x.height)/2},refresh:function(w){if(w){this.reposition();this.graph.eachNode(function(x){x.startPos.rho=x.pos.rho=x.endPos.rho;x.startPos.theta=x.pos.theta=x.endPos.theta})}else{this.compute()}this.plot()},reposition:function(){this.compute("end");var w=this.graph.getNode(this.root).pos.getc().scale(-1);e.Util.moebiusTransformation(this.graph,[w],["end"],"end","ignore");this.graph.eachNode(function(x){if(x.ignore){x.endPos.rho=x.pos.rho;x.endPos.theta=x.pos.theta}})},plot:function(){this.fx.plot()},onClick:function(y,w){var x=this.graph.getNode(y).pos.getc(true);this.move(x,w)},move:function(A,y){var x=r(A.x,A.y);if(this.busy===false&&x.norm()<1){this.busy=true;var w=this.graph.getClosestNodeToPos(x),z=this;this.graph.computeLevels(w.id,0);this.controller.onBeforeCompute(w);y=c.merge({onComplete:c.empty},y||{});this.fx.animate(c.merge({modes:["moebius"],hideLabels:true},y,{onComplete:function(){z.busy=false;y.onComplete()}}),x)}}});$jit.Hypertree.$extend=true;(function(w){w.Op=new q({Implements:e.Op});w.Plot=new q({Implements:e.Plot});w.Label={};w.Label.Native=new q({Implements:e.Label.Native,initialize:function(x){this.viz=x},renderLabel:function(z,B,y){var x=z.getCtx();var C=B.pos.getc(true);var A=this.viz.getRadius();x.fillText(B.name,C.x*A,C.y*A)}});w.Label.SVG=new q({Implements:e.Label.SVG,initialize:function(x){this.viz=x},placeLabel:function(I,C,D){var G=C.pos.getc(true),z=this.viz.canvas,A=z.translateOffsetX,y=z.translateOffsetY,H=z.scaleOffsetX,F=z.scaleOffsetY,E=z.getSize(),x=this.viz.getRadius();var B={x:Math.round((G.x*H)*x+A+E.width/2),y:Math.round((G.y*F)*x+y+E.height/2)};I.setAttribute("x",B.x);I.setAttribute("y",B.y);D.onPlaceLabel(I,C)}});w.Label.HTML=new q({Implements:e.Label.HTML,initialize:function(x){this.viz=x},placeLabel:function(J,D,E){var H=D.pos.getc(true),A=this.viz.canvas,B=A.translateOffsetX,z=A.translateOffsetY,I=A.scaleOffsetX,G=A.scaleOffsetY,F=A.getSize(),x=this.viz.getRadius();var C={x:Math.round((H.x*I)*x+B+F.width/2),y:Math.round((H.y*G)*x+z+F.height/2)};var y=J.style;y.left=C.x+"px";y.top=C.y+"px";y.display=this.fitsInCanvas(C,A)?"":"none";E.onPlaceLabel(J,D)}});w.Plot.NodeTypes=new q({none:{render:c.empty,contains:c.lambda(false)},circle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.circle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.circle.contains(z,A,y)}},ellipse:{render:function(A,y){var B=A.pos.getc().$scale(A.scale),z=A.getData("width"),x=A.getData("height");this.nodeHelper.ellipse.render("fill",B,z,x,y)},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.circle.contains(A,B,y,x)}},square:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.square.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.square.contains(z,A,y)}},rectangle:{render:function(B,y){var A=this.node,z=B.getData("width"),x=B.getData("height"),C=B.pos.getc();z=A.transform?z*(1-C.squaredNorm()):z;x=A.transform?x*(1-C.squaredNorm()):x;C.$scale(B.scale);if(z>0.2&&x>0.2){this.nodeHelper.rectangle.render("fill",C,z,x,y)}},contains:function(z,B){var y=z.getData("width"),x=z.getData("height"),A=z.pos.getc().$scale(z.scale);return this.nodeHelper.square.contains(A,B,y,x)}},triangle:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.triangle.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.triangle.contains(z,A,y)}},star:{render:function(z,x){var y=this.node,B=z.getData("dim"),A=z.pos.getc();B=y.transform?B*(1-A.squaredNorm()):B;A.$scale(z.scale);if(B>0.2){this.nodeHelper.star.render("fill",A,B,x)}},contains:function(x,A){var y=x.getData("dim"),z=x.pos.getc().$scale(x.scale);return this.nodeHelper.star.contains(z,A,y)}}});w.Plot.EdgeTypes=new q({none:c.empty,line:{render:function(x,y){var B=x.nodeFrom.pos.getc(true),A=x.nodeTo.pos.getc(true),z=x.nodeFrom.scale;this.edgeHelper.line.render({x:B.x*z,y:B.y*z},{x:A.x*z,y:A.y*z},y)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.line.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},arrow:{render:function(y,z){var E=y.nodeFrom.pos.getc(true),D=y.nodeTo.pos.getc(true),A=y.nodeFrom.scale,C=y.getData("dim"),B=y.data.$direction,x=(B&&B.length>1&&B[0]!=y.nodeFrom.id);this.edgeHelper.arrow.render({x:E.x*A,y:E.y*A},{x:D.x*A,y:D.y*A},C,x,z)},contains:function(x,B){var A=x.nodeFrom.pos.getc(true),z=x.nodeTo.pos.getc(true),y=x.nodeFrom.scale;this.edgeHelper.arrow.contains({x:A.x*y,y:A.y*y},{x:z.x*y,y:z.y*y},B,this.edge.epsilon)}},hyperline:{render:function(x,y){var B=x.nodeFrom.pos.getc(),A=x.nodeTo.pos.getc(),z=this.viz.getRadius();this.edgeHelper.hyperline.render(B,A,z,y)},contains:c.lambda(false)}})})($jit.Hypertree)})(); \ No newline at end of file diff --git a/public/assets/application-1b051639cbbcf2adbd41629e051c0485.js b/public/assets/application-1b051639cbbcf2adbd41629e051c0485.js new file mode 100644 index 00000000..2e351115 --- /dev/null +++ b/public/assets/application-1b051639cbbcf2adbd41629e051c0485.js @@ -0,0 +1,33 @@ +/*! + * 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 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.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.2,"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",.4,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function filterTopicsByMap(e){Mconsole.graph.eachNode(function(t){t.getData("inmaps").indexOf(parseInt(e))!==-1?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByMapper(e){Mconsole.graph.eachNode(function(t){t.getData("userid").toString()==e?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByName(e){Mconsole.graph.eachNode(function(t){nodeName=t.name.toLowerCase(),nodeName.indexOf(e)!==-1&&e!=""?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id)}),Mconsole.plot()}function clearCanvasExceptRoot(){var e=new Array;Mconsole.graph.eachNode(function(t){e.push(t.id)});var t=Mconsole.graph.nodes[Mconsole.root];e.forEach(function(e,n){e!=t.id&&Mconsole.graph.removeNode(e)}),fetchRelatives(t)}function selectEdgeOnClickHandler(e,t){if(Mconsole.busy)return;if(navigator.platform.indexOf("Mac")!=-1&&t.ctrlKey){selectEdgeOnRightClickHandler(e,t);return}if(synapseWasDoubleClicked()){synapseDoubleClickHandler(e,t);return}var n=MetamapsModel.selectedEdges.indexOf(e);n==-1?n=!1:n!=-1&&(n=!0),n&&t.shiftKey?deselectEdge(e):!n&&t.shiftKey?selectEdge(e):n&&!t.shiftKey?deselectAllEdges():!n&&!t.shiftKey&&(deselectAllEdges(),selectEdge(e)),Mconsole.plot()}function selectEdgeOnRightClickHandler(e,t){t.preventDefault(),t.stopPropagation();if(Mconsole.busy)return;selectEdge(e),$(".rightclickmenu").remove();var n=document.createElement("div");n.className="rightclickmenu";var r="
    ";userid!=null&&(r+='
  • Delete
  • '),mapid&&userid!=null&&(r+='
  • Remove from map
  • '),r+='
  • Hide until refresh
  • ';if(userid){var i='
    • commons
    • public
    • private
    ';r+='
  • Change permissions'+i+"
  • "}r+="
",n.innerHTML=r,$(n).css({left:t.clientX,top:t.clientY}),$("#center-container").append(n),$(".rc-delete").click(function(){$(".rightclickmenu").remove();var e=MetamapsModel.selectedNodes.length,t=MetamapsModel.selectedEdges.length,n=e==1?"1 topic":e+" topics",r=t==1?"1 synapse":t+" synapses",i="You have "+n+" and "+r+" selected. ",s=confirm(i+"Are you sure you want to permanently delete them all? This will remove them from all maps they appear on.");s==1&&(deleteSelectedEdges(),deleteSelectedNodes())}),$(".rc-remove").click(function(){$(".rightclickmenu").remove(),removeSelectedEdges(),removeSelectedNodes()}),$(".rc-hide").click(function(){$(".rightclickmenu").remove(),hideSelectedEdges(),hideSelectedNodes()}),$(".rc-permission li").click(function(){$(".rightclickmenu").remove(),updateSelectedPermissions($(this).text())})}function synapseDoubleClickHandler(e,t){editEdge(e,t)}function synapseWasDoubleClicked(){var e=MetamapsModel.lastSynapseClick,t=Date.now();return MetamapsModel.lastSynapseClick=t,t-eDelete'),mapid&&userid!=null&&(r+='
  • Remove from map
  • '),r+='
  • Hide until refresh
  • ',mapid||(r+='
  • Center this topic
  • '),r+='
  • Open in new tab
  • ';if(userid){var i='
    • commons
    • public
    • private
    ';r+='
  • Change permissions'+i+"
  • "}r+="",n.innerHTML=r,$(n).css({left:t.clientX,top:t.clientY}),$("#center-container").append(n),$(".rc-delete").click(function(){$(".rightclickmenu").remove();var e=MetamapsModel.selectedNodes.length,t=MetamapsModel.selectedEdges.length,n=e==1?"1 topic":e+" topics",r=t==1?"1 synapse":t+" synapses",i="You have "+n+" and "+r+" selected. ",s=confirm(i+"Are you sure you want to permanently delete them all? This will remove them from all maps they appear on.");s==1&&(deleteSelectedEdges(),deleteSelectedNodes())}),$(".rc-remove").click(function(){$(".rightclickmenu").remove(),removeSelectedEdges(),removeSelectedNodes()}),$(".rc-hide").click(function(){$(".rightclickmenu").remove(),hideSelectedEdges(),hideSelectedNodes()}),$(".rc-center").click(function(){$(".rightclickmenu").remove(),centerOn(e.id)}),$(".rc-popout").click(function(){$(".rightclickmenu").remove();var t=window.open("/topics/"+e.id,"_blank");t.focus()}),$(".rc-permission li").click(function(){$(".rightclickmenu").remove(),updateSelectedPermissions($(this).text())})}function canvasDoubleClickHandler(e,t){var n=MetamapsModel.lastCanvasClick,r=Date.now();MetamapsModel.lastCanvasClick=r,r-n=Mconsole.canvas.scaleOffsetX*d&&Mconsole.canvas.scaleOffsetX*d>=1&&Mconsole.canvas.scale(d,d),Mconsole.canvas.scaleOffsetX<.5?Mconsole.canvas.viz.labels.hideLabels(!0):Mconsole.canvas.scaleOffsetX>.5&&Mconsole.canvas.viz.labels.hideLabels(!1),lastDist=p}}function updateSelectedPermissions(e){$(".notice.metamaps").length==0&&$("body").prepend('
    '),$(".notice.metamaps").hide().html("Working...").fadeIn("fast");var t=0,n=0,r=MetamapsModel.selectedEdges.length;for(var i=r-1;i>=0;i-=1){var s=MetamapsModel.selectedEdges[i];s.getData("userid")==userid&&(updateSynapsePermission(s,e),n++)}var r=MetamapsModel.selectedNodes.length;for(var i=r-1;i>=0;i-=1){var o=MetamapsModel.selectedNodes[i];o.getData("userid")==userid&&(updateTopicPermission(o,e),t++)}var u=t==1?t.toString()+" topic and ":t.toString()+" topics and ",a=n==1?n.toString()+" synapse":n.toString()+" synapses";$(".notice.metamaps").html(u+a+" you created updated to "+e),setTimeout(function(){$(".notice.metamaps").fadeOut("fast")},8e3)}function graphSettings(e,t){var n={injectInto:"infovis",Navigation:{enable:!0,panning:"avoid nodes",zooming:28},Node:{overridable:!0,color:"#2D6A5D",type:"customNode",dim:25},Edge:{overridable:!0,color:"#222222",type:"customEdge",lineWidth:2,alpha:.4},Label:{type:"Native",size:20,family:"arial",textBaseline:"hanging",color:"#DDD"},Tips:{enable:!1,onShow:function(e,t){}},Events:{enable:!0,enableForEdges:!0,onMouseMove:function(e,t,n){onMouseMoveHandler(e,t,n)},onDragMove:function(e,t,n){onDragMoveTopicHandler(e,t,n)},onDragEnd:function(e,t,n){onDragEndTopicHandler(e,t,n,!1)},onDragCancel:function(e,t,n){onDragCancelHandler(e,t,n,!1)},onTouchStart:function(e,t,n){Mconsole.events.touched=!0,touchPos=t.getPos();var r=Mconsole.canvas,i=r.translateOffsetX;oy=r.translateOffsetY,sx=r.scaleOffsetX,sy=r.scaleOffsetY,touchPos.x*=sx,touchPos.y*=sy,touchPos.x+=i,touchPos.y+=oy,touchDragNode=e},onTouchMove:function(e,t,n){touchDragNode?onDragMoveTopicHandler(touchDragNode,t,n):(touchPanZoomHandler(t,n),Mconsole.labels.hideLabel(Mconsole.graph.getNode(MetamapsModel.showcardInUse)))},onTouchEnd:function(e,t,n){},onTouchCancel:function(e,t,n){},onClick:function(e,t,n){if(MetamapsModel.boxStartCoordinates){Mconsole.busy=!1,MetamapsModel.boxEndCoordinates=t.getPos(),selectNodesWithBox();return}if(n.target.id!="infovis-canvas")return!1;e.nodeFrom?selectEdgeOnClickHandler(e,n):e&&!e.nodeFrom?selectNodeOnClickHandler(e,n):(MetamapsModel.didPan||hideCards(),canvasDoubleClickHandler(t.getPos(),n))},onRightClick:function(e,t,n){n.preventDefault(),n.stopPropagation(),e&&!e.nodeFrom?selectNodeOnRightClickHandler(e,n):e&&e.nodeFrom&&selectEdgeOnRightClickHandler(e,n)}},iterations:200,levelDistance:200};return t&&(n.Edge.type="customEdgeEmbed"),e=="centered"&&(n.background={CanvasStyles:{strokeStyle:"#333",lineWidth:1.5}},n.levelDistance=280,n.Events.enableForEdges=!0,n.Events.onDragEnd=function(e,t,n){onDragEndTopicHandler(e,t,n,!1)},n.Events.onDragCancel=function(e,t,n){onDragCancelHandler(e,t,n,!0)}),n}function hideCards(){$("#edit_synapse").hide(),MetamapsModel.edgecardInUse=null,hideCurrentCard(),$(".rightclickmenu").remove()}function drawSelectBox(e,t){Mconsole.plot();var n=Mconsole.canvas.getCtx(),r=MetamapsModel.boxStartCoordinates.x,i=MetamapsModel.boxStartCoordinates.y,s=e.getPos().x,o=e.getPos().y;Mconsole.plot(),n.beginPath(),n.moveTo(r,i),n.lineTo(r,o),n.lineTo(s,o),n.lineTo(s,i),n.lineTo(r,i),n.strokeStyle="black",n.stroke()}function selectNodesWithBox(){var e=MetamapsModel.boxStartCoordinates.x,t=MetamapsModel.boxStartCoordinates.y,n=MetamapsModel.boxEndCoordinates.x,r=MetamapsModel.boxEndCoordinates.y;Mconsole.graph.eachNode(function(i){var s=gType=="centered"?i.pos.toComplex().x:i.pos.x,o=gType=="centered"?i.pos.toComplex().y:i.pos.y;if(es&&s>n&&t>o&&o>r||e>s&&s>n&&to&&o>r){var u=MetamapsModel.selectedNodes.indexOf(i);u==-1?selectNode(i):u!=-1&&deselectNode(i)}}),MetamapsModel.boxStartCoordinates=!1,MetamapsModel.boxEndCoordinates=!1,Mconsole.plot()}function onMouseMoveHandler(e,t,n){if(Mconsole.busy)return;var e=t.getNode(),r=t.getEdge();if(e!=0){MetamapsModel.edgeHoveringOver&&onMouseLeave(MetamapsModel.edgeHoveringOver),$("canvas").css("cursor","pointer");return}r==0&&MetamapsModel.edgeHoveringOver!=0?onMouseLeave(MetamapsModel.edgeHoveringOver):r!=0&&MetamapsModel.edgeHoveringOver==0?onMouseEnter(r):r!=0&&MetamapsModel.edgeHoveringOver!=r&&(onMouseLeave(MetamapsModel.edgeHoveringOver),onMouseEnter(r)),MetamapsModel.edgeHoveringOver=r,!e&&!r&&$("canvas").css("cursor","default")}function onMouseEnter(e){$("canvas").css("cursor","pointer");var t=MetamapsModel.selectedEdges.indexOf(e);t==-1&&(e.setData("showDesc",!0,"current"),e.setDataset("end",{lineWidth:4,alpha:1}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),Mconsole.plot())}function onMouseLeave(e){$("canvas").css("cursor","default");var t=MetamapsModel.selectedEdges.indexOf(e);t==-1&&(e.setData("showDesc",!1,"current"),e.setDataset("end",{lineWidth:2,alpha:.4}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100})),Mconsole.plot()}function onDragEndTopicHandler(e,t,n,r){if(tempInit&&tempNode2==null)$("#topic_addSynapse").val("true"),$("#new_topic").fadeIn("fast"),$("#topic_name").focus();else if(tempInit&&tempNode2!=null)$("#topic_addSynapse").val("false"),$("#synapse_topic1id").val(tempNode.id),$("#synapse_topic2id").val(tempNode2.id),$("#new_synapse").fadeIn("fast"),$("#synapse_desc").focus(),tempNode=null,tempNode2=null,tempInit=!1;else if(dragged&&dragged!=0&&goRealtime){saveLayout(dragged);for(var i=0;i $_name_$
    $_metacode_select_$
    $_desc_$
    '}function replaceVariables(e,t){var n,r,i;authorizeToEdit(t)?(n='',r="",i=""):(n="",t.getData("link")!=""?(r='',i=""):(r="",i=""));var s="Click to add description...",o="Click to add link...",u="";userid==t.getData("userid")&&(u='
    Permissions:  $_permission_$
    ');var a=["commons","public","private"],f="'[";for(var l in a)f+='["'+a[l]+'","'+a[l]+'"],';return f=f.slice(0,-1),f+="]'",u=u.replace(/\$_permission_choices_\$/g,f),e=e.replace(/\$_edit_permission_\$/g,u),e=e.replace(/\$_permission_\$/g,t.getData("permission")),e=e.replace(/\$_mk_permission_\$/g,mk_permission(t)),e=e.replace(/\$_map_count_\$/g,t.getData("inmaps").length),e=e.replace(/\$_synapse_count_\$/g,t.getData("synapseCount")),e=e.replace(/\$_id_\$/g,t.id),e=e.replace(/\$_metacode_\$/g,t.getData("metacode")),e=e.replace(/\$_imgsrc_\$/g,imgArray[t.getData("metacode")].src),e=e.replace(/\$_name_\$/g,t.name),e=e.replace(/\$_userid_\$/g,t.getData("userid")),e=e.replace(/\$_username_\$/g,t.getData("username")),e=e.replace(/\$_date_\$/g,t.getData("date")),e=e.replace(/\$_metacode_select_\$/g,$("#metacodeOptions").html()),e=e.replace(/\$_go_link_\$/g,n),e=e.replace(/\$_a_tag_\$/g,r),e=e.replace(/\$_close_a_tag_\$/g,i),e=e.replace(/\$_link_nil_\$/g,o),t.getData("link")==""&&authorizeToEdit(t)?e=e.replace(/\$_link_\$/g,o):e=e.replace(/\$_link_\$/g,t.getData("link")),e=e.replace(/\$_desc_nil_\$/g,s),t.getData("desc")==""&&authorizeToEdit(t)?e=e.replace(/\$_desc_\$/g,s):e=e.replace(/\$_desc_\$/g,t.getData("desc")),e}function hideCurrentCard(){if(MetamapsModel.showcardInUse){var e=Mconsole.graph.getNode(MetamapsModel.showcardInUse);hideCard(e)}}function hideCard(e){var t=".showcard";$(t).fadeOut("fast",function(){Mconsole.plot()}),MetamapsModel.showcardInUse=null}function populateShowCard(e){var t=document.getElementById("showcard");$(t).find(".permission").remove();var n=generateShowcardHTML();n=replaceVariables(n,e);if(authorizeToEdit(e)){var r=document.createElement("div"),i="permission canEdit";userid==e.data.$userid&&(i+=" yourTopic"),r.className=i,r.innerHTML=n,t.appendChild(r)}else{var r=document.createElement("div");r.className="permission cannotEdit",r.innerHTML=n,t.appendChild(r)}var s=!1;$(".showcard .metacodeImage").mouseenter(function(){$(".showcard .icon").css("z-index","4"),$(".showcard .metacodeTitle").show()}),$(".showcard .linkItem.icon").mouseleave(function(){s||($(".showcard .metacodeTitle").hide(),$(".showcard .icon").css("z-index","1"))}),$(".showcard .metacodeTitle").click(function(){s?(s=!1,$(this).removeClass("minimize"),$(".metacodeSelect").hide()):(s=!0,$(this).addClass("minimize"),$(".metacodeSelect").show(),$(".metacodeSelect ul").hasClass("mCustomScrollbar")||($(".metacodeSelect ul").mCustomScrollbar(),$(".metacodeSelect li").click(function(){s=!1;var t=$(this).find(".mSelectName").text();updateMetacode(e,t)})))});var o=!1;userid==e.data.$userid&&$(".showcard .yourTopic .mapPerm").click(function(){o?(o=!1,$(this).removeClass("minimize"),$(".permissionSelect").remove()):(o=!0,$(this).addClass("minimize"),$(this).hasClass("co")?$(this).append('
    '):$(this).hasClass("pu")?$(this).append('
    '):$(this).hasClass("pr")&&$(this).append('
    '),$(".permissionSelect li").click(function(t){o=!1;var n=$(this).attr("class");updateTopicPermission(e,n),t.stopPropagation()}))}),$(".best_in_place_desc textarea").bind("keyup",function(){var e=$(".showcard").find(".scroll");e.height(e.height()).mCustomScrollbar("update"),console.log("working")}),$(t).find(".best_in_place_name").bind("ajax:success",function(){var t=$(".showcard").find(".scroll");t.height(t.height()).mCustomScrollbar("update");var n=$(this).html();e.name=decodeEntities(n),Mconsole.plot()}),$(t).find(".best_in_place_desc").bind("ajax:success",function(){this.innerHTML=this.innerHTML.replace(/\r/g,"");var t=$(".showcard").find(".scroll");t.height(t.height()).mCustomScrollbar("update");var n=$(this).html();e.setData("desc",n)}),$(t).find(".best_in_place_link").bind("ajax:success",function(){var n=$(this).html();$(t).find(".go-link").attr("href",n),e.setData("link",n)})}function authorizeToEdit(e){return!userid||e.data.$permission!="commons"&&e.data.$userid!=userid?!1:!0}function mk_permission(e){if(e.getData("permission")=="commons")return"co";if(e.getData("permission")=="public")return"pu";if(e.getData("permission")=="private")return"pr"}function centerOn(e){if(!Mconsole.busy){var t=Mconsole.graph.getNode(e);$("div.index img").attr("src",imgArray[t.getData("metacode")].src),$("div.index .mapName").html(t.name),$(document).attr("title",t.name+" | Metamaps"),window.history.pushState(t.name,"Metamaps","/topics/"+t.id),Mconsole.onClick(t.id,{hideLabels:!1,duration:1e3,onComplete:function(){fetchRelatives(t)}})}}function editEdge(e,t){var n=$("#edit_synapse").css("left"),r=$("#edit_synapse").css("top");$("#edit_synapse").remove(),deselectEdge(e);var i=document.createElement("div");i.setAttribute("id","edit_synapse"),authorizeToEdit(e)?(i.className="permission canEdit",i.className+=e.getData("userid")===userid?" yourEdge":""):i.className="permission cannotEdit",$(".main .wrapper").append(i),populateEditEdgeForm(e),$("#edit_synapse").css("position","absolute"),t?($("#edit_synapse").css("left",t.clientX),$("#edit_synapse").css("top",t.clientY)):($("#edit_synapse").css("left",n),$("#edit_synapse").css("top",r)),$("#edit_synapse").show(),MetamapsModel.edgecardInUse=e.data.$id}function populateEditEdgeForm(e){add_name_form(e),add_user_info(e),add_perms_form(e),authorizeToEdit(e)&&add_direction_form(e)}function add_name_form(e){var t='Click to add description.';$("#edit_synapse").append('
    '),$("#edit_synapse_name").attr("class","best_in_place best_in_place_desc"),$("#edit_synapse_name").attr("data-object","synapse"),$("#edit_synapse_name").attr("data-attribute","desc"),$("#edit_synapse_name").attr("data-type","textarea"),$("#edit_synapse_name").attr("data-nil",t),$("#edit_synapse_name").attr("data-url","/synapses/"+e.getData("id")),$("#edit_synapse_name").html(e.getData("desc")),$("#edit_synapse_name").html().trim()==""&&$("#edit_synapse_name").html(t),$("#edit_synapse_name").bind("ajax:success",function(){var n=$(this).html();n==t?e.setData("desc",""):e.setData("desc",n),selectEdge(e),Mconsole.plot()})}function add_user_info(e){$("#edit_synapse").append('
    Created by '+e.getData("username")+"
    ")}function add_perms_form(e){$("#edit_synapse").append('
    ');var t=!1;userid==e.getData("userid")&&$("#edit_synapse.yourEdge .mapPerm").click(function(){t?(t=!1,$(this).removeClass("minimize"),$("#edit_synapse .permissionSelect").remove()):(t=!0,$(this).addClass("minimize"),$(this).hasClass("co")?$(this).append('
    '):$(this).hasClass("pu")?$(this).append('
    '):$(this).hasClass("pr")&&$(this).append('
    '),$("#edit_synapse .permissionSelect li").click(function(n){t=!1;var r=$(this).attr("class");updateSynapsePermission(e,r),n.stopPropagation()}))})}function add_direction_form(e){$("#edit_synapse").append(''),$("#edit_synapse").append('' +),$("#edit_synapse").append(''),$("#edit_synapse").append('');if(e.nodeFrom.pos.x=0;t-=1){var n=MetamapsModel.selectedEdges[t];deselectEdge(n)}}function deselectAllNodes(){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];deselectNode(n)}}function removeEdge(e){var t=e.getData("id");$.ajax({type:"DELETE",url:"/synapses/"+t,success:function(){hideEdge(e)}})}function hideEdge(e){var t=e.nodeFrom.id,n=e.nodeTo.id;e.setData("alpha",0,"end"),Mconsole.fx.animate({modes:["edge-property:alpha"],duration:1e3}),Mconsole.graph.removeAdjacence(t,n),Mconsole.plot()}function hideSelectedEdges(){var e=MetamapsModel.selectedEdges.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedEdges[t];hideEdge(n)}MetamapsModel.selectedEdges=new Array}function removeSelectedEdges(){var e=MetamapsModel.selectedEdges.length;for(var t=e-1;t>=0;t-=1){if(mapid!=null){var n=MetamapsModel.selectedEdges[t],r=n.getData("id");$.ajax({type:"POST",url:"/synapses/"+mapid+"/"+r+"/removefrommap"})}hideEdge(n)}MetamapsModel.selectedEdges=new Array}function deleteSelectedEdges(){var e=MetamapsModel.selectedEdges.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedEdges[t],r=n.getData("id");$.ajax({type:"DELETE",url:"/synapses/"+r}),hideEdge(n)}MetamapsModel.selectedEdges=new Array}function selectNode(e){if(MetamapsModel.selectedNodes.indexOf(e)!=-1)return;e.selected=!0,e.setData("dim",30,"current"),e.setData("whiteCircle",!0),e.eachAdjacency(function(e){selectEdge(e)}),MetamapsModel.selectedNodes.push(e)}function deselectNode(e){delete e.selected,e.setData("whiteCircle",!1),e.eachAdjacency(function(e){deselectEdge(e)}),e.setData("dim",25,"current"),MetamapsModel.selectedNodes.splice(MetamapsModel.selectedNodes.indexOf(e),1)}function selectEdge(e){if(MetamapsModel.selectedEdges.indexOf(e)!=-1)return;e.setData("showDesc",!0,"current"),MetamapsModel.embed?MetamapsModel.embed&&e.setDataset("end",{lineWidth:4,color:"#999",alpha:1}):e.setDataset("end",{lineWidth:4,color:"#FFFFFF",alpha:1}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),MetamapsModel.selectedEdges.push(e)}function deselectEdge(e){e.setData("showDesc",!1,"current"),e.setDataset("end",{lineWidth:2,color:"#222222",alpha:.4}),MetamapsModel.edgeHoveringOver==e&&(e.setData("showDesc",!0,"current"),e.setDataset("end",{lineWidth:4,color:"#222222",alpha:1})),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),MetamapsModel.selectedEdges.splice(MetamapsModel.selectedEdges.indexOf(e),1)}function hideNode(e){var t=Mconsole.graph.getNode(e);if(e==Mconsole.root&&gType=="centered"){alert("You can't hide this topic, it is the root of your graph.");return}deselectNode(t),t.setData("alpha",0,"end"),t.eachAdjacency(function(e){e.setData("alpha",0,"end")}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:1e3}),Mconsole.graph.removeNode(e)}function hideSelectedNodes(){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];hideNode(n.id)}}function removeNode(e){var t=Mconsole.graph.getNode(e);deselectNode(t),mapperm&&$.ajax({type:"POST",url:"/topics/"+mapid+"/"+e+"/removefrommap"})}function removeSelectedNodes(){if(mapperm){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];removeNode(n.id)}}}function deleteNode(e){if(e==Mconsole.root&&gType=="centered"){alert("You can't delete this topic, it is the root of your graph.");return}$.ajax({type:"DELETE",url:"/topics/"+e})}function deleteSelectedNodes(){var e=MetamapsModel.selectedNodes.length;for(var t=e-1;t>=0;t-=1){var n=MetamapsModel.selectedNodes[t];deleteNode(n.id)}}function addHoverForSettings(){$(".permActivator").unbind("mouseover"),$(".permActivator").unbind("mouseout");var e=!1,t,n;$(".permActivator").bind("mouseover",function(){clearTimeout(n),that=this,t=setTimeout(function(){e||(e=!0,$(that).animate({width:"203px",height:"37px"},300,function(){e=!1}))},300)}),$(".permActivator").bind("mouseout",function(){clearTimeout(t),that=this,n=setTimeout(function(){e||(e=!0,$(that).animate({height:"16px",width:"16px"},300,function(){e=!1}))},800)}),$(".best_in_place_permission").unbind("ajax:success"),$(".best_in_place_permission").bind("ajax:success",function(){var e=$(this).html(),t=$(this).parents(".cardSettings").find(".mapPerm");t.attr("title",e),e=="commons"?t.html("co"):e=="public"?t.html("pu"):e=="private"&&t.html("pr")})}function saveLayoutAll(){$(".sidebarSave .tip").html("Saving...");var e="";if(gType=="arranged"||gType=="chaotic")Mconsole.graph.eachNode(function(t){e=e+t.getData("mappingid")+"/"+t.pos.x+"/"+t.pos.y+","}),e=e.slice(0,-1),$("#map_coordinates").val(e),$("#saveMapLayout").submit()}function saveLayout(e){var t=Mconsole.graph.getNode(e);$("#map_coordinates").val(t.getData("mappingid")+"/"+t.pos.x+"/"+t.pos.y),$("#saveMapLayout").submit(),dragged=0}function saveToMap(){var e="",t="",n=new Array;Mconsole.graph.eachNode(function(t){if(categoryVisible[t.getData("metacode")]==0)return;var r,i;if(t.pos.x&&t.pos.y)r=t.pos.x,i=t.pos.y;else var r=Math.cos(t.pos.theta)*t.pos.rho,i=Math.sin(t.pos.theta)*t.pos.rho;e+=t.id+"/"+r+"/"+i+",",t.eachAdjacency(function(e){n.push(e.getData("id"))})}),n=$.grep(n,function(e,t){return $.inArray(e,n)===t}),t=n.join(),e=e.slice(0,-1),$("#map_topicsToMap").val(e),$("#map_synapsesToMap").val(t),openLightbox("forkmap")}function fetchRelatives(e){var t=$.ajax({type:"Get",url:"/topics/"+e.id+"?format=json",success:function(e){gType=="centered"?(Mconsole.busy=!0,Mconsole.op.sum(e,{type:"fade",duration:500,hideLabels:!1}),Mconsole.graph.eachNode(function(e){e.eachAdjacency(function(e){e.getData("showDesc")||(e.setData("alpha",.4,"start"),e.setData("alpha",.4,"current"),e.setData("alpha",.4,"end"))})}),Mconsole.busy=!1):(Mconsole.op.sum(e,{type:"nothing"}),Mconsole.plot())},error:function(){alert("failure")}})}function updateMetacode(e,t){var n={topic:{metacode:t}};$.ajax({type:"PUT",dataType:"json",url:"/topics/"+e.id,data:n,success:function(n){$(".CardOnGraph").find(".metacodeTitle").text(t),$(".CardOnGraph").find(".metacodeImage").css("background-image","url("+imgArray[t].src+")"),e.setData("metacode",t),Mconsole.plot(),$(".metacodeTitle").removeClass("minimize"),$(".metacodeSelect").hide(),setTimeout(function(){$(".metacodeTitle").hide(),$(".showcard .icon").css("z-index","1")},500)},error:function(){alert("failed to update metacode")}})}function updateTopicPermission(e,t){var n={topic:{permission:t}};$.ajax({type:"PUT",dataType:"json",url:"/topics/"+e.id,data:n,success:function(n){$(".showcard .mapPerm").removeClass("co pu pr minimize").addClass(t.substring(0,2)),$(".permissionSelect").remove(),e.setData("permission",t)},error:function(){alert("failed to update permission")}})}function updateSynapsePermission(e,t){var n={synapse:{permission:t}};$.ajax({type:"PUT",dataType:"json",url:"/synapses/"+e.data.$id,data:n,success:function(n){$("#edit_synapse .mapPerm").removeClass("co pu pr minimize").addClass(t.substring(0,2)),$("#edit_synapse .permissionSelect").remove(),e.setData("permission",t)},error:function(){alert("failed to update permission")}})}function updateMapPermission(e,t){var n={map:{permission:t}};$.ajax({type:"PUT",dataType:"json",url:"/maps/"+e,data:n,success:function(e){$(".mapPermission").removeClass("commons public private minimize").addClass(t),$(".mapPermission .permissionSelect").remove()},error:function(){alert("failed to update permission")}})}function MconsoleReset(){var e=Mconsole.canvas.translateOffsetX,t=Mconsole.canvas.translateOffsetY;Mconsole.canvas.translate(-e,-t);var n=Mconsole.canvas.scaleOffsetX,r=Mconsole.canvas.scaleOffsetY;Mconsole.canvas.scale(1/n,1/r)}function openNodeShowcard(e){populateShowCard(e),$(".showcard").fadeIn("fast");var t=$(".showcard").find(".scroll");t.height(t.height()).mCustomScrollbar(),MetamapsModel.showcardInUse=e.id}function openLightbox(e){$(".lightboxContent").hide(),$("#"+e).show(),$("#lightbox_overlay").show(),$("#lightbox_main").css("margin-top","-"+$("#lightbox_main").height()/2+"px")}function cancelMapCreate(e){$("#lightbox_overlay").hide();var t=$("#"+e);return t.find("#map_name").val(""),t.find("#map_desc").val(""),t.find("#map_permission").val("commons"),e=="fork_map"&&(t.find("#map_topicsToMap").val("0"),t.find("#map_synapsesToMap").val("0")),t.find(".mapPermIcon").removeClass("selected"),t.find(".mapCommonsIcon").addClass("selected"),!1}(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\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]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return typeof e=="object"?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0],r.style.cssText="top:1px;float:left;opacity:.5";if(!n||!n.length||!r)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)|| +{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||++v.uuid:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n-1)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n-1)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r,i,s=e.selectedIndex,o=[],u=e.options,a=e.type==="select-one";if(s<0)return null;n=a?s:0,r=a?s+1:u.length;for(;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,""+r),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0),u[c]&&f.push(l);f.length&&b.push({elem:s,matches:f})}p.length>d&&b.push({elem:this,matches:p.slice(d)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function Y(e,t,n,r){n=n||[],t=t||m;var i,s,o,f,l=t.nodeType;if(l!==1&&l!==9)return[];if(!e||typeof e!="string")return n;o=u(t);if(!o&&!r)if(i=j.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&a(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return w.apply(n,b.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&K&&t.getElementsByClassName)return w.apply(n,b.call(t.getElementsByClassName(f),0)),n}return lt(e,t,n,r,o)}function Z(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function et(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function tt(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function nt(e,t,n,r){var i,o,u,a,f,l,c,h,p,v,g=!n&&t!==m,y=(g?"":"")+e.replace(D,"$1"),w=T[d][y];if(w)return r?0:b.call(w,0);f=e,l=[],h=0,p=s.preFilter,v=s.filter;while(f){if(!i||(o=P.exec(f)))o&&(f=f.slice(o[0].length),u.selector=c),l.push(u=[]),c="",g&&(f=" "+f);i=!1;if(o=H.exec(f))c+=o[0],f=f.slice(o[0].length),i=u.push({part:o.pop().replace(D," "),string:o[0],captures:o});for(a in v)(o=W[a].exec(f))&&(!p[a]||(o=p[a](o,t,n)))&&(c+=o[0],f=f.slice(o[0].length),i=u.push({part:a,string:o.shift(),captures:o}));if(!i)break}return c&&(u.selector=c),r?f.length:f?Y.error(e):b.call(T(y,l),0)}function rt(e,t,i,s){var o=t.dir,u=y++;return e||(e=function(e){return e===i}),t.first?function(t){while(t=t[o])if(t.nodeType===1)return e(t)&&t}:s?function(t){while(t=t[o])if(t.nodeType===1&&e(t))return t}:function(t){var i,s=u+"."+n,a=s+"."+r;while(t=t[o])if(t.nodeType===1){if((i=t[d])===a)return t.sizset;if(typeof i=="string"&&i.indexOf(s)===0){if(t.sizset)return t}else{t[d]=a;if(e(t))return t.sizset=!0,t;t.sizset=!1}}}}function it(e,t){return e?function(n){var r=t(n);return r&&e(r===!0?n:r)}:t}function st(e,t,n){var r,i,o=0;for(;r=e[o];o++)s.relative[r.part]?i=rt(i,s.relative[r.part],t,n):i=it(i,s.filter[r.part].apply(null,r.captures.concat(t,n)));return i}function ot(e){return function(t){var n,r=0;for(;n=e[r];r++)if(n(t))return!0;return!1}}function ut(e,t,n,r){var i=0,s=t.length;for(;i0?a(u,n,o):[]}function ft(e,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m,g,y=0,b=e.length,E=W.POS,S=new RegExp("^"+E.source+"(?!"+C+")","i"),x=function(){var e=1,n=arguments.length-2;for(;ec){o+=l.slice(c,p.index),c=v,m=[n],H.test(o)&&(h&&(m=h),h=i);if(g=q.test(o))o=o.slice(0,-5).replace(H,"$&*"),c++;p.length>1&&p[0].replace(S,x),h=at(o,p[1],p[2],m,h,g)}o=""}}d||(o+=l),d=!1}o?H.test(o)?ut(o,h||[n],r,i):Y(o,n,r,i?i.concat(h):h):w.apply(r,h)}return b===1?r:Y.uniqueSort(r)}function lt(e,t,i,o,u){e=e.replace(D,"$1");var a,l,c,h,p,d,v,m,g,y,E=nt(e,t,u),S=t.nodeType;if(W.POS.test(e))return ft(E,t,i,o);if(o)a=b.call(o,0);else if(E.length===1){if((d=b.call(E[0],0)).length>2&&(v=d[0]).part==="ID"&&S===9&&!u&&s.relative[d[1].part]){t=s.find.ID(v.captures[0].replace(z,""),t,u)[0];if(!t)return i;e=e.slice(d.shift().string.length)}g=(E=I.exec(d[0].string))&&!E.index&&t.parentNode||t,m="";for(p=d.length-1;p>=0;p--){v=d[p],y=v.part,m=v.string+m;if(s.relative[y])break;if(s.order.test(y)){a=s.find[y](v.captures[0].replace(z,""),g,u);if(a==null)continue;e=e.slice(0,e.length-m.length)+m.replace(W[y],""),e||w.apply(i,b.call(a,0));break}}}if(e){l=f(e,t,u),n=l.dirruns++,a==null&&(a=s.find.TAG("*",I.test(e)&&t.parentNode||t));for(p=0;h=a[p];p++)r=l.runs++,l(h)&&i.push(h)}return i}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=e.document,g=m.documentElement,y=0,b=[].slice,w=[].push,E=function(e,t){return e[d]=t||!0,e},S=function(){var e={},t=[];return E(function(n,r){return t.push(n)>s.cacheLength&&delete e[t.shift()],e[n]=r},e)},x=S(),T=S(),N=S(),C="[\\x20\\t\\r\\n\\f]",k="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",L=k.replace("w","w#"),A="([*^$|!~]?=)",O="\\["+C+"*("+k+")"+C+"*(?:"+A+C+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+L+")|)|)"+C+"*\\]",M=":("+k+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+O+")|[^:]|\\\\.)*|.*))\\)|)",_=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",D=new RegExp("^"+C+"+|((?:^|[^\\\\])(?:\\\\.)*)"+C+"+$","g"),P=new RegExp("^"+C+"*,"+C+"*"),H=new RegExp("^"+C+"*([\\x20\\t\\r\\n\\f>+~])"+C+"*"),B=new RegExp(M),j=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,F=/^:not/,I=/[\x20\t\r\n\f]*[+~]/,q=/:not\($/,R=/h\d/i,U=/input|select|textarea|button/i,z=/\\(?!\\)/g,W={ID:new RegExp("^#("+k+")"),CLASS:new RegExp("^\\.("+k+")"),NAME:new RegExp("^\\[name=['\"]?("+k+")['\"]?\\]"),TAG:new RegExp("^("+k.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+C+"*(even|odd|(([+-]|)(\\d*)n|)"+C+"*(?:([+-]|)"+C+"*(\\d+)|))"+C+"*\\)|)","i"),POS:new RegExp(_,"ig"),needsContext:new RegExp("^"+C+"*[>+~]|"+_,"i")},X=function(e){var t=m.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},V=X(function(e){return e.appendChild(m.createComment("")),!e.getElementsByTagName("*").length}),$=X(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),J=X(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),K=X(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),Q=X(function(e){e.id=d+0,e.innerHTML="
    ",g.insertBefore(e,g.firstChild);var t=m.getElementsByName&&m.getElementsByName(d).length===2+m.getElementsByName(d+0).length;return i=!m.getElementById(d),g.removeChild(e),t});try{b.call(g.childNodes,0)[0].nodeType}catch(G){b=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}Y.matches=function(e,t){return Y(e,null,null,t)},Y.matchesSelector=function(e,t){return Y(t,null,null,[e]).length>0},o=Y.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},u=Y.isXML=function(t){var n=t&&(t.ownerDocument||t).documentElement;return n?n.nodeName!=="HTML":!1},a=Y.contains=g.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:g.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},Y.attr=function(e,t){var n,r=u(e);return r||(t=t.toLowerCase()),s.attrHandle[t]?s.attrHandle[t](e):J||r?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},s=Y.selectors={cacheLength:50,createPseudo:E,match:W,order:new RegExp("ID|TAG"+(Q?"|NAME":"")+(K?"|CLASS":"")),attrHandle:$?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:i?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:V?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(z,""),e[3]=(e[4]||e[5]||"").replace(z,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||Y.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&Y.error(e[0]),e},PSEUDO:function(e,t,n){var r,i;if(W.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(r=e[4])B.test(r)&&(i=nt(r,t,n,!0))&&(i=r.indexOf(")",r.length-i)-r.length)&&(r=r.slice(0,i),e[0]=e[0].slice(0,i)),e[2]=r;return e.slice(0,3)}},filter:{ID:i?function(e){return e=e.replace(z,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(z,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(z,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=x[d][e];return t||(t=x(e,new RegExp("(^|"+C+")"+e+"("+C+"|$)"))),function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")}},ATTR:function(e,t,n){return t?function(r){var i=Y.attr(r,e),s=i+"";if(i==null)return t==="!=";switch(t){case"=":return s===n;case"!=":return s!==n;case"^=":return n&&s.indexOf(n)===0;case"*=" +:return n&&s.indexOf(n)>-1;case"$=":return n&&s.substr(s.length-n.length)===n;case"~=":return(" "+s+" ").indexOf(n)>-1;case"|=":return s===n||s.substr(0,n.length+1)===n+"-"}}:function(t){return Y.attr(t,e)!=null}},CHILD:function(e,t,n,r){if(e==="nth"){var i=y++;return function(e){var t,s,o=0,u=e;if(n===1&&r===0)return!0;t=e.parentNode;if(t&&(t[d]!==i||!e.sizset)){for(u=t.firstChild;u;u=u.nextSibling)if(u.nodeType===1){u.sizset=++o;if(u===e)break}t[d]=i}return s=e.sizset-r,n===0?s===0:s%n===0&&s/n>=0}}return function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t,n,r){var i,o=s.pseudos[e]||s.pseudos[e.toLowerCase()];return o||Y.error("unsupported pseudo: "+e),o[d]?o(t,n,r):o.length>1?(i=[e,e,"",t],function(e){return o(e,0,i)}):o}},pseudos:{not:E(function(e,t,n){var r=f(e.replace(D,"$1"),t,n);return function(e){return!r(e)}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!s.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},contains:E(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),has:E(function(e){return function(t){return Y(e,t).length>0}}),header:function(e){return R.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:Z("radio"),checkbox:Z("checkbox"),file:Z("file"),password:Z("password"),image:Z("image"),submit:et("submit"),reset:et("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return U.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&(!!e.type||!!e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t,n){return n?e.slice(1):[e[0]]},last:function(e,t,n){var r=e.pop();return n?e:[r]},even:function(e,t,n){var r=[],i=n?1:0,s=e.length;for(;i",e.querySelectorAll("[selected]").length||i.push("\\["+C+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),X(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+C+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=i.length&&new RegExp(i.join("|")),lt=function(e,r,s,o,u){if(!o&&!u&&(!i||!i.test(e)))if(r.nodeType===9)try{return w.apply(s,b.call(r.querySelectorAll(e),0)),s}catch(a){}else if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){var f,l,c,h=r.getAttribute("id"),p=h||d,v=I.test(e)&&r.parentNode||r;h?p=p.replace(n,"\\$&"):r.setAttribute("id",p),f=nt(e,r,u),p="[id='"+p+"']";for(l=0,c=f.length;l0})}(),s.setFilters.nth=s.setFilters.eq,s.filters=s.pseudos,Y.attr=v.attr,v.find=Y,v.expr=Y.selectors,v.expr[":"]=v.expr.pseudos,v.unique=Y.uniqueSort,v.text=Y.getText,v.isXMLDoc=Y.isXML,v.contains=Y.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";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();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{ln=s.href}catch(Nn){ln=i.createElement("a"),ln.href="",ln=ln.href}cn=wn.exec(ln.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:ln,isLocal:dn.test(cn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=""+(n||T),l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,cn[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]==cn[1]&&a[2]==cn[2]&&(a[3]||(a[1]==="http:"?80:443))==(cn[3]||(cn[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(e){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i,s=this.createTween(e,t),o=zn.exec(t),u=s.cur(),a=+u||0,f=1;if(o){n=+o[2],r=o[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&a){a=v.css(s.elem,e,!0)||n||1;do i=f=f||".5",a/=f,v.style(s.elem,e,a+r),f=s.cur()/u;while(f!==1&&f!==i)}s.unit=r,s.start=a,s.end=o[1]?a+(o[1]+1)*n:n}return s}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window),function(e,t){function n(t,n){var i=t.nodeName.toLowerCase();if("area"===i){var s=t.parentNode,o=s.name,u;return!t.href||!o||s.nodeName.toLowerCase()!=="map"?!1:(u=e("img[usemap=#"+o+"]")[0],!!u&&r(u))}return(/input|select|textarea|button|object/.test(i)?!t.disabled:"a"==i?t.href||n:n)&&r(t)}function r(t){return!e(t).parents().andSelf().filter(function(){return e.curCSS(this,"visibility")==="hidden"||e.expr.filters.hidden(this)}).length}e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),e.fn.extend({propAttr:e.fn.prop||e.fn.attr,_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.curCSS(this,"position",1))&&/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.curCSS(t,"padding"+this,!0))||0,r&&(n-=parseFloat(e.curCSS(t,"border"+this+"Width",!0))||0),s&&(n-=parseFloat(e.curCSS(t,"margin"+this,!0))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return n(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var r=e.attr(t,"tabindex"),i=isNaN(r);return(i||r>=0)&&n(t,!i)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e.curCSS||(e.curCSS=e.css),e.extend(e.ui,{plugin:{add:function(t,n,r){var i=e.ui[t].prototype;for(var s in r)i.plugins[s]=i.plugins[s]||[],i.plugins[s].push([n,r[s]])},call:function(e,t,n){var r=e.plugins[t];if(!r||!e.element[0].parentNode)return;for(var i=0;i0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target==this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(n.iframeFix&&e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&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.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 a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.topu[3]?f-this.offset.click.topu[2]?l-this.offset.click.left=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s=l&&o<=c||u>=l&&u<=c||oc)&&(i>=a&&i<=f||s>=a&&s<=f||if);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").hover(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()},function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;n.after(this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n=this.helper,r=this.options,i={},s=this,o=this.originalMousePosition,u=this.axis,a=t.pageX-o.left||0,f=t.pageY-o.top||0,l=this._change[u];if(!l)return!1;var c=l.apply(this,[t,a,f]),h=e.browser.msie&&e.browser.version<7,p=this.sizeDiff;this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey)c=this._updateRatio(c,t);return c=this._respectSize(c,t),this._propagate("resize",t),n.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(c),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),ie.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r');var r=e.browser.msie&&e.browser.version<7,i=r?1:0,s=r?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+s,height:this.element.outerHeight()+s,position:"absolute",left:this.elementOffset.left-i+"px",top:this.elementOffset.top-i+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.extend(e.ui.resizable,{version:"1.8.23"}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-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",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}}(jQuery),function(e,t){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
    ")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.rightu||a.bottomi&&a.rights&&a.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){e.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget()[n?"addClass":"removeClass"]("ui-sortable-disabled")):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=this,o=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==s)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==s&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var u=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(u=!0)});if(!u)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options,s=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",t,s._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.ui.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.ui.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=r.placeholder.offset();r.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-r.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-r.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){var t=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("deactivate",null,t._uiHash(this)),this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",null,t._uiHash(this)),this.containers[n].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+fs&&t+le[this.floating?"width":"height"]?c:s0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=this,r=[],i=[],s=this._connectWith();if(s&&t)for(var o=s.length-1;o>=0;o--){var u=e(s[o]);for(var a=u.length-1;a>=0;a--){var f=e.data(u[a],this.widgetName);f&&f!=this&&!f.options.disabled&&i.push([e.isFunction(f.options.items)?f.options.items.call(f.element):e(f.options.items,f.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),f])}}i.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var o=i.length-1;o>=0;o--)i[o][0].each(function(){r.push(this)});return e(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");for(var t=0;t=0;o--){var u=e(s[o]);for(var a=u.length-1;a>=0;a--){var f=e.data(u[a],this.widgetName);f&&f!=this&&!f.options.disabled&&(i.push([e.isFunction(f.options.items)?f.options.items.call(f.element[0],t,{item:this.currentItem}):e(f.options.items,f.element),f]),this.containers.push(f))}}for(var o=i.length-1;o>=0;o--){var l=i[o][1],c=i[o][0];for(var a=0,h=c.length;a=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){var n=t||this,r=n.options;if(!r.placeholder||r.placeholder.constructor==String){var i=r.placeholder;r.placeholder={element:function(){var t=e(document.createElement(n.currentItem[0].nodeName)).addClass(i||n.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(t.style.visibility="hidden"),t},update:function(e,t){if(i&&!r.forcePlaceholderSize)return;t.height()||t.height(n.currentItem.innerHeight()-parseInt(n.currentItem.css("paddingTop")||0,10)-parseInt(n.currentItem.css("paddingBottom")||0,10)),t.width()||t.width(n.currentItem.innerWidth()-parseInt(n.currentItem.css("paddingLeft")||0,10)-parseInt(n.currentItem.css("paddingRight")||0,10))}}}n.placeholder=e(r.placeholder.element.call(n.element,n.currentItem)),n.currentItem.after(n.placeholder),r.placeholder.update(n,n.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.ui.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.ui.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else if(this.currentContainer!=this.containers[r]){var s=1e4,o=null,u=this.positionAbs[this.containers[r].floating?"left":"top"];for(var a=this.items.length-1;a>=0;a--){if(!e.ui.contains(this.containers[r].element[0],this.items[a].item[0]))continue;var f=this.containers[r].floating?this.items[a].item.offset().left:this.items[a].item.offset().top;Math.abs(f-u)0?"down":"up")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),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.currentItem.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.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),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=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_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&&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&&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);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.leftthis.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.topthis.containment[3]?u-this.offset.click.topthis.containment[2]?a-this.offset.click.left=0;s--)e.ui.contains(this.containers[s].element[0],this.currentItem[0])&&!n&&(r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.containers[s])),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.containers[s])))}for(var s=this.containers.length-1;s>=0;s--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[s])),this.containers[s].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[s])),this.containers[s].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var s=0;s").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i=document.activeElement;try{i.id}catch(s){i=document.body}return t.wrap(r),(t[0]===i||e.contains(t[0],i))&&e(i).focus(),r=t.parent(),t.css("position")=="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),r.css(n).show()},removeWrapper:function(t){var n,r=document.activeElement;return t.parent().is(".ui-effects-wrapper")?(n=t.parent().replaceWith(t),(t[0]===r||e.contains(t[0],r))&&e(r).focus(),n):t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(t,n,r,i){var s=l.apply(this,arguments),o={options:s[1],duration:s[2],callback:s[3]},u=o.options.mode,a=e.effects[t];return e.fx.off||!a?u?this[u](o.duration,o.callback):this.each(function(){o.callback&&o.callback.call(this)}):a.call(this,o)},_show:e.fn.show,show:function(e){if(c(e))return this._show.apply(this,arguments);var t=l.apply(this,arguments);return t[1].mode="show",this.effect.apply(this,t)},_hide:e.fn.hide,hide:function(e){if(c(e))return this._hide.apply(this,arguments);var t=l.apply(this,arguments);return t[1].mode="hide",this.effect.apply(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(c(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=l.apply(this,arguments);return n[1].mode="toggle",this.effect.apply(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}});var h={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){h[t]=function(t){return Math.pow(t,e+2)}}),e.extend(h,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(h,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:n(e*-2+2)/-2+1}})}(jQuery),function(e,t){e.effects.blind=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"hide"),s=t.options.direction||"vertical";e.effects.save(n,r),n.show();var u=e.effects.createWrapper(n).css({overflow:"hidden"}),a=s=="vertical"?"height":"width",f=s=="vertical"?u.height():u.width();i=="show"&&u.css(a,0);var l={};l[a]=i=="show"?f:0,u.animate(l,t.duration,t.options.easing,function(){i=="hide"&&n.hide(),e.effects.restore(n,r),e.effects.removeWrapper(n),t.callback&&t.callback.apply(n[0],arguments),n.dequeue()})})}}(jQuery),function(e,t){e.effects.bounce=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"effect"),s=t.options.direction||"up",u=t.options.distance||20,a=t.options.times||5,f=t.duration||250;/show|hide/.test(i)&&r.push("opacity"),e.effects.save(n,r),n.show(),e.effects.createWrapper(n);var l=s=="up"||s=="down"?"top":"left",c=s=="up"||s=="left"?"pos":"neg",u=t.options.distance||(l=="top"?n.outerHeight(!0)/3:n.outerWidth(!0)/3);i=="show"&&n.css("opacity",0).css(l,c=="pos"?-u:u),i=="hide"&&(u/=a*2),i!="hide"&&a--;if(i=="show"){var h={opacity:1};h[l]=(c=="pos"?"+=":"-=")+u,n.animate(h,f/2,t.options.easing),u/=2,a--}for(var p=0;p").css({position:"absolute",visibility:"visible",left:-l*(u/r),top:-f*(a/n)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:u/r,height:a/n,left:s.left+l*(u/r)+(t.options.mode=="show"?(l-Math.floor(r/2))*(u/r):0),top:s.top+f*(a/n)+(t.options.mode=="show"?(f-Math.floor(n/2))*(a/n):0),opacity:t.options.mode=="show"?0:1}).animate({left:s.left+l*(u/r)+(t.options.mode=="show"?0:(l-Math.floor(r/2))*(u/r)),top:s.top+f*(a/n)+(t.options.mode=="show"?0:(f-Math.floor(n/2))*(a/n)),opacity:t.options.mode=="show"?1:0},t.duration||500);setTimeout(function(){t.options.mode=="show"?i.css({visibility:"visible"}):i.css({visibility:"visible"}).hide(),t.callback&&t.callback.apply(i[0]),i.dequeue(),e("div.ui-effects-explode").remove()},t.duration||500)})}}(jQuery),function(e,t){e.effects.fade=function(t){return this.queue(function(){var n=e(this),r=e.effects.setMode(n,t.options.mode||"hide");n.animate({opacity:r},{queue:!1,duration:t.duration,easing:t.options.easing,complete:function(){t.callback&&t.callback.apply(this,arguments),n.dequeue()}})})}}(jQuery),function(e,t){e.effects.fold=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"hide"),s=t.options.size||15,u=!!t.options.horizFirst,a=t.duration?t.duration/2:e.fx.speeds._default/2;e.effects.save(n,r),n.show();var f=e.effects.createWrapper(n).css({overflow:"hidden"}),l=i=="show"!=u,c=l?["width","height"]:["height","width"],h=l?[f.width(),f.height()]:[f.height(),f.width()],p=/([0-9]+)%/.exec(s);p&&(s=parseInt(p[1],10)/100*h[i=="hide"?0:1]),i=="show"&&f.css(u?{height:0,width:s}:{height:s,width:0});var d={},v={};d[c[0]]=i=="show"?h[0]:s,v[c[1]]=i=="show"?h[1]:0,f.animate(d,a,t.options.easing).animate(v,a,t.options.easing,function(){i=="hide"&&n.hide(),e.effects.restore(n,r),e.effects.removeWrapper(n),t.callback&&t.callback.apply(n[0],arguments),n.dequeue()})})}}(jQuery),function(e,t){e.effects.highlight=function( +t){return this.queue(function(){var n=e(this),r=["backgroundImage","backgroundColor","opacity"],i=e.effects.setMode(n,t.options.mode||"show"),s={backgroundColor:n.css("backgroundColor")};i=="hide"&&(s.opacity=0),e.effects.save(n,r),n.show().css({backgroundImage:"none",backgroundColor:t.options.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.options.easing,complete:function(){i=="hide"&&n.hide(),e.effects.restore(n,r),i=="show"&&!e.support.opacity&&this.style.removeAttribute("filter"),t.callback&&t.callback.apply(this,arguments),n.dequeue()}})})}}(jQuery),function(e,t){e.effects.pulsate=function(t){return this.queue(function(){var n=e(this),r=e.effects.setMode(n,t.options.mode||"show"),i=(t.options.times||5)*2-1,s=t.duration?t.duration/2:e.fx.speeds._default/2,u=n.is(":visible"),a=0;u||(n.css("opacity",0).show(),a=1),(r=="hide"&&u||r=="show"&&!u)&&i--;for(var f=0;f').appendTo(document.body).addClass(t.options.className).css({top:u.top,left:u.left,height:n.innerHeight(),width:n.innerWidth(),position:"absolute"}).animate(s,t.duration,t.options.easing,function(){a.remove(),t.callback&&t.callback.apply(n[0],arguments),n.dequeue()})})}}(jQuery),function(e,t){e.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var t=this,n=t.options;t.running=0,t.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),t.headers=t.element.find(n.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(n.disabled)return;e(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(n.disabled)return;e(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(n.disabled)return;e(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(n.disabled)return;e(this).removeClass("ui-state-focus")}),t.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(n.navigation){var r=t.element.find("a").filter(n.navigationFilter).eq(0);if(r.length){var i=r.closest(".ui-accordion-header");i.length?t.active=i:t.active=r.closest(".ui-accordion-content").prev()}}t.active=t._findActive(t.active||n.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),t.active.next().addClass("ui-accordion-content-active"),t._createIcons(),t.resize(),t.element.attr("role","tablist"),t.headers.attr("role","tab").bind("keydown.accordion",function(e){return t._keydown(e)}).next().attr("role","tabpanel"),t.headers.not(t.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),t.active.length?t.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):t.headers.eq(0).attr("tabIndex",0),e.browser.safari||t.headers.find("a").attr("tabIndex",-1),n.event&&t.headers.bind(n.event.split(" ").join(".accordion ")+".accordion",function(e){t._clickHandler.call(t,e,this),e.preventDefault()})},_createIcons:function(){var t=this.options;t.icons&&(e("").addClass("ui-icon "+t.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(t.icons.header).toggleClass(t.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var t=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var n=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(t.autoHeight||t.fillHeight)&&n.css("height",""),e.Widget.prototype.destroy.call(this)},_setOption:function(t,n){e.Widget.prototype._setOption.apply(this,arguments),t=="active"&&this.activate(n),t=="icons"&&(this._destroyIcons(),n&&this._createIcons()),t=="disabled"&&this.headers.add(this.headers.next())[n?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(t){if(this.options.disabled||t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._clickHandler({target:t.target},t.target),t.preventDefault()}return s?(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),!1):!0},resize:function(){var t=this.options,n;if(t.fillSpace){if(e.browser.msie){var r=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}n=this.element.parent().height(),e.browser.msie&&this.element.parent().css("overflow",r),this.headers.each(function(){n-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")}else t.autoHeight&&(n=0,this.headers.next().each(function(){n=Math.max(n,e(this).height("").height())}).height(n));return this},activate:function(e){this.options.active=e;var t=this._findActive(e)[0];return this._clickHandler({target:t},t),this},_findActive:function(t){return t?typeof t=="number"?this.headers.filter(":eq("+t+")"):this.headers.not(this.headers.not(t)):t===!1?e([]):this.headers.filter(":eq(0)")},_clickHandler:function(t,n){var r=this.options;if(r.disabled)return;if(!t.target){if(!r.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(r.icons.headerSelected).addClass(r.icons.header),this.active.next().addClass("ui-accordion-content-active");var i=this.active.next(),s={options:r,newHeader:e([]),oldHeader:r.active,newContent:e([]),oldContent:i},o=this.active=e([]);this._toggle(o,i,s);return}var u=e(t.currentTarget||n),a=u[0]===this.active[0];r.active=r.collapsible&&a?!1:this.headers.index(u);if(this.running||!r.collapsible&&a)return;var f=this.active,o=u.next(),i=this.active.next(),s={options:r,newHeader:a&&r.collapsible?e([]):u,oldHeader:this.active,newContent:a&&r.collapsible?e([]):o,oldContent:i},l=this.headers.index(this.active[0])>this.headers.index(u[0]);this.active=a?e([]):u,this._toggle(o,i,s,a,l),f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(r.icons.headerSelected).addClass(r.icons.header),a||(u.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(r.icons.header).addClass(r.icons.headerSelected),u.next().addClass("ui-accordion-content-active"));return},_toggle:function(t,n,r,i,s){var o=this,u=o.options;o.toShow=t,o.toHide=n,o.data=r;var a=function(){if(!o)return;return o._completed.apply(o,arguments)};o._trigger("changestart",null,o.data),o.running=n.size()===0?t.size():n.size();if(u.animated){var f={};u.collapsible&&i?f={toShow:e([]),toHide:n,complete:a,down:s,autoHeight:u.autoHeight||u.fillSpace}:f={toShow:t,toHide:n,complete:a,down:s,autoHeight:u.autoHeight||u.fillSpace},u.proxied||(u.proxied=u.animated),u.proxiedDuration||(u.proxiedDuration=u.duration),u.animated=e.isFunction(u.proxied)?u.proxied(f):u.proxied,u.duration=e.isFunction(u.proxiedDuration)?u.proxiedDuration(f):u.proxiedDuration;var l=e.ui.accordion.animations,c=u.duration,h=u.animated;h&&!l[h]&&!e.easing[h]&&(h="slide"),l[h]||(l[h]=function(e){this.slide(e,{easing:h,duration:c||700})}),l[h](f)}else u.collapsible&&i?t.toggle():(n.hide(),t.show()),a(!0);n.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),t.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(e){this.running=e?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),e.extend(e.ui.accordion,{version:"1.8.23",animations:{slide:function(t,n){t=e.extend({easing:"swing",duration:300},t,n);if(!t.toHide.size()){t.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},t);return}if(!t.toShow.size()){t.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},t);return}var r=t.toShow.css("overflow"),i=0,s={},o={},u=["height","paddingTop","paddingBottom"],a,f=t.toShow;a=f[0].style.width,f.width(f.parent().width()-parseFloat(f.css("paddingLeft"))-parseFloat(f.css("paddingRight"))-(parseFloat(f.css("borderLeftWidth"))||0)-(parseFloat(f.css("borderRightWidth"))||0)),e.each(u,function(n,r){o[r]="hide";var i=(""+e.css(t.toShow[0],r)).match(/^([\d+-.]+)(.*)$/);s[r]={value:i[1],unit:i[2]||"px"}}),t.toShow.css({height:0,overflow:"hidden"}).show(),t.toHide.filter(":hidden").each(t.complete).end().filter(":visible").animate(o,{step:function(e,n){n.prop=="height"&&(i=n.end-n.start===0?0:(n.now-n.start)/(n.end-n.start)),t.toShow[0].style[n.prop]=i*s[n.prop].value+s[n.prop].unit},duration:t.duration,easing:t.easing,complete:function(){t.autoHeight||t.toShow.css("height",""),t.toShow.css({width:a,overflow:r}),t.complete()}})},bounceslide:function(e){this.slide(e,{easing:e.down?"easeOutBounce":"swing",duration:e.down?1e3:200})}}})}(jQuery),function(e,t){var n=0;e.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var t=this,n=this.element[0].ownerDocument,r;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(n){if(t.options.disabled||t.element.propAttr("readOnly"))return;r=!1;var i=e.ui.keyCode;switch(n.keyCode){case i.PAGE_UP:t._move("previousPage",n);break;case i.PAGE_DOWN:t._move("nextPage",n);break;case i.UP:t._keyEvent("previous",n);break;case i.DOWN:t._keyEvent("next",n);break;case i.ENTER:case i.NUMPAD_ENTER:t.menu.active&&(r=!0,n.preventDefault());case i.TAB:if(!t.menu.active)return;t.menu.select(n);break;case i.ESCAPE:t.element.val(t.term),t.close(n);break;default:clearTimeout(t.searching),t.searching=setTimeout(function(){t.term!=t.element.val()&&(t.selectedItem=null,t.search(null,n))},t.options.delay)}}).bind("keypress.autocomplete",function(e){r&&(r=!1,e.preventDefault())}).bind("focus.autocomplete",function(){if(t.options.disabled)return;t.selectedItem=null,t.previous=t.element.val()}).bind("blur.autocomplete",function(e){if(t.options.disabled)return;clearTimeout(t.searching),t.closing=setTimeout(function(){t.close(e),t._change(e)},150)}),this._initSource(),this.menu=e("
      ").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",n)[0]).mousedown(function(n){var r=t.menu.element[0];e(n.target).closest(".ui-menu-item").length||setTimeout(function(){e(document).one("mousedown",function(n){n.target!==t.element[0]&&n.target!==r&&!e.ui.contains(r,n.target)&&t.close()})},1),setTimeout(function(){clearTimeout(t.closing)},13)}).menu({focus:function(e,n){var r=n.item.data("item.autocomplete");!1!==t._trigger("focus",e,{item:r})&&/^key/.test(e.originalEvent.type)&&t.element.val(r.value)},selected:function(e,r){var i=r.item.data("item.autocomplete"),s=t.previous;t.element[0]!==n.activeElement&&(t.element.focus(),t.previous=s,setTimeout(function(){t.previous=s,t.selectedItem=i},1)),!1!==t._trigger("select",e,{item:i})&&t.element.val(i.value),t.term=t.element.val(),t.close(e),t.selectedItem=i},blur:function(e,n){t.menu.element.is(":visible")&&t.element.val()!==t.term&&t.element.val(t.term)}}).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").data("item.autocomplete",n).append(e("
      ").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("tabindex",-1).mouseenter(function(n){t.activate(n,e(this).parent())}).mouseleave(function(){t.deactivate()})},activate:function(e,t){this.deactivate();if(this.hasScroll()){var n=t.offset().top-this.element.offset().top,r=this.element.scrollTop(),i=this.element.height();n<0?this.element.scrollTop(r+n):n>=i&&this.element.scrollTop(r+n-i+t.height())}this.active=t.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",e,{item:t})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,t,n){if(!this.active){this.activate(n,this.element.children(t));return}var r=this.active[e+"All"](".ui-menu-item").eq(0);r.length?this.activate(n,r):this.activate(n,this.element.children(t))},nextPage:function(t){if(this.hasScroll()){if(!this.active||this.last()){this.activate(t,this.element.children(".ui-menu-item:first"));return}var n=this.active.offset().top,r=this.element.height(),i=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-n-r+e(this).height();return t<10&&t>-10});i.length||(i=this.element.children(".ui-menu-item:last")),this.activate(t,i)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(t){if(this.hasScroll()){if(!this.active||this.first()){this.activate(t,this.element.children(".ui-menu-item:last"));return}var n=this.active.offset().top,r=this.element.height(),i=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-n+r-e(this).height();return t<10&&t>-10});i.length||(i=this.element.children(".ui-menu-item:first")),this.activate(t,i)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend(""),r.secondary&&t.append(""),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",n))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,n){t==="disabled"&&this.buttons.button("option",t,n),e.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),e.Widget.prototype.destroy.call(this)}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly +:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('
      '))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.bind("mouseout",function(e){var n=$(e.target).closest(t);if(!n.length)return;n.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(n){var r=$(n.target).closest(t);if($.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||!r.length)return;r.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),r.addClass("ui-state-hover"),r.hasClass("ui-datepicker-prev")&&r.addClass("ui-datepicker-prev-hover"),r.hasClass("ui-datepicker-next")&&r.addClass("ui-datepicker-next-hover")})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}function isArray(e){return e&&($.browser.safari&&typeof e=="object"&&e.length||e.constructor&&e.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.23"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('
      ')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$(''+n+""),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('').addClass(this._triggerClass).html(o==""?s:$("").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;rt&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i}),i&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[o]?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){var t=this;t.maxRows=4;var n=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var r=e.dpDiv.find("iframe.ui-datepicker-cover");!r.length||r.css({left:-n[0],top:-n[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i=this._getNumberOfMonths(e),s=i[1],o=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&e.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",o*s+"em"),e.dpDiv[(i[0]!=1||i[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var u=e.yearshtml;setTimeout(function(){u===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),u=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&$.effects[n]?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("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-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+112?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&vv)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?''+m+"":i?"":''+m+"",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?''+y+"":i?"":''+y+"",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=e.inline?"":'",x=r?'
      '+(n?S:"")+(this._isInRange(e,E)?'":"")+(n?"":S)+"
      ":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='
      '+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'
      '+"";var z=N?'":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="=5?' class="ui-datepicker-week-end"':"")+">"+''+L[X]+""}U+=z+"";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y";var Z=N?'":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&Gh;Z+='",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+""}p++,p>11&&(p=0,d++),U+="
      '+this._get(e,"weekHeader")+"
      '+this._get(e,"calculateWeek")(G)+""+(tt&&!_?" ":nt?''+G.getDate()+"":''+G.getDate()+"")+"
      "+(f?""+(o[0]>0&&I==o[1]-1?'
      ':""):""),F+=U}B+=F}return B+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!e.inline?'':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='
      ',h="";if(s||!a)h+=''+o[t]+"";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+=''+n+"";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear +(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="
      ",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&tr?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.23",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var t=this,r=t.options,i=r.title||" ",s=e.ui.dialog.getTitleId(t.element),o=(t.uiDialog=e("
      ")).appendTo(document.body).hide().addClass(n+r.dialogClass).css({zIndex:r.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).attr({role:"dialog","aria-labelledby":s}).mousedown(function(e){t.moveToTop(!1,e)}),u=t.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o),a=(t.uiDialogTitlebar=e("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(o),f=e('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){f.addClass("ui-state-hover")},function(){f.removeClass("ui-state-hover")}).focus(function(){f.addClass("ui-state-focus")}).blur(function(){f.removeClass("ui-state-focus")}).click(function(e){return t.close(e),!1}).appendTo(a),l=(t.uiDialogTitlebarCloseText=e("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(f),c=e("").addClass("ui-dialog-title").attr("id",s).html(i).prependTo(a);e.isFunction(r.beforeclose)&&!e.isFunction(r.beforeClose)&&(r.beforeClose=r.beforeclose),a.find("*").add(a).disableSelection(),r.draggable&&e.fn.draggable&&t._makeDraggable(),r.resizable&&e.fn.resizable&&t._makeResizable(),t._createButtons(r.buttons),t._isOpen=!1,e.fn.bgiframe&&o.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var e=this;return e.overlay&&e.overlay.destroy(),e.uiDialog.hide(),e.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),e.uiDialog.remove(),e.originalTitle&&e.element.attr("title",e.originalTitle),e},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!1===n._trigger("beforeClose",t))return;return n.overlay&&n.overlay.destroy(),n.uiDialog.unbind("keypress.ui-dialog"),n._isOpen=!1,n.options.hide?n.uiDialog.hide(n.options.hide,function(){n._trigger("close",t)}):(n.uiDialog.hide(),n._trigger("close",t)),e.ui.dialog.overlay.resize(),n.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),n},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this,i=r.options,s;return i.modal&&!t||!i.stack&&!i.modal?r._trigger("focus",n):(i.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=i.zIndex),r.overlay&&(e.ui.dialog.maxZ+=1,r.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ)),s={scrollTop:r.element.scrollTop(),scrollLeft:r.element.scrollLeft()},e.ui.dialog.maxZ+=1,r.uiDialog.css("z-index",e.ui.dialog.maxZ),r.element.attr(s),r._trigger("focus",n),r)},open:function(){if(this._isOpen)return;var t=this,n=t.options,r=t.uiDialog;return t.overlay=n.modal?new e.ui.dialog.overlay(t):null,t._size(),t._position(n.position),r.show(n.show),t.moveToTop(!0),n.modal&&r.bind("keydown.ui-dialog",function(t){if(t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",this),r=n.filter(":first"),i=n.filter(":last");if(t.target===i[0]&&!t.shiftKey)return r.focus(1),!1;if(t.target===r[0]&&t.shiftKey)return i.focus(1),!1}),e(t.element.find(":tabbable").get().concat(r.find(".ui-dialog-buttonpane :tabbable").get().concat(r.get()))).eq(0).focus(),t._isOpen=!0,t._trigger("open"),t},_createButtons:function(t){var n=this,r=!1,i=e("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),s=e("
      ").addClass("ui-dialog-buttonset").appendTo(i);n.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r&&(e.each(t,function(t,r){r=e.isFunction(r)?{click:r,text:t}:r;var i=e('').click(function(){r.click.apply(n.element[0],arguments)}).appendTo(s);e.each(r,function(e,t){if(e==="click")return;e in i?i[e](t):i.attr(e,t)}),e.fn.button&&i.button()}),i.appendTo(n.uiDialog))},_makeDraggable:function(){function s(e){return{position:e.position,offset:e.offset}}var t=this,n=t.options,r=e(document),i;t.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,o){i=n.height==="auto"?"auto":e(this).height(),e(this).height(e(this).height()).addClass("ui-dialog-dragging"),t._trigger("dragStart",r,s(o))},drag:function(e,n){t._trigger("drag",e,s(n))},stop:function(o,u){n.position=[u.position.left-r.scrollLeft(),u.position.top-r.scrollTop()],e(this).removeClass("ui-dialog-dragging").height(i),t._trigger("dragStop",o,s(u)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=r.options,s=r.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";r.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:r.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:r._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n.join(" "),at:n.join(" "),offset:r.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(e.extend({of:window},t)),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i=this,s=i.uiDialog;switch(t){case"beforeclose":t="beforeClose";break;case"buttons":i._createButtons(r);break;case"closeText":i.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":s.removeClass(i.options.dialogClass).addClass(n+r);break;case"disabled":r?s.addClass("ui-dialog-disabled"):s.removeClass("ui-dialog-disabled");break;case"draggable":var o=s.is(":data(draggable)");o&&!r&&s.draggable("destroy"),!o&&r&&i._makeDraggable();break;case"position":i._position(r);break;case"resizable":var u=s.is(":data(resizable)");u&&!r&&s.resizable("destroy"),u&&typeof r=="string"&&s.resizable("option","handles",r),!u&&r!==!1&&i._makeResizable(r);break;case"title":e(".ui-dialog-title",i.uiDialogTitlebar).html(""+(r||" "))}e.Widget.prototype._setOption.apply(i,arguments)},_size:function(){var t=this.options,n,r,i=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),t.minWidth>t.width&&(t.width=t.minWidth),n=this.uiDialog.css({height:"auto",width:t.width}).height(),r=Math.max(0,t.minHeight-n);if(t.height==="auto")if(e.support.minHeight)this.element.css({minHeight:r,height:"auto"});else{this.uiDialog.show();var s=this.element.css("height","auto").height();i||this.uiDialog.hide(),this.element.height(Math.max(s,r))}else this.element.height(Math.max(t.height-n,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{version:"1.8.23",uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances);n!=-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.remove();var r=0;e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.browser.msie&&e.browser.version<7?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t0?t.left-i:Math.max(t.left-n.collisionPosition.left,t.left)},top:function(t,n){var r=e(window),i=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop();t.top=i>0?t.top-i:Math.max(t.top-n.collisionPosition.top,t.top)}},flip:{left:function(t,n){if(n.at[0]===i)return;var r=e(window),s=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft(),o=n.my[0]==="left"?-n.elemWidth:n.my[0]==="right"?n.elemWidth:0,u=n.at[0]==="left"?n.targetWidth:-n.targetWidth,a=-2*n.offset[0];t.left+=n.collisionPosition.left<0?o+u+a:s>0?o+u+a:0},top:function(t,n){if(n.at[1]===i)return;var r=e(window),s=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop(),o=n.my[1]==="top"?-n.elemHeight:n.my[1]==="bottom"?n.elemHeight:0,u=n.at[1]==="top"?n.targetHeight:-n.targetHeight,a=-2*n.offset[1];t.top+=n.collisionPosition.top<0?o+u+a:s>0?o+u+a:0}}},e.offset.setOffset||(e.offset.setOffset=function(t,n){/static/.test(e.curCSS(t,"position"))&&(t.style.position="relative");var r=e(t),i=r.offset(),s=parseInt(e.curCSS(t,"top",!0),10)||0,o=parseInt(e.curCSS(t,"left",!0),10)||0,u={top:n.top-i.top+s,left:n.left-i.left+o};"using"in n?n.using.call(t,u):r.css(u)},e.fn.offset=function(t){var n=this[0];return!n||!n.ownerDocument?null:t?e.isFunction(t)?this.each(function(n){e(this).offset(t.call(this,n,e(this).offset()))}):this.each(function(){e.offset.setOffset(this,t)}):u.call(this)}),e.curCSS||(e.curCSS=e.css),function(){var t=document.getElementsByTagName("body")[0],n=document.createElement("div"),r,i,o,u,a;r=document.createElement(t?"div":"body"),o={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},t&&e.extend(o,{position:"absolute",left:"-1000px",top:"-1000px"});for(var f in o)r.style[f]=o[f];r.appendChild(n),i=t||document.documentElement,i.insertBefore(r,i.firstChild),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("
      ").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="",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("
      ").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;an&&(s=n,o=e(this),a=t)}),n.range===!0&&this.values(1)===n.min&&(a+=1,o=e(this.handles[a])),f=this._start(t,a),f===!1?!1:(this._mouseSliding=!0,u._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),c=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=c?{left:0,top:0}:{left:t.pageX-l.left-o.width()/2,top:t.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,i),this._animateOff=!0,!0))},_mouseStart:function(e){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t=this.options.range,n=this.options,r=this,i=this._animateOff?!1:n.animate,s,o={},u,a,f,l;this.options.values&&this.options.values.length?this.handles.each(function(t,a){s=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,o[r.orientation==="horizontal"?"left":"bottom"]=s+"%",e(this).stop(1,1)[i?"animate":"css"](o,n.animate),r.options.range===!0&&(r.orientation==="horizontal"?(t===0&&r.range.stop(1,1)[i?"animate":"css"]({left:s+"%"},n.animate),t===1&&r.range[i?"animate":"css"]({width:s-u+"%"},{queue:!1,duration:n.animate})):(t===0&&r.range.stop(1,1)[i?"animate":"css"]({bottom:s+"%"},n.animate),t===1&&r.range[i?"animate":"css"]({height:s-u+"%"},{queue:!1,duration:n.animate}))),u=s}):(a=this.value(),f=this._valueMin(),l=this._valueMax(),s=l!==f?(a-f)/(l-f)*100:0,o[r.orientation==="horizontal"?"left":"bottom"]=s+"%",this.handle.stop(1,1)[i?"animate":"css"](o,n.animate),t==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[i?"animate":"css"]({width:s+"%"},n.animate),t==="max"&&this.orientation==="horizontal"&&this.range[i?"animate":"css"]({width:100-s+"%"},{queue:!1,duration:n.animate}),t==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[i?"animate":"css"]({height:s+"%"},n.animate),t==="max"&&this.orientation==="vertical"&&this.range[i?"animate":"css"]({height:100-s+"%"},{queue:!1,duration:n.animate}))}}),e.extend(e.ui.slider,{version:"1.8.23"})}(jQuery),function(e,t){function i(){return++n}function s(){return++r}var n=0,r=0;e.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(!0)},_setOption:function(e,t){if(e=="selected"){if(this.options.collapsible&&t==this.options.selected)return;this.select(t)}else this.options[e]=t,this._tabify()},_tabId:function(e){return e.title&&e.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+i()},_sanitizeSelector:function(e){return e.replace(/:/g,"\\:")},_cookie:function(){var t=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+s());return e.cookie.apply(null,[t].concat(e.makeArray(arguments)))},_ui:function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var t=e(this);t.html(t.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){function h(t,n){t.css("display",""),!e.support.opacity&&n.opacity&&t[0].style.removeAttribute("filter")}var r=this,i=this.options,s=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=e(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return e("a",this)[0]}),this.panels=e([]),this.anchors.each(function(t,n){var o=e(n).attr("href"),u=o.split("#")[0],a;u&&(u===location.toString().split("#")[0]||(a=e("base")[0])&&u===a.href)&&(o=n.hash,n.href=o);if(s.test(o))r.panels=r.panels.add(r.element.find(r._sanitizeSelector(o)));else if(o&&o!=="#"){e.data(n,"href.tabs",o),e.data(n,"load.tabs",o.replace(/#.*$/,""));var f=r._tabId(n);n.href="#"+f;var l=r.element.find("#"+f);l.length||(l=e(i.panelTemplate).attr("id",f).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(r.panels[t-1]||r.list),l.data("destroy.tabs",!0)),r.panels=r.panels.add(l)}else i.disabled.push(t)}),n?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),i.selected===t?(location.hash&&this.anchors.each(function(e,t){if(t.hash==location.hash)return i.selected=e,!1}),typeof i.selected!="number"&&i.cookie&&(i.selected=parseInt(r._cookie(),10)),typeof i.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(i.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),i.selected=i.selected||(this.lis.length?0:-1)):i.selected===null&&(i.selected=-1),i.selected=i.selected>=0&&this.anchors[i.selected]||i.selected<0?i.selected:0,i.disabled=e.unique(i.disabled.concat(e.map(this.lis.filter(".ui-state-disabled"),function(e,t){return r.lis.index(e)}))).sort(),e.inArray(i.selected +,i.disabled)!=-1&&i.disabled.splice(e.inArray(i.selected,i.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),i.selected>=0&&this.anchors.length&&(r.element.find(r._sanitizeSelector(r.anchors[i.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(i.selected).addClass("ui-tabs-selected ui-state-active"),r.element.queue("tabs",function(){r._trigger("show",null,r._ui(r.anchors[i.selected],r.element.find(r._sanitizeSelector(r.anchors[i.selected].hash))[0]))}),this.load(i.selected)),e(window).bind("unload",function(){r.lis.add(r.anchors).unbind(".tabs"),r.lis=r.anchors=r.panels=null})):i.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[i.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),i.cookie&&this._cookie(i.selected,i.cookie);for(var o=0,u;u=this.lis[o];o++)e(u)[e.inArray(o,i.disabled)!=-1&&!e(u).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");i.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(i.event!=="mouseover"){var a=function(e,t){t.is(":not(.ui-state-disabled)")&&t.addClass("ui-state-"+e)},f=function(e,t){t.removeClass("ui-state-"+e)};this.lis.bind("mouseover.tabs",function(){a("hover",e(this))}),this.lis.bind("mouseout.tabs",function(){f("hover",e(this))}),this.anchors.bind("focus.tabs",function(){a("focus",e(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){f("focus",e(this).closest("li"))})}var l,c;i.fx&&(e.isArray(i.fx)?(l=i.fx[0],c=i.fx[1]):l=c=i.fx);var p=c?function(t,n){e(t).closest("li").addClass("ui-tabs-selected ui-state-active"),n.hide().removeClass("ui-tabs-hide").animate(c,c.duration||"normal",function(){h(n,c),r._trigger("show",null,r._ui(t,n[0]))})}:function(t,n){e(t).closest("li").addClass("ui-tabs-selected ui-state-active"),n.removeClass("ui-tabs-hide"),r._trigger("show",null,r._ui(t,n[0]))},d=l?function(e,t){t.animate(l,l.duration||"normal",function(){r.lis.removeClass("ui-tabs-selected ui-state-active"),t.addClass("ui-tabs-hide"),h(t,l),r.element.dequeue("tabs")})}:function(e,t,n){r.lis.removeClass("ui-tabs-selected ui-state-active"),t.addClass("ui-tabs-hide"),r.element.dequeue("tabs")};this.anchors.bind(i.event+".tabs",function(){var t=this,n=e(t).closest("li"),s=r.panels.filter(":not(.ui-tabs-hide)"),o=r.element.find(r._sanitizeSelector(t.hash));if(n.hasClass("ui-tabs-selected")&&!i.collapsible||n.hasClass("ui-state-disabled")||n.hasClass("ui-state-processing")||r.panels.filter(":animated").length||r._trigger("select",null,r._ui(this,o[0]))===!1)return this.blur(),!1;i.selected=r.anchors.index(this),r.abort();if(i.collapsible){if(n.hasClass("ui-tabs-selected"))return i.selected=-1,i.cookie&&r._cookie(i.selected,i.cookie),r.element.queue("tabs",function(){d(t,s)}).dequeue("tabs"),this.blur(),!1;if(!s.length)return i.cookie&&r._cookie(i.selected,i.cookie),r.element.queue("tabs",function(){p(t,o)}),r.load(r.anchors.index(this)),this.blur(),!1}i.cookie&&r._cookie(i.selected,i.cookie);if(!o.length)throw"jQuery UI Tabs: Mismatching fragment identifier.";s.length&&r.element.queue("tabs",function(){d(t,s)}),r.element.queue("tabs",function(){p(t,o)}),r.load(r.anchors.index(this)),e.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},destroy:function(){var t=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var t=e.data(this,"href.tabs");t&&(this.href=t);var n=e(this).unbind(".tabs");e.each(["href","load","cache"],function(e,t){n.removeData(t+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){e.data(this,"destroy.tabs")?e(this).remove():e(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),t.cookie&&this._cookie(null,t.cookie),this},add:function(n,r,i){i===t&&(i=this.anchors.length);var s=this,o=this.options,u=e(o.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),a=n.indexOf("#")?this._tabId(e("a",u)[0]):n.replace("#","");u.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var f=s.element.find("#"+a);return f.length||(f=e(o.panelTemplate).attr("id",a).data("destroy.tabs",!0)),f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),i>=this.lis.length?(u.appendTo(this.list),f.appendTo(this.list[0].parentNode)):(u.insertBefore(this.lis[i]),f.insertBefore(this.panels[i])),o.disabled=e.map(o.disabled,function(e,t){return e>=i?++e:e}),this._tabify(),this.anchors.length==1&&(o.selected=0,u.addClass("ui-tabs-selected ui-state-active"),f.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){s._trigger("show",null,s._ui(s.anchors[0],s.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.lis.eq(t).remove(),i=this.panels.eq(t).remove();return r.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(t+(t+1=t?--e:e}),this._tabify(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this},enable:function(t){t=this._getIndex(t);var n=this.options;if(e.inArray(t,n.disabled)==-1)return;return this.lis.eq(t).removeClass("ui-state-disabled"),n.disabled=e.grep(n.disabled,function(e,n){return e!=t}),this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t])),this},disable:function(e){e=this._getIndex(e);var t=this,n=this.options;return e!=n.selected&&(this.lis.eq(e).addClass("ui-state-disabled"),n.disabled.push(e),n.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))),this},select:function(e){e=this._getIndex(e);if(e==-1){if(!this.options.collapsible||this.options.selected==-1)return this;e=this.options.selected}return this.anchors.eq(e).trigger(this.options.event+".tabs"),this},load:function(t){t=this._getIndex(t);var n=this,r=this.options,i=this.anchors.eq(t)[0],s=e.data(i,"load.tabs");this.abort();if(!s||this.element.queue("tabs").length!==0&&e.data(i,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(t).addClass("ui-state-processing");if(r.spinner){var o=e("span",i);o.data("label.tabs",o.html()).html(r.spinner)}return this.xhr=e.ajax(e.extend({},r.ajaxOptions,{url:s,success:function(s,o){n.element.find(n._sanitizeSelector(i.hash)).html(s),n._cleanup(),r.cache&&e.data(i,"cache.tabs",!0),n._trigger("load",null,n._ui(n.anchors[t],n.panels[t]));try{r.ajaxOptions.success(s,o)}catch(u){}},error:function(e,s,o){n._cleanup(),n._trigger("load",null,n._ui(n.anchors[t],n.panels[t]));try{r.ajaxOptions.error(e,s,t,i)}catch(o){}}})),n.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(e,t){return this.anchors.eq(e).removeData("cache.tabs").data("load.tabs",t),this},length:function(){return this.anchors.length}}),e.extend(e.ui.tabs,{version:"1.8.23"}),e.extend(e.ui.tabs.prototype,{rotation:null,rotate:function(e,t){var n=this,r=this.options,i=n._rotate||(n._rotate=function(t){clearTimeout(n.rotation),n.rotation=setTimeout(function(){var e=r.selected;n.select(++e'),r=e(r),e("body").append(r),i()},e.fn.purr=function(t){return t=t||{},t.fadeInSpeed=t.fadeInSpeed||500,t.fadeOutSpeed=t.fadeOutSpeed||500,t.removeTimer=t.removeTimer||4e3,t.isSticky=t.isSticky||!1,t.usingTransparentPNG=t.usingTransparentPNG||!1,this.each(function(){new e.purr(this,t)}),this}}(jQuery),function(e){function t(t,n,r,i){var s=t.text().split(n),o="";s.length&&(e(s).each(function(e,t){o+=''+t+""+i}),t.empty().append(o))}var n={init:function(){return this.each(function(){t(e(this),"","char","")})},words:function(){return this.each(function(){t(e(this)," ","word"," ")})},lines:function(){return this.each(function(){var n="eefec303079ad17405c889e092e105b0";t(e(this).children("br").replaceWith(n).end(),n,"line","")})}};e.fn.lettering=function(t){return t&&n[t]?n[t].apply(this,[].slice.call(arguments,1)):t==="letters"||!t?n.init.apply(this,[].slice.call(arguments,0)):(e.error("Method "+t+" does not exist on jQuery.lettering"),this)}}(jQuery),function(e){"use strict";function t(t){return/In/.test(t)||e.inArray(t,e.fn.textillate.defaults.inEffects)>=0}function n(t){return/Out/.test(t)||e.inArray(t,e.fn.textillate.defaults.outEffects)>=0}function r(t){var n=t.attributes||[],r={};return n.length?(e.each(n,function(e,t){/^data-in-*/.test(t.nodeName)?(r.in=r.in||{},r.in[t.nodeName.replace(/data-in-/,"")]=t.nodeValue):/^data-out-*/.test(t.nodeName)?(r.out=r.out||{},r.out[t.nodeName.replace(/data-out-/,"")]=t.nodeValue):/^data-*/.test(t.nodeName)&&(r[t.nodeName]=t.nodeValue)}),r):r}function i(e){for(var t,n,r=e.length;r;t=parseInt(Math.random()*r),n=e[--r],e[r]=e[t],e[t]=n);return e}function s(e,t,n){e.addClass("animated "+t).css("visibility","visible").show(),e.one("animationend webkitAnimationEnd oAnimationEnd",function(){e.removeClass("animated "+t),n&&n()})}function o(r,o,u){var a=this,f=r.length;if(!f){u&&u();return}o.shuffle&&(r=i(r)),o.reverse&&(r=r.toArray().reverse()),e.each(r,function(r,i){function l(){t(o.effect)?a.css("visibility","visible"):n(o.effect)&&a.css("visibility","hidden"),f-=1,!f&&u&&u()}var a=e(i),c=o.sync?o.delay:o.delay*r*o.delayScale;a.text()?setTimeout(function(){s(a,o.effect,l)},c):l()})}var u=function(i,s){var u=this,a=e(i);u.init=function(){u.$texts=a.find(s.selector),u.$texts.length||(u.$texts=e('
      • '+a.html()+"
      "),a.html(u.$texts)),u.$texts.hide(),u.$current=e("").text(u.$texts.find(":first-child").html()).prependTo(a),t(s.effect)?u.$current.css("visibility","hidden"):n(s.effect)&&u.$current.css("visibility","visible"),u.setOptions(s),setTimeout(function(){u.options.autoStart&&u.start()},u.options.initialDelay)},u.setOptions=function(e){u.options=e},u.triggerEvent=function(t){var n=e.Event(t+".tlt",{data:u});return a.trigger(n),n},u.in=function(i,s){i=i||0;var a=u.$texts.find(":nth-child("+(i+1)+")"),f=e.extend({},u.options,r(a)),l;u.triggerEvent("inAnimationBegin"),u.$current.text(a.html()).lettering("words"),u.$current.find('[class^="word"]').css({display:"inline-block","-webkit-transform":"translate3d(0,0,0)","-moz-transform":"translate3d(0,0,0)","-o-transform":"translate3d(0,0,0)",transform:"translate3d(0,0,0)"}).each(function(){e(this).lettering()}),l=u.$current.find('[class^="char"]').css("display","inline-block"),t(f.in.effect)?l.css("visibility","hidden"):n(f.in.effect)&&l.css("visibility","visible"),u.currentIndex=i,o(l,f.in,function(){u.triggerEvent("inAnimationEnd"),f.in.callback&&f.in.callback(),s&&s(u)})},u.out=function(t){var n=u.$texts.find(":nth-child("+(u.currentIndex+1)+")"),i=u.$current.find('[class^="char"]'),s=e.extend({},u.options,r(n));u.triggerEvent("outAnimationBegin"),o(i,s.out,function(){u.triggerEvent("outAnimationEnd"),s.out.callback&&s.out.callback(),t&&t(u)})},u.start=function(e){u.triggerEvent("start"),function t(e){u.in(e,function(){var n=u.$texts.children().length;e+=1,!u.options.loop&&e>=n?(u.options.callback&&u.options.callback(),u.triggerEvent("end")):(e%=n,setTimeout(function(){u.out(function(){t(e)})},u.options.minDisplayTime))})}(e||0)},u.init()};e.fn.textillate=function(t,n){return this.each(function(){var i=e(this),s=i.data("textillate"),o=e.extend(!0,{},e.fn.textillate.defaults,r(this),typeof t=="object"&&t);s?typeof t=="string"?s[t].apply(s,[].concat(n)):s.setOptions.call(s,o):i.data("textillate",s=new u(this,o))})},e.fn.textillate.defaults={selector:".texts",loop:!1,minDisplayTime:2e3,initialDelay:0,"in":{effect:"fadeInLeftBig",delayScale:1.5,delay:50,sync:!1,reverse:!1,shuffle:!1,callback:function(){}},out:{effect:"hinge",delayScale:1.5,delay:50,sync:!1,reverse:!1,shuffle:!1,callback:function(){}},autoStart:!0,inEffects:[],outEffects:["hinge"],callback:function(){}}}(jQuery),function(e){"use strict";var t,n,r;e.extend({roundaboutShapes:{def:"lazySusan",lazySusan:function(e,t,n){return{x:Math.sin(e+t),y:Math.sin(e+3*Math.PI/2+t)/8*n,z:(Math.cos(e+t)+1)/2,scale:Math.sin(e+Math.PI/2+t)/2+.5}}}}),t={bearing:0,tilt:0,minZ:100,maxZ:280,minOpacity:.4,maxOpacity:1,minScale:.4,maxScale:1,duration:600,btnNext:null,btnNextCallback:function(){},btnPrev:null,btnPrevCallback:function(){},btnToggleAutoplay:null,btnStartAutoplay:null,btnStopAutoplay:null,easing:"swing",clickToFocus:!0,clickToFocusCallback:function(){},focusBearing:0,shape:"lazySusan",debug:!1,childSelector:"li",startingChild:null,reflect:!1,floatComparisonThreshold:.001,autoplay:!1,autoplayDuration:1e3,autoplayPauseOnHover:!1,autoplayCallback:function(){},autoplayInitialDelay:0,enableDrag:!1,dropDuration:600,dropEasing:"swing",dropAnimateTo:"nearest",dropCallback:function(){},dragAxis:"x",dragFactor:4,triggerFocusEvents:!0,triggerBlurEvents:!0,responsive:!1},n={autoplayInterval:null,autoplayIsRunning:!1,autoplayStartTimeout:null,animating:!1,childInFocus:-1,touchMoveStartPosition:null,stopAnimation:!1,lastAnimationStep:!1},r={init:function(i,s,o){var u,f=(new Date).getTime();return i=typeof i=="object"?i:{},s=e.isFunction(s)?s:function(){},s=e.isFunction(i)?i:s,u=e.extend({},t,i,n),this.each(function(){var t=e(this),n=t.children(u.childSelector).length,i=360/n,f=u.startingChild&&u.startingChild>n-1?n-1:u.startingChild,l=u.startingChild===null?u.bearing:360-f*i,c=t.css("position")!=="static"?t.css("position"):"relative";t.css({padding:0,position:c}).addClass("roundabout-holder").data("roundabout",e.extend({},u,{startingChild:f,bearing:l,oppositeOfFocusBearing:r.normalize.apply(null,[u.focusBearing-180]),dragBearing:l,period:i})),o?t.unbind(".roundabout").children(u.childSelector).unbind(".roundabout"):u.responsive&&e(window).bind("resize",function(){r.relayoutChildren.apply(t)}),u.clickToFocus&&t.children(u.childSelector).each(function(n){e(this).bind("click.roundabout",function(){var i=r.getPlacement.apply(t,[n]);if(!r.isInFocus.apply(t,[i]))return r.stopAnimation.apply(e(this)),t.data("roundabout").animating||r.animateBearingToFocus.apply(t,[i,t.data("roundabout").clickToFocusCallback]),!1})}),u.btnNext&&e(u.btnNext).bind("click.roundabout",function(){return t.data("roundabout").animating||r.animateToNextChild.apply(t,[t.data("roundabout").btnNextCallback]),!1}),u.btnPrev&&e(u.btnPrev).bind("click.roundabout",function(){return r.animateToPreviousChild.apply(t,[t.data("roundabout").btnPrevCallback]),!1}),u.btnToggleAutoplay&&e(u.btnToggleAutoplay).bind("click.roundabout",function(){return r.toggleAutoplay.apply(t),!1}),u.btnStartAutoplay&&e(u.btnStartAutoplay).bind("click.roundabout",function(){return r.startAutoplay.apply(t),!1}),u.btnStopAutoplay&&e(u.btnStopAutoplay).bind("click.roundabout",function(){return r.stopAutoplay.apply(t),!1}),u.autoplayPauseOnHover&&t.bind("mouseenter.roundabout.autoplay",function(){r.stopAutoplay.apply(t,[!0])}).bind("mouseleave.roundabout.autoplay",function(){r.startAutoplay.apply(t)}),u.enableDrag&&(e.isFunction(t.drag)?e.isFunction(t.drop)?t.drag(function(e,n){var i=t.data("roundabout"),s=i.dragAxis.toLowerCase()==="x"?"deltaX":"deltaY";r.stopAnimation.apply(t),r.setBearing.apply(t,[i.dragBearing+n[s]/i.dragFactor])}).drop(function(e){var n=t.data("roundabout"),i=r.getAnimateToMethod(n.dropAnimateTo);r.allowAnimation.apply(t),r[i].apply(t,[n.dropDuration,n.dropEasing,n.dropCallback]),n.dragBearing=n.period*r.getNearestChild.apply(t)}):u.debug&&alert("You do not have the drop plugin loaded."):u.debug&&alert("You do not have the drag plugin loaded."),t.each(function(){var t=e(this).get(0),n=e(this).data("roundabout"),i=n.dragAxis.toLowerCase()==="x"?"pageX":"pageY",s=r.getAnimateToMethod(n.dropAnimateTo);t.addEventListener&&(t.addEventListener("touchstart",function(e){n.touchMoveStartPosition=e.touches[0][i]},!1),t.addEventListener("touchmove",function(t){var s=(t.touches[0][i]-n.touchMoveStartPosition)/n.dragFactor;t.preventDefault(),r.stopAnimation.apply(e(this)),r.setBearing.apply(e(this),[n.dragBearing+s])},!1),t.addEventListener("touchend",function(t){t.preventDefault(),r.allowAnimation.apply(e(this)),s=r.getAnimateToMethod(n.dropAnimateTo),r[s].apply(e(this),[n.dropDuration,n.dropEasing,n.dropCallback]),n.dragBearing=n.period*r.getNearestChild.apply(e(this))},!1))})),r.initChildren.apply(t,[s,o])})},initChildren:function(t,n){var i=e(this),s=i.data("roundabout");return t=t||function(){},i.children(s.childSelector).each(function(t){var s,o,u,f=r.getPlacement.apply(i,[t]);n&&e(this).data("roundabout")&&(s=e(this).data("roundabout").startWidth,o=e(this).data("roundabout").startHeight,u=e(this).data("roundabout").startFontSize),e(this).addClass("roundabout-moveable-item").css("position","absolute"),e(this).data("roundabout",{startWidth:s||e(this).width(),startHeight:o||e(this).height(),startFontSize:u||parseInt(e(this).css("font-size"),10),degrees:f,backDegrees:r.normalize.apply(null,[f-180]),childNumber:t,currentScale:1,parent:i})}),r.updateChildren.apply(i),s.autoplay&&(s.autoplayStartTimeout=setTimeout(function(){r.startAutoplay.apply(i)},s.autoplayInitialDelay)),i.trigger("ready"),t.apply(i),i},updateChildren:function(){return this.each(function(){var t=e(this),n=t.data("roundabout"),i=-1,s={bearing:n.bearing,tilt:n.tilt,stage:{width:Math.floor(e(this).width()*.9),height:Math.floor(e(this).height()*.9)},animating:n.animating,inFocus:n.childInFocus,focusBearingRadian:r.degToRad.apply(null,[n.focusBearing]),shape:e.roundaboutShapes[n.shape]||e.roundaboutShapes[e.roundaboutShapes.def]};s.midStage={width:s.stage.width/2,height:s.stage.height/2},s.nudge={width:s.midStage.width+s.stage.width*.05,height:s.midStage.height+s.stage.height*.05},s.zValues={min:n.minZ,max:n.maxZ,diff:n.maxZ-n.minZ},s.opacity={min:n.minOpacity,max:n.maxOpacity,diff:n.maxOpacity-n.minOpacity},s.scale={min:n.minScale,max:n.maxScale,diff:n.maxScale-n.minScale},t.children(n.childSelector).each(function(o){r.updateChild.apply(t,[e(this),s,o,function(){e(this).trigger("ready")}])&&(!s.animating||n.lastAnimationStep)?(i=o,e(this).addClass("roundabout-in-focus")):e(this).removeClass("roundabout-in-focus")}),i!==s.inFocus&&(n.triggerBlurEvents&&t.children(n.childSelector).eq(s.inFocus).trigger("blur"),n.childInFocus=i,n.triggerFocusEvents&&i!==-1&&t.children(n.childSelector).eq(i).trigger("focus")),t.trigger("childrenUpdated")})},updateChild:function(t,n,i,s){var o,u=this,f=e(t),l=f.data("roundabout"),c=[],h=r.degToRad.apply(null,[360-l.degrees+n.bearing]);return s=s||function(){},h=r.normalizeRad.apply(null,[h]),o=n.shape(h,n.focusBearingRadian,n.tilt),o.scale=o.scale>1?1:o.scale,o.adjustedScale=(n.scale.min+n.scale.diff*o.scale).toFixed(4),o.width=(o.adjustedScale*l.startWidth).toFixed(4),o.height=(o.adjustedScale*l.startHeight).toFixed(4),f.css({left:(o.x*n.midStage.width+n.nudge.width-o.width/2).toFixed(0)+"px",top:(o.y*n.midStage.height+n.nudge.height-o.height/2).toFixed(0)+"px",width:o.width+"px",height:o.height+"px",opacity:(n.opacity.min+n.opacity.diff*o.scale).toFixed(2),zIndex:Math.round(n.zValues.min+n.zValues.diff*o.z),fontSize:(o.adjustedScale*l.startFontSize).toFixed(1)+"px"}),l.currentScale=o.adjustedScale,u.data("roundabout").debug&&(c.push('
      '),c.push('Child '+i+"
      "),c.push("left: "+f.css("left")+"
      "),c.push("top: "+f.css("top")+"
      "),c.push("width: "+f.css("width")+"
      "),c.push("opacity: "+f.css("opacity")+"
      "),c.push("height: "+f.css("height")+"
      "),c.push("z-index: "+f.css("z-index")+"
      "),c.push("font-size: "+f.css("font-size")+"
      "),c.push("scale: "+f.data("roundabout").currentScale),c.push("
      "),f.html(c.join(""))),f.trigger("reposition"),s.apply(u),r.isInFocus.apply(u,[l.degrees])},setBearing:function(t,n){return n=n||function(){},t=r.normalize.apply(null,[t]),this.each(function(){var n,i,s,o=e(this),u=o.data("roundabout"),f=u.bearing;u.bearing=t,o.trigger("bearingSet"),r.updateChildren.apply(o),n=Math.abs(f-t);if(!u.animating||n>180)return;n=Math.abs(f-t),o.children(u.childSelector).each(function(n){var i;r.isChildBackDegreesBetween.apply(e(this),[t,f])&&(i=f>t?"Clockwise":"Counterclockwise",e(this).trigger("move"+i+"ThroughBack"))})}),n.apply(this),this},adjustBearing:function(t,n){return n=n||function(){},t===0?this:(this.each(function(){r.setBearing.apply(e(this),[e(this).data("roundabout").bearing+t])}),n.apply(this),this)},setTilt:function(t,n){return n=n||function(){},this.each(function(){e(this).data("roundabout").tilt=t,r.updateChildren.apply(e(this))}),n.apply(this),this},adjustTilt:function(t,n){return n=n||function(){},this.each(function(){r.setTilt.apply(e(this),[e(this).data("roundabout").tilt+t])}),n.apply(this),this},animateToBearing:function(t,n,i,s,o){var u=(new Date).getTime();return o=o||function(){},e.isFunction(s)?(o=s,s=null):e.isFunction(i)?(o=i,i=null):e.isFunction(n)&&(o=n,n=null),this.each(function(){var l,p,v,m=e(this),y=m.data("roundabout"),w=n?n:y.duration,E=i?i:y.easing||"swing";s||(s={timerStart:u,start:y.bearing,totalTime:w}),l=u-s.timerStart;if(y.stopAnimation){r.allowAnimation.apply(m),y.animating=!1;return}l=Math.floor(u.lower)){v===2&&p===360?r.animateToDelta.apply(l,[-180,i,s,o]):r.animateBearingToFocus.apply(l,[u.lower,i,s,o]);break}}}else{p=Math.abs(p)=0;t-=1){u={lower:h.period*t,upper:h.period*(t+1)},u.upper=t===v-1?360:u.upper;if(p>=Math.floor(u.lower)&&p180?-(360-o):o,o!==0&&r.animateToDelta.apply(e(this),[o,n,i,s])})},stopAnimation:function(){return this.each(function(){e(this).data("roundabout").stopAnimation=!0})},allowAnimation:function(){return this.each(function(){e(this).data("roundabout").stopAnimation=!1})},startAutoplay:function(t){return this.each(function(){var n=e(this),i=n.data("roundabout");t=t||i.autoplayCallback||function(){},clearInterval(i.autoplayInterval),i.autoplayInterval=setInterval(function(){r.animateToNextChild.apply(n,[t])},i.autoplayDuration),i.autoplayIsRunning=!0,n.trigger("autoplayStart")})},stopAutoplay:function(t){return this.each(function(){clearInterval(e(this).data("roundabout").autoplayInterval),e(this).data("roundabout").autoplayInterval=null,e(this).data("roundabout").autoplayIsRunning=!1,t||e(this).unbind(".autoplay"),e(this).trigger("autoplayStop")})},toggleAutoplay:function(t){return this.each(function(){var n=e(this),i=n.data("roundabout");t=t||i.autoplayCallback||function(){},r.isAutoplaying.apply(e(this))?r.stopAutoplay.apply(e(this),[t]):r.startAutoplay.apply(e(this),[t])})},isAutoplaying:function(){return this.data("roundabout").autoplayIsRunning},changeAutoplayDuration:function(t){return this.each(function(){var n=e(this),i=n.data("roundabout");i.autoplayDuration=t,r.isAutoplaying.apply(n)&&(r.stopAutoplay.apply(n),setTimeout(function(){r.startAutoplay.apply(n)},10))})},normalize:function(e){var t=e%360;return t<0?360+t:t},normalizeRad:function(e){while(e<0)e+=Math.PI*2;while(e>Math.PI*2)e-=Math.PI*2;return e},isChildBackDegreesBetween:function(t,n){var r=e(this).data("roundabout").backDegrees;return t>n?r>=n&&r=t},getAnimateToMethod:function(e){return e=e.toLowerCase(),e==="next"?"animateToNextChild":e==="previous"?"animateToPreviousChild":"animateToNearestChild"},relayoutChildren:function(){return this.each(function(){var t=e(this),n=e.extend({},t.data("roundabout"));n.startingChild=t.data("roundabout").childInFocus,r.init.apply(t,[n,null,!0])})},getNearestChild:function(){var t=e(this),n=t.data("roundabout"),r=t.children(n.childSelector).length;return n.reflect?Math.round(n.bearing/n.period)%r:(r-Math.round(n.bearing/n.period)%r)%r},degToRad:function(e){return r.normalize.apply(null,[e])*Math.PI/180},getPlacement:function(e){var t=this.data("roundabout");return t.reflect?t.period*e:360-t.period*e},isInFocus:function(e){var t,n=this,i=n.data("roundabout"),s=r.normalize.apply(null,[i.bearing]);return e=r.normalize.apply(null,[e]),t=Math.abs(s-e),t<=i.floatComparisonThreshold||t>=360-i.floatComparisonThreshold},getChildInFocus:function(){var t=e(this).data("roundabout");return t.childInFocus>-1?t.childInFocus:!1}},e.fn.roundabout=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||e.isFunction(t)||!t)return r.init.apply(this,arguments);e.error("Method "+t+" does not exist for jQuery.roundabout.")}}(jQuery),BestInPlaceEditor.prototype={activate:function(){var e="";this.isNil?e="":this.original_content?e=this.original_content:this.sanitize?e=this.element.text():e=this.element.html();var t=this.isNil?"-":this.element.html();this.oldValue=t,this.display_value=e,jQuery(this.activator).unbind("click",this.clickHandler),this.activateForm(),this.element.trigger(jQuery.Event("best_in_place:activate"))},abort:function(){this.isNil?this.element.html(this.nil):this.element.html(this.oldValue),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:abort")),this.element.trigger(jQuery.Event("best_in_place:deactivate"))},abortIfConfirm:function(){if(!this.useConfirm){this.abort();return}confirm("Are you sure you want to discard your changes?")&&this.abort()},update:function(){var e=this;if(this.formType in{input:1,textarea:1}&&this.getValue()==this.oldValue)return this.abort(),!0;this.isNil=!1,e.ajax({type:"post",dataType:"text",data:e.requestData(),success:function(t){e.loadSuccessCallback(t)},error:function(t,n){e.loadErrorCallback(t,n)}});if(this.formType=="select"){var t=this.getValue();this.previousCollectionValue=t,jQuery.each(this.values,function(n,r){t==r[0]&&e.element.html(r[1])})}else this.formType=="checkbox"?e.element.html(this.getValue()?this.values[1]:this.values[0]):this.getValue()!==""?e.element.text(this.getValue()):e.element.html(this.nil);e.element.trigger(jQuery.Event("best_in_place:update"))},activateForm:function(){alert("The form was not properly initialized. activateForm is unbound")},initOptions:function(){var e=this;e.element.parents().each(function(){$parent=jQuery(this),e.url=e.url||$parent.attr("data-url"),e.collection=e.collection||$parent.attr("data-collection"),e.formType=e.formType||$parent.attr("data-type"),e.objectName=e.objectName||$parent.attr("data-object"),e.attributeName=e.attributeName||$parent.attr("data-attribute"),e.activator=e.activator||$parent.attr("data-activator"),e.okButton=e.okButton||$parent.attr("data-ok-button"),e.cancelButton=e.cancelButton||$parent.attr("data-cancel-button"),e.nil=e.nil||$parent.attr("data-nil"),e.inner_class=e.inner_class||$parent.attr("data-inner-class"),e.html_attrs=e.html_attrs||$parent.attr("data-html-attrs"),e.original_content=e.original_content||$parent.attr("data-original-content"),e.collectionValue=e.collectionValue||$parent.attr("data-value")}),e.element.parents().each(function(){var t=this.id.match(/^(\w+)_(\d+)$/i);t&&(e.objectName=e.objectName||t[1])}),e.url=e.element.attr("data-url")||e.url||document.location.pathname,e.collection=e.element.attr("data-collection")||e.collection,e.formType=e.element.attr("data-type")||e.formtype||"input",e.objectName=e.element.attr("data-object")||e.objectName,e.attributeName=e.element.attr("data-attribute")||e.attributeName,e.activator=e.element.attr("data-activator")||e.element,e.okButton=e.element.attr("data-ok-button")||e.okButton,e.cancelButton=e.element.attr("data-cancel-button")||e.cancelButton,e.nil=e.element.attr("data-nil")||e.nil||"-",e.inner_class=e.element.attr("data-inner-class")||e.inner_class||null,e.html_attrs=e.element.attr("data-html-attrs")||e.html_attrs,e.original_content=e.element.attr("data-original-content")||e.original_content,e.collectionValue=e.element.attr("data-value")||e.collectionValue,e.element.attr("data-sanitize")?e.sanitize=e.element.attr("data-sanitize")=="true":e.sanitize=!0,e.element.attr("data-use-confirm")?e.useConfirm=e.element.attr("data-use-confirm")!="false":e.useConfirm=!0,(e.formType=="select"||e.formType=="checkbox")&&e.collection!==null&&(e.values=jQuery.parseJSON(e.collection))},bindForm:function(){this.activateForm=BestInPlaceEditor.forms[this.formType].activateForm,this.getValue=BestInPlaceEditor.forms[this.formType].getValue},initNil:function(){this.element +.text()===""&&(this.isNil=!0,this.element.html(this.nil))},getValue:function(){alert("The form was not properly initialized. getValue is unbound")},sanitizeValue:function(e){return jQuery.trim(e)},requestData:function(){csrf_token=jQuery("meta[name=csrf-token]").attr("content"),csrf_param=jQuery("meta[name=csrf-param]").attr("content");var e="_method=put";return e+="&"+this.objectName+"["+this.attributeName+"]="+encodeURIComponent(this.getValue()),csrf_param!==undefined&&csrf_token!==undefined&&(e+="&"+csrf_param+"="+encodeURIComponent(csrf_token)),e},ajax:function(e){return e.url=this.url,e.beforeSend=function(e){e.setRequestHeader("Accept","application/json")},jQuery.ajax(e)},loadSuccessCallback:function(e){var t=jQuery.parseJSON(jQuery.trim(e));t!==null&&t.hasOwnProperty("display_as")&&(this.element.attr("data-original-content",this.element.text()),this.original_content=this.element.text(),this.element.html(t.display_as)),this.element.trigger(jQuery.Event("ajax:success"),e),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate")),this.collectionValue!==null&&(this.collectionValue=this.previousCollectionValue,this.previousCollectionValue=null)},loadErrorCallback:function(e,t){this.element.html(this.oldValue),this.element.trigger(jQuery.Event("best_in_place:error"),[e,t]),this.element.trigger(jQuery.Event("ajax:error")),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate"))},clickHandler:function(e){e.preventDefault(),e.data.editor.activate()},setHtmlAttributes:function(){var e=this.element.find(this.formType),t=jQuery.parseJSON(this.html_attrs);for(var n in t)e.attr(n,t[n])}},BestInPlaceEditor.forms={input:{activateForm:function(){var e=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),t=jQuery(document.createElement("input")).attr("type","text").attr("name",this.attributeName).val(this.display_value);this.inner_class!==null&&t.addClass(this.inner_class),e.append(t),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(),this.element.find("input[type='text']")[0].select(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.input.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.input.cancelButtonHandler),this.element.find("input[type='text']").bind("blur",{editor:this},BestInPlaceEditor.forms.input.inputBlurHandler),this.element.find("input[type='text']").bind("keyup",{editor:this},BestInPlaceEditor.forms.input.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){return this.sanitizeValue(this.element.find("input").val())},inputBlurHandler:function(e){e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abort()},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.abort(),e.stopPropagation()},keyupHandler:function(e){e.keyCode==27&&e.data.editor.abort()}},date:{activateForm:function(){var e=this,t=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),n=jQuery(document.createElement("input")).attr("type","text").attr("name",this.attributeName).attr("value",this.sanitizeValue(this.display_value));this.inner_class!==null&&n.addClass(this.inner_class),t.append(n),this.element.html(t),this.setHtmlAttributes(),this.element.find("input")[0].select(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.input.submitHandler),this.element.find("input").bind("keyup",{editor:this},BestInPlaceEditor.forms.input.keyupHandler),this.element.find("input").datepicker({onClose:function(){e.update()}}).datepicker("show")},getValue:function(){return this.sanitizeValue(this.element.find("input").val())},submitHandler:function(e){e.data.editor.update()},keyupHandler:function(e){e.keyCode==27&&e.data.editor.abort()}},select:{activateForm:function(){var e=jQuery(document.createElement("form")).attr("action","javascript:void(0)").attr("style","display:inline");selected="",oldValue=this.oldValue,select_elt=jQuery(document.createElement("select")),currentCollectionValue=this.collectionValue,jQuery.each(this.values,function(e,t){var n=jQuery(document.createElement("option")).val(t[0]).html(t[1]);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,"&").replace(/ /g," ").replace(/<|>/g,">").replace(/\n/g,"
      "),t=r.html().replace(/
      /ig,"
      ");if(e+" "!=t){r.html(e+" ");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("
      ").css({position:"absolute",display:"none","word-wrap":"break-word"}),i=parseInt(n.css("line-height"),10)||parseInt(n.css("font-size"),"10"),s=parseInt(n.css("height"),10)||i*3,o=parseInt(n.css("max-height"),10)||Number.MAX_VALUE,u=0,a=0;o<0&&(o=Number.MAX_VALUE),r.appendTo(n.parent()),a=t.length;while(a--)r.css(t[a].toString(),n.css(t[a].toString()));n.css({overflow:"hidden"}),n.bind("keyup change cut paste",function(){l()}),n.bind("blur",function(){r.height()s?n.height(r.height()):n.height(s))}),n.live("input paste",function(e){setTimeout(l,250)}),l()})}})}(jQuery),function(e,t){var n=function(){var t=e._data(document,"events");return t&&t.click&&e.grep(t.click,function(e){return e.namespace==="rails"}).length};n()&&e.error("jquery-ujs has already been loaded!");var r;e.rails=r={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var n=e('meta[name="csrf-token"]').attr("content");n&&t.setRequestHeader("X-CSRF-Token",n)},fire:function(t,n,r){var i=e.Event(n);return t.trigger(i,r),i.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(n){var i,s,o,u,a,f,l,c;if(r.fire(n,"ajax:before")){u=n.data("cross-domain"),a=u===t?null:u,f=n.data("with-credentials")||null,l=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType;if(n.is("form")){i=n.attr("method"),s=n.attr("action"),o=n.serializeArray();var h=n.data("ujs:submit-button");h&&(o.push(h),n.data("ujs:submit-button",null))}else n.is(r.inputChangeSelector)?(i=n.data("method"),s=n.data("url"),o=n.serialize(),n.data("params")&&(o=o+"&"+n.data("params"))):(i=n.data("method"),s=r.href(n),o=n.data("params")||null);c={type:i||"GET",data:o,dataType:l,beforeSend:function(e,i){return i.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),r.fire(n,"ajax:beforeSend",[e,i])},success:function(e,t,r){n.trigger("ajax:success",[e,t,r])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,r){n.trigger("ajax:error",[e,t,r])},xhrFields:{withCredentials:f},crossDomain:a},s&&(c.url=s);var p=r.ajax(c);return n.trigger("ajax:send",p),p}return!1},handleMethod:function(n){var i=r.href(n),s=n.data("method"),o=n.attr("target"),u=e("meta[name=csrf-token]").attr("content"),a=e("meta[name=csrf-param]").attr("content"),f=e('
      '),l='';a!==t&&u!==t&&(l+=''),o&&f.attr("target",o),f.hide().append(l).appendTo("body"),f.submit()},disableFormElements:function(t){t.find(r.disableSelector).each(function(){var t=e(this),n=t.is("button")?"html":"val";t.data("ujs:enable-with",t[n]()),t[n](t.data("disable-with")),t.prop("disabled",!0)})},enableFormElements:function(t){t.find(r.enableSelector).each(function(){var t=e(this),n=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[n](t.data("ujs:enable-with")),t.prop("disabled",!1)})},allowAction:function(e){var t=e.data("confirm"),n=!1,i;return t?(r.fire(e,"confirm")&&(n=r.confirm(t),i=r.fire(e,"confirm:complete",[n])),n&&i):!0},blankInputs:function(t,n,r){var i=e(),s,o,u=n||"input,textarea",a=t.find(u);return a.each(function(){s=e(this),o=s.is(":checkbox,:radio")?s.is(":checked"):s.val();if(!o==!r){if(s.is(":radio")&&a.filter('input:radio:checked[name="'+s.attr("name")+'"]').length)return!0;i=i.add(s)}}),i.length?i:!1},nonBlankInputs:function(e,t){return r.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},callFormSubmitBindings:function(n,r){var i=n.data("events"),s=!0;return i!==t&&i.submit!==t&&e.each(i.submit,function(e,t){if(typeof t.handler=="function")return s=t.handler(r)}),s},disableElement:function(e){e.data("ujs:enable-with",e.html()),e.html(e.data("disable-with")),e.bind("click.railsDisable",function(e){return r.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.data("ujs:enable-with",!1)),e.unbind("click.railsDisable")}},r.fire(e(document),"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,n){e.crossDomain||r.CSRFProtection(n)}),e(document).delegate(r.linkDisableSelector,"ajax:complete",function(){r.enableElement(e(this))}),e(document).delegate(r.linkClickSelector,"click.rails",function(n){var i=e(this),s=i.data("method"),o=i.data("params");if(!r.allowAction(i))return r.stopEverything(n);i.is(r.linkDisableSelector)&&r.disableElement(i);if(i.data("remote")!==t){if((n.metaKey||n.ctrlKey)&&(!s||s==="GET")&&!o)return!0;var u=r.handleRemote(i);return u===!1?r.enableElement(i):u.error(function(){r.enableElement(i)}),!1}if(i.data("method"))return r.handleMethod(i),!1}),e(document).delegate(r.inputChangeSelector,"change.rails",function(t){var n=e(this);return r.allowAction(n)?(r.handleRemote(n),!1):r.stopEverything(t)}),e(document).delegate(r.formSubmitSelector,"submit.rails",function(n){var i=e(this),s=i.data("remote")!==t,o=r.blankInputs(i,r.requiredInputSelector),u=r.nonBlankInputs(i,r.fileInputSelector);if(!r.allowAction(i))return r.stopEverything(n);if(o&&i.attr("novalidate")==t&&r.fire(i,"ajax:aborted:required",[o]))return r.stopEverything(n);if(s){if(u){setTimeout(function(){r.disableFormElements(i)},13);var a=r.fire(i,"ajax:aborted:file",[u]);return a||setTimeout(function(){r.enableFormElements(i)},13),a}return!e.support.submitBubbles&&e().jquery<"1.7"&&r.callFormSubmitBindings(i,n)===!1?r.stopEverything(n):(r.handleRemote(i),!1)}setTimeout(function(){r.disableFormElements(i)},13)}),e(document).delegate(r.formInputClickSelector,"click.rails",function(t){var n=e(this);if(!r.allowAction(n))return r.stopEverything(t);var i=n.attr("name"),s=i?{name:i,value:n.val()}:null;n.closest("form").data("ujs:submit-button",s)}),e(document).delegate(r.formSubmitSelector,"ajax:beforeSend.rails",function(t){this==t.target&&r.disableFormElements(e(this))}),e(document).delegate(r.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&r.enableFormElements(e(this))}),e(function(){csrf_token=e("meta[name=csrf-token]").attr("content"),csrf_param=e("meta[name=csrf-param]").attr("content"),e('form input[name="'+csrf_param+'"]').val(csrf_token)}))}(jQuery),document.createElement("canvas").getContext||function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q +.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),$(document).ready(function(){$(".sidebarFilterBox .showAll").click(function(e){showAll(),$("#filter_by_metacode ul li").removeClass("toggledOff");for(var t in categoryVisible)categoryVisible[t]=!0}),$(".sidebarFilterBox .hideAll").click(function(e){hideAll(),$("#filter_by_metacode ul li").addClass("toggledOff");for(var t in categoryVisible)categoryVisible[t]=!1}),$("#filter_by_metacode ul li").click(function(e){var t=$(this).children("img").attr("alt");switchVisible(t),categoryVisible[t]==1?($(this).addClass("toggledOff"),categoryVisible[t]=!1):categoryVisible[t]==0&&($(this).removeClass("toggledOff"),categoryVisible[t]=!0)})});var lastDist=0,MetamapsModel=new Object;MetamapsModel.embed=!1,MetamapsModel.selectedEdges=new Array,MetamapsModel.selectedNodes=new Array,MetamapsModel.didPan=!1,MetamapsModel.showcardInUse=null,MetamapsModel.widthOfLabel=null,MetamapsModel.edgecardInUse=null,MetamapsModel.edgeHoveringOver=!1,MetamapsModel.boxStartCoordinates=!1,MetamapsModel.boxEndCoordinates=!1,MetamapsModel.synapseStartCoord=!1,MetamapsModel.synapseEndCoord=!1,MetamapsModel.lastSynapseClick=0,MetamapsModel.lastNodeClick=0,MetamapsModel.lastCanvasClick=0,MetamapsModel.DOUBLE_CLICK_TOLERANCE=300,MetamapsModel.edgePermTimer1=null,MetamapsModel.edgePermTimer2=null,MetamapsModel.edgePermSliding=!1,MetamapsModel.topicPermTimer1=null,MetamapsModel.topicPermTimer2=null,MetamapsModel.topicPermSliding=!1;var renderMidArrow=function(e,t,n,r,i,s,o){var u=i.getCtx();if(r){var a=e;e=t,t=a}var f=new $jit.Complex(t.x-e.x,t.y-e.y);f.$scale(n/f.norm());var l=(t.x-e.x)*s+e.x,c=(t.y-e.y)*s+e.y,h=new $jit.Complex(l,c),p=new $jit.Complex(f.x/.7+h.x,f.y/.7+h.y),d=new $jit.Complex(p.x-f.x,p.y-f.y),v=new $jit.Complex(-f.y/2,f.x/2),m=d.add(v),g=d.$add(v.$scale(-1));o&&(u.strokeStyle="#222222",u.lineWidth=2,u.globalAlpha=.4),u.beginPath(),u.moveTo(e.x,e.y),u.lineTo(t.x,t.y),u.stroke(),u.beginPath(),u.moveTo(m.x,m.y),u.lineTo(p.x,p.y),u.lineTo(g.x,g.y),u.stroke()},nodeSettings={customNode:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim"),i=e.getData("metacode"),s=e.getData("greenCircle"),o=e.getData("whiteCircle"),u=t.getCtx();s&&(u.beginPath(),u.arc(n.x,n.y,r+3,0,2*Math.PI,!1),u.strokeStyle="#67be5f",u.lineWidth=2,u.stroke()),o&&(u.beginPath(),u.arc(n.x,n.y,r+3,0,2*Math.PI,!1),MetamapsModel.embed||(u.strokeStyle="white"),MetamapsModel.embed&&(u.strokeStyle="#999"),u.lineWidth=2,u.stroke()),u.drawImage(imgArray[i],n.x-r,n.y-r,r*2,r*2)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}}},renderEdgeArrows=function(e,t){var n=Mconsole.canvas,r=t.getData("category"),i=t.getData("direction"),s=t.nodeFrom.pos.getc(!0),o=t.nodeTo.pos.getc(!0);if(r=="none")e.line.render({x:s.x,y:s.y},{x:o.x,y:o.y},n);else if(r=="both")renderMidArrow({x:s.x,y:s.y},{x:o.x,y:o.y},13,!0,n,.7),renderMidArrow({x:s.x,y:s.y},{x:o.x,y:o.y},13,!1,n,.7);else if(r=="from-to"){var i=t.data.$direction,u=i&&i.length>1&&i[0]!=t.nodeFrom.id;renderMidArrow({x:s.x,y:s.y},{x:o.x,y:o.y},13,u,n,.7),renderMidArrow({x:s.x,y:s.y},{x:o.x,y:o.y},13,u,n,.3)}},edgeSettings={customEdge:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.getData("category");renderEdgeArrows(this.edgeHelper,e);var s=e.getData("desc"),o=e.getData("showDesc");if(s!=""&&o){s=decodeEntities(s);var u=t.getCtx();u.font="14px arial",u.fillStyle="#222222",u.textBaseline="hanging";function a(e,t){var n="",r=e;while(r.length>t){var i=r.substring(0,t),s=i.lastIndexOf(" "),o=i.lastIndexOf("\n");o!=-1&&(s=o),s==-1&&(s=t),n+=i.substring(0,s)+"\n",r=r.substring(s+1)}return n+r}var f=a(s,30).split("\n"),l,c=[];for(l=0;l>16,e>>8&255,e&255]},e.destroy=function(t){e.clean(t),t.parentNode&&t.parentNode.removeChild(t),t.clearAttributes&&t.clearAttributes()},e.clean=function(t){for(var n=t.childNodes,r=0,i=n.length;r-1},e.addClass=function(t,n){e.hasClass(t,n)||(t.className=t.className+" "+n)},e.removeClass=function(e,t){e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)"),"$1")},e.getPos=function(e){function r(e){var t={x:0,y:0};while(e&&!s(e))t.x+=e.offsetLeft,t.y+=e.offsetTop,e=e.offsetParent;return t}function i(e){var t={x:0,y:0};while(e&&!s(e))t.x+=e.scrollLeft,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=(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(ti.height?e.y-s.height-u:e.y+u)+"px",n.left=(e.x+s.width+o>i.width?e.x-s.width-o:e.x+o)+"px"},hide:function(e){this.tip.style.display="none",e&&this.config.onHide()}}),a.Classes.NodeStyles=new t({Implements:[s,o],initializePost:function(){this.fx=this.viz.fx,this.types=this.viz.fx.nodeTypes,this.nStyles=this.config,this.nodeStylesOnHover=this.nStyles.stylesHover,this.nodeStylesOnClick=this.nStyles.stylesClick,this.hoveredNode=!1,this.fx.nodeFxAnimation=new r,this.down=!1,this.move=!1},onMouseOut:function(e,t){this.down=this.move=!1;if(!this.hoveredNode)return;this.dom&&this.isLabel(e,t)&&this.toggleStylesOnHover(this.hoveredNode,!1);var n=e.relatedTarget,r=this.canvas.getElement();while(n&&n.parentNode){if(r==n.parentNode)return;n=n.parentNode}this.toggleStylesOnHover(this.hoveredNode,!1),this.hoveredNode=!1},onMouseOver:function(e,t){var n;if(this.dom&&(n=this.isLabel(e,t))){var r=this.viz.graph.getNode(n.id);if(r.selected)return;this.hoveredNode=r,this.toggleStylesOnHover(this.hoveredNode,!0)}},onMouseDown:function(e,t,n,r){if(r)return;var i;this.dom&&(i=this.isLabel(e,t))?this.down=this.viz.graph.getNode(i.id):this.dom||(this.down=n.getNode()),this.move=!1},onMouseUp:function(e,t,n,r){if(r)return;this.move||this.onClick(n.getNode()),this.down=this.move=!1},getRestoredStyles:function(e,t){var n={},r=this["nodeStylesOn"+t];for(var i in r)n[i]=e.styles["$"+i];return n},toggleStylesOnHover:function(e,t){this.nodeStylesOnHover&&this.toggleStylesOn("Hover",e,t)},toggleStylesOnClick:function(e,t){this.nodeStylesOnClick&&this.toggleStylesOn("Click",e,t)},toggleStylesOn:function(t,r,i){var s=this.viz,o=this.nStyles;if(i){var u=this;r.styles||(r.styles=e.merge(r.data,{}));for(var a in this["nodeStylesOn"+t]){var f="$"+a;f in r.styles||(r.styles[f]=r.getData(a))}s.fx.nodeFx(e.extend({elements:{id:r.id,properties:u["nodeStylesOn"+t]},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}else{var l=this.getRestoredStyles(r,t);s.fx.nodeFx(e.extend({elements:{id:r.id,properties:l},transition:n.Quart.easeOut,duration:300,fps:40},this.config))}},onClick:function(e){if(!e)return;var t=this.nodeStylesOnClick;if(!t)return;e.selected?(this.toggleStylesOnClick(e,!1),delete e.selected):(this.viz.graph.eachNode(function(e){if(e.selected){for(var n in t)e.setData(n,e.styles["$"+n],"end");delete e.selected}}),this.toggleStylesOnClick(e,!0),e.selected=!0,delete e.hovered,this.hoveredNode=!1)},onMouseMove:function(e,t,n){this.down&&(this.move=!0);if(this.dom&&this.isLabel(e,t))return;var r=this.nodeStylesOnHover;if(!r)return;if(!this.dom){if(this.hoveredNode){var i=this.types[this.hoveredNode.getData("type")],s=i&&i.contains&&i.contains.call(this.fx,this.hoveredNode,n.getPos());if(s)return}var o=n.getNode();if(!this.hoveredNode&&!o)return;if(o.hovered)return;o&&!o.selected?(this.fx.nodeFxAnimation.stopTimer(),this.viz.graph.eachNode(function(e){if(e.hovered&&!e.selected){for(var t in r)e.setData(t,e.styles["$"+t],"end");delete e.hovered}}),o.hovered=!0,this.hoveredNode=o,this.toggleStylesOnHover(o,!0)):this.hoveredNode&&!this.hoveredNode.selected&&(this.fx.nodeFxAnimation.stopTimer(),this.toggleStylesOnHover(this.hoveredNode,!1),delete this.hoveredNode.hovered,this.hoveredNode=!1)}}}),a.Classes.Navigation=new t({Implements:[s,o],initializePost:function(){this.pos=!1,this.pressed=!1},onMouseWheel:function(t,n,r){if(!this.config.zooming)return;if(t.target.id!="infovis-canvas")return;e.event.stop(e.event.get(t,n));var i=this.config.zooming/1e3,s=1+r*i;s>1?5>=this.canvas.scaleOffsetX&&this.canvas.scale(s,s):s<1&&this.canvas.scaleOffsetX>=.2&&this.canvas.scale(s,s)},onMouseDown:function(e,t,n){if(!this.config.panning)return;if(this.config.panning=="avoid nodes"&&n.getNode()||n.getEdge())return;this.pressed=!0,!MetamapsModel.boxStartCoordinates&&e.shiftKey&&(MetamapsModel.boxStartCoordinates=n.getPos()),MetamapsModel.didPan=!1,this.pos=n.getPos();var r=this.canvas,i=r.translateOffsetX,s=r.translateOffsetY,o=r.scaleOffsetX,u=r.scaleOffsetY;this.pos.x*=o,this.pos.x+=i,this.pos.y*=u,this.pos.y+=s},onMouseMove:function(e,t,n){if(!this.config.panning)return;if(!this.pressed)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;if(!MetamapsModel.boxStartCoordinates&&e.shiftKey){Mconsole.busy=!0,MetamapsModel.boxStartCoordinates=n.getPos();return}if(MetamapsModel.boxStartCoordinates&&e.shiftKey){Mconsole.busy=!0,drawSelectBox(n,e);return}if(e.target.id!="infovis-canvas"){this.pressed=!1;return}MetamapsModel.didPan=!0;var r=this.pos,i=n.getPos(),s=this.canvas,o=s.translateOffsetX,u=s.translateOffsetY,a=s.scaleOffsetX,f=s.scaleOffsetY;i.x*=a,i.y*=f,i.x+=o,i.y+=u;var l=i.x-r.x,c=i.y-r.y;this.pos=i,this.canvas.translate(l*1/a,c*1/f)},onMouseUp:function(e,t,n,r){if(!this.config.panning)return;this.pressed=!1}});var f;(function(){function i(t,n){var i=document.createElement(t);for(var s in n)typeof n[s]=="object"?e.extend(i[s],n[s]):i[s]=n[s];return t=="canvas"&&!r&&G_vmlCanvasManager&&(i=G_vmlCanvasManager.initElement(document.body.appendChild(i))),i}var n=typeof HTMLCanvasElement,r=n=="object"||n=="function";$jit.Canvas=f=new t({canvases:[],pos:!1,element:!1,labelContainer:!1,translateOffsetX:0,translateOffsetY:0,scaleOffsetX:1,scaleOffsetY:1,initialize:function(t,n){this.viz=t,this.opt=n;var r=e.type(n.injectInto)=="string"?n.injectInto:n.injectInto.id,s=r+"-label",o=e(r),u=n.width||o.offsetWidth,a=n.height||o.offsetHeight;this.id=r;var l={injectInto:r,width:u,height:a};this.element=i("div",{id:r+"-canvaswidget",style:{position:"relative",width:u+"px",height:a+"px"}}),this.labelContainer=this.createLabelContainer(n.Label.type,s,l),this.canvases.push(new f.Base({config:e.extend({idSuffix:"-canvas"},l),plot:function(e){t.fx.plot()},resize:function(){t.refresh()}}));var c=n.background;if(c){var h=new f.Background[c.type](t,e.extend(c,l));this.canvases.push(new f.Base(h))}var p=this.canvases.length;while(p--)this.element.appendChild(this.canvases[p].canvas),p>0&&this.canvases[p].plot();this.element.appendChild(this.labelContainer),o.appendChild(this.element);var d=null,v=this;e.addEvent(window,"scroll",function(){clearTimeout(d),d=setTimeout(function(){v.getPos(!0)},500)})},getCtx:function(e){return this.canvases[e||0].getCtx()},getConfig:function(){return this.opt},getElement:function(){return this.element},getSize:function(e){return this.canvases[e||0].getSize()},resize:function(e,t){this.getPos(!0),this.translateOffsetX=this.translateOffsetY=0,this.scaleOffsetX=this.scaleOffsetY=1;for(var n=0,r=this.canvases.length;no?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.getc(!0),this.x=e.x,this.y=e.y},setc:function(e,t){this.x=e,this.y=t},setp:function(e,t){this.x=Math.cos(e)*t,this.y=Math.sin(e)*t},clone:function(){return new h(this.x,this.y)},toPolar:function(e){var t=this.norm(),n=Math.atan2(this.y,this.x);return n<0&&(n+=Math.PI*2),e?{theta:n,rho:t}:new l(n,t)},norm:function(){return Math.sqrt(this.squaredNorm())},squaredNorm:function(){return this.x*this.x+this.y*this.y},add:function(e){return new h(this.x+e.x,this.y+e.y)},prod:function(e){return new h(this.x*e.x-this.y*e.y,this.y*e.x+this.x*e.y)},conjugate:function(){return new h(this.x,-this.y)},scale:function(e){return new h(this.x*e,this.y*e)},equals:function(e){return this.x==e.x&&this.y==e.y},$add:function(e){return this.x+=e.x,this.y+=e.y,this},$prod:function(e){var t=this.x,n=this.y;return this.x=t*e.x-n*e.y,this.y=n*e.x+t*e.y,this},$conjugate:function(){return this.y=-this.y,this},$scale:function(e){return this.x*=e,this.y*=e,this},$div:function(e){var t=this.x,n=this.y,r=e.squaredNorm();return this.x=t*e.x+n*e.y,this.y=n*e.x-t*e.y,this.$scale(1/r)}};var p=function(e,t){return new h(e,t)};h.KER=p(0,0),$jit.Graph=new t({initialize:function(t,n,r,i){var s={complex:!1,Node:{}};this.Node=n,this.Edge=r,this.Label=i,this.opt=e.merge(s,t||{}),this.nodes={},this.edges={};var o=this;this.nodeList={};for(var u in v)o.nodeList[u]=function(e){return function(){var t=Array.prototype.slice.call(arguments);o.eachNode(function(n){n[e].apply(n,t)})}}(u)},getNode:function(e){return this.hasNode(e)?this.nodes[e]:!1},getByName:function(e){for(var t in this.nodes){var n=this.nodes[t];if(n.name==e)return n}return!1},getAdjacence:function(e,t){return e in this.edges?this.edges[e][t]:!1},addNode:function(t){if(!this.nodes[t.id]){var n=this.edges[t.id]={};this.nodes[t.id]=new d.Node(e.extend({id:t.id,name:t.name,data:e.merge(t.data||{},{}),adjacencies:n},this.opt.Node),this.opt.complex,this.Node,this.Edge,this.Label)}return this.nodes[t.id]},addAdjacence:function(e,t,n){this.hasNode(e.id)||this.addNode(e),this.hasNode(t.id)||this.addNode(t),e=this.nodes[e.id],t=this.nodes[t.id];if(!e.adjacentTo(t)){var r=this.edges[e.id]=this.edges[e.id]||{},i=this.edges[t.id]=this.edges[t.id]||{};return r[t.id]=i[e.id]=new d.Adjacence(e,t,n,this.Edge,this.Label),r[t.id]}return this.edges[e.id][t.id]},removeNode:function(e){if(this.hasNode(e)){delete this.nodes[e];var t=this.edges[e];for(var n in t)delete this.edges[n][e];delete this.edges[e]}},removeAdjacence:function(e,t){delete this.edges[e][t],delete this.edges[t][e]},hasNode:function(e){return e in this.nodes},empty:function(){this.nodes={},this.edges={}}});var d=$jit.Graph,v;(function(){var t=function(e,t,n,r,i){var s;n=n||"current",e="$"+(e?e+"-":""),n=="current"?s=this.data:n=="start"?s=this.startData:n=="end"&&(s=this.endData);var o=e+t;return r?s[o]:this.Config.overridable?o in s?s[o]:o in this.data?this.data[o]:i[t]||0:i[t]||0},n=function(e,t,n,r){r=r||"current",e="$"+(e?e+"-":"");var i;r=="current"?i=this.data:r=="start"?i=this.startData:r=="end"&&(i=this.endData),i[e+t]=n},r=function(t,n){t="$"+(t?t+"-":"");var r=this;e.each(n,function(e){var n=t+e;delete r.data[n],delete r.endData[n],delete r.startData[n]})};v={getData:function(e,n,r){return t.call(this,"",e,n,r,this.Config)},setData:function(e,t,r){n.call(this,"",e,t,r)},setDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i=t&&i<=n&&o(e)&&r(e,i),ii&&a(r,t,n)})}(e,t+s,n+s)},eachSubgraph:function(e,t,n){this.eachLevel(e,0,!1,t,n)},eachSubnode:function(e,t,n){this.eachLevel(e,1,1,t,n)},anySubnode:function(t,n,r){var i=!1;n=n||e.lambda(!0);var s=e.type(n)=="string"?function(e){return e[n]}:n;return this.eachSubnode(t,function(e){s(e)&&(i=!0)},r),i},getSubnodes:function(t,n,r){var i=[],s=this;n=n||0;var o,u;return e.type(n)=="array"?(o=n[0],u=n[1]):(o=n,u=Number.MAX_VALUE-t._depth),this.eachLevel(t,o,u,function(e){i.push(e)},r),i},getParents:function(e){var t=[];return this.eachAdjacency(e,function(n){var r=n.nodeTo;r._depth-1?t.endData[i]=r[i]:t.data[i]=r[i]}}),i.graph.eachNode(function(e){if(e.ignore)return;e.eachAdjacency(function(e){if(e.nodeFrom.ignore||e.nodeTo.ignore)return;var t=u.getNode(e.nodeFrom.id),n=u.getNode(e.nodeTo.id);if(!t.adjacentTo(n)){var e=i.graph.getAdjacence(t.id,n.id);f=!0,e.setData("alpha",1),e.setData("alpha",1,"start"),e.setData("alpha",0,"end")}})});var f=this.preprocessSum(u),c=f?["node-property:alpha","edge-property:alpha"]:["node-property:alpha"];c[0]=c[0]+(r&&"node-property"in r?":"+e.splat(r["node-property"]).join(":"):""),c[1]=(c[1]||"edge-property:alpha")+(r&&"edge-property"in r?":"+e.splat(r["edge-property"]).join(":"):""),r&&"label-property"in r&&c.push("label-property:"+e.splat(r["label-property"]).join(":")),i.reposition(),i.graph.eachNode(function(e){e.id!=o&&e.pos.getp().equals(l.KER)&&(e.pos.set(e.endPos),e.startPos.set(e.endPos))}),i.fx.animate(e.merge(s,{modes:["polar"].concat(c),onComplete:function(){i.graph.eachNode(function(e){e.ignore&&i.graph.removeNode(e.id)}),i.graph.eachNode(function(e){e.eachAdjacency(function(e){e.ignore&&i.graph.removeAdjacence(e.nodeFrom.id,e.nodeTo.id)})}),s.onComplete()}}));break;default:}},contract:function(t,n){var r=this.viz;if(t.collapsed||!t.anySubnode(e.lambda(!0)))return;n=e.merge(this.options,r.config,n||{},{modes:["node-property:alpha:span","linear"]}),t.collapsed=!0,function i(e){e.eachSubnode(function(e){e.ignore=!0,e.setData("alpha",0,n.type=="animate"?"end":"current"),i(e)})}(t),n.type=="animate"?(r.compute("end"),r.rotated&&r.rotate(r.rotated,"none",{property:"end"}),function s(e){e.eachSubnode(function(e){e.setPos(t.getPos("end"),"end"),s(e)})}(t),r.fx.animate(n)):n.type=="replot"&&r.refresh()},expand:function(t,n){if(!("collapsed"in t))return;var r=this.viz;n=e.merge(this.options,r.config,n||{},{modes:["node-property:alpha:span","linear"]}),delete t.collapsed,function i(e){e.eachSubnode(function(e){delete e.ignore,e.setData("alpha",1,n.type=="animate"?"end":"current"),i(e)})}(t),n.type=="animate"?(r.compute("end"),r.rotated&&r.rotate(r.rotated,"none",{property:"end"}),r.fx.animate(n)):n.type=="replot"&&r.refresh()},preprocessSum:function(e){var t=this.viz;e.eachNode(function(e){if(!t.graph.hasNode(e.id)){t.graph.addNode(e);var n=t.graph.getNode(e.id);n.setData("alpha",0),n.setData("alpha",0,"start"),n.setData("alpha",1,"end")}});var n=!1;return e.eachNode(function(e){e.eachAdjacency(function(e){var r=t.graph.getNode(e.nodeFrom.id),i=t.graph.getNode(e.nodeTo.id);if(!r.adjacentTo(i)){var e=t.graph.addAdjacence(r,i,e.data);r.startAlpha==r.endAlpha&&i.startAlpha==i.endAlpha&&(n=!0,e.setData("alpha",0),e.setData("alpha",0,"start"),e.setData("alpha",1,"end"))}})}),n}};var m={none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t,n,r){var i=r.getCtx();i.beginPath(),i.arc(t.x,t.y,n,0,Math.PI*2,!0),i.closePath(),i[e]()},contains:function(e,t,n){var r=e.x-t.x,i=e.y-t.y,s=r*r+i*i;return s<=n*n}},ellipse:{render:function(e,t,n,r,i){var s=i.getCtx();r/=2,n/=2,s.save(),s.scale(n/r,r/n),s.beginPath(),s.arc(t.x*(r/n),t.y*(n/r),r,0,Math.PI*2,!0),s.closePath(),s[e](),s.restore()},contains:function(e,t,n,r){n/=2,r/=2;var i=(n+r)/2,s=e.x-t.x,o=e.y-t.y,u=s*s+o*o;return u<=i*i}},square:{render:function(e,t,n,r){r.getCtx()[e+"Rect"](t.x-n,t.y-n,2*n,2*n)},contains:function(e,t,n){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}},rectangle:{render:function(e,t,n,r,i){i.getCtx()[e+"Rect"](t.x-n/2,t.y-r/2,n,r)},contains:function(e,t,n,r){return Math.abs(t.x-e.x)<=n/2&&Math.abs(t.y-e.y)<=r/2}},triangle:{render:function(e,t,n,r){var i=r.getCtx(),s=t.x,o=t.y-n,u=s-n,a=t.y+n,f=s+n,l=a;i.beginPath(),i.moveTo(s,o),i.lineTo(u,a),i.lineTo(f,l),i.closePath(),i[e]()},contains:function(e,t,n){return m.circle.contains(e,t,n)}},star:{render:function(e,t,n,r){var i=r.getCtx(),s=Math.PI/5;i.save(),i.translate(t.x,t.y),i.beginPath(),i.moveTo(n,0);for(var o=0;o<9;o++)i.rotate(s),o%2==0?i.lineTo(n/.525731*.200811,0):i.lineTo(n,0);i.closePath(),i[e](),i.restore()},contains:function(e,t,n){return m.circle.contains(e,t,n)}}},g={line:{render:function(e,t,n){var r=n.getCtx();r.beginPath(),r.moveTo(e.x,e.y),r.lineTo(t.x,t.y),r.stroke()},contains:function(e,t,n,r){var i=Math.min,s=Math.max,o=i(e.x,t.x),u=s(e.x,t.x),a=i(e.y,t.y),f=s(e.y,t.y);if(n.x>=o&&n.x<=u&&n.y>=a&&n.y<=f){if(Math.abs(t.x-e.x)<=r)return!0;var l=(t.y-e.y)/(t.x-e.x)*(n.x-e.x)+e.y;return Math.abs(l-n.y)<=r}return!1}},arrow:{render:function(e,t,n,r,i){var s=i.getCtx();if(r){var o=e;e=t,t=o}var u=new h(t.x-e.x,t.y-e.y);u.$scale(n/u.norm());var a=new h(t.x-u.x,t.y-u.y),f=new h(-u.y/2.5,u.x/2.5),l=a.add(f),c=a.$add(f.$scale(-1)),p=new h(t.x-e.x,t.y-e.y);p.$scale(15/p.norm());var d=new h(t.x-p.x,t.y-p.y);t.x=d.x,t.y=d.y,s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke(),s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.lineTo(t.x,t.y),s.closePath(),s.fill()},contains:function(e,t,n,r){return g.line.contains(e,t,n,r)}},hyperline:{render:function(e,t,n,r){function f(e,t){var n=e.x*t.y-e.y*t.x,r=n,i=e.squaredNorm(),s=t.squaredNorm();if(n==0)return{x:0,y:0,ratio:-1};var o=(e.y*s-t.y*i+e.y-t.y)/n,u=(t.x*i-e.x*s+t.x-e.x)/r,a=-o/2,f=-u/2,l=(o*o+u*u)/4-1;if(l<0)return{x:0,y:0,ratio:-1};var c=Math.sqrt(l),h={x:a,y:f,ratio:c>1e3?-1:c,a:o,b:u};return h}function a(e,t){return et?!1:!0:t+Math.PI>e?!0:!1}var i=r.getCtx(),s=f(e,t);if(s.a>1e3||s.b>1e3||s.ratio<0)i.beginPath(),i.moveTo(e.x*n,e.y*n),i.lineTo(t.x*n,t.y*n),i.stroke();else{var o=Math.atan2(t.y-s.y,t.x-s.x),u=Math.atan2(e.y-s.y,e.x-s.x),a=a(o,u);i.beginPath(),i.arc(s.x*n,s.y*n,s.ratio*n,o,u,a),i.stroke()}},contains:e.lambda(!1)}};d.Plot={initialize:function(e,t){this.viz=e,this.config=e.config,this.node=e.config.Node,this.edge=e.config.Edge,this.animation=new r,this.nodeTypes=new t.Plot.NodeTypes,this.edgeTypes=new t.Plot.EdgeTypes,this.labels=e.labels},nodeHelper:m,edgeHelper:g,Interpolator:{map:{border:"color",color:"color",width:"number",height:"number",dim:"number",alpha:"number",lineWidth:"number",angularWidth:"number",span:"number",valueArray:"array-number",dimArray:"array-number"},canvas:{globalAlpha:"number",fillStyle:"color",strokeStyle:"color",lineWidth:"number",shadowBlur:"number",shadowColor:"color",shadowOffsetX:"number",shadowOffsetY:"number",miterLimit:"number"},label:{size:"number",color:"color"},compute:function(e,t,n){return e+(t-e)*n},moebius:function(e,t,n,r){var i=r.scale(-n);if(i.norm()<1){var s=i.x,o=i.y,u=e.startPos.getc().moebiusTransformation(i);e.pos.setc(u.x,u.y),i.x=s,i.y=o}},linear:function(e,t,n){var r=e.startPos.getc(!0),i=e.endPos.getc(!0);e.pos.setc(this.compute(r.x,i.x,n),this.compute(r.y,i.y,n))},polar:function(e,t,n){var r=e.startPos.getp(!0),i=e.endPos.getp(),s=i.interpolate(r,n);e.pos.setp(s.theta,s.rho)},number:function(e,t,n,r,i){var s=e[r](t,"start"),o=e[r](t,"end");e[i](t,this.compute(s,o,n))},color:function(t,n,r,i,s){var o=e.hexToRgb(t[i](n,"start")),u=e.hexToRgb(t[i](n,"end")),a=this.compute,f=e.rgbToHex([parseInt(a(o[0],u[0],r)),parseInt(a(o[1],u[1],r)),parseInt(a(o[2],u[2],r))]);t[s](n,f)},"array-number":function(e,t,n,r,i){var s=e[r](t,"start"),o=e[r](t,"end"),u=[];for(var a=0,f=s.length;a=.95?o.labels.plotLabel(i,n,e):o.labels.hideLabel(n,!1)),u.restore(),n.visited=!l})},plotTree:function(e,t,n){var r=this,i=this.viz,s=i.canvas,o=this.config,u=s.getCtx(),a=e.getData("alpha");e.eachSubnode(function(i){if(t.plotSubtree(e,i)&&i.exist&&i.drawn){var o=e.getAdjacency(i.id);!n&&t.onBeforePlotLine(o),u.globalAlpha=Math.min(a,i.getData("alpha")),r.plotLine(o,s,n),!n&&t.onAfterPlotLine(o),r.plotTree(i,t,n)}}),e.drawn?(!n&&t.onBeforePlotNode(e),this.plotNode(e,s,n),!n&&t.onAfterPlotNode(e),!t.hideLabels&&t.withLabels&&a>=.95?this.labels.plotLabel(s,e,t):this.labels.hideLabel(e,!1)):this.labels.hideLabel(e,!0)},plotNode:function(e,t,n){var r=e.getData("type"),i=this.node.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=e.getData("alpha"),a=t.getCtx();a.lineWidth=s,a.fillStyle=a.strokeStyle=o,a.globalAlpha=u;for(var f in i)a[f]=e.getCanvasStyle(f);this.nodeTypes[r].render.call(this,e,t,n)}},plotLine:function(e,t,n){var r=e.getData("type"),i=this.edge.CanvasStyles;if(r!="none"){var s=e.getData("lineWidth"),o=e.getData("color"),u=t.getCtx();u.lineWidth=s,u.fillStyle=u.strokeStyle=o;for(var a in i)u[a]=e.getCanvasStyle(a);this.edgeTypes[r].render.call(this,e,t,n)}}},d.Label={},d.Label.Native=new t({plotLabel:function(e,t,n){function s(e,t){var n="",r=e;while(r.length>t){var i=r.substring(0,t),s=i.lastIndexOf(" "),o=i.lastIndexOf("\n");o!=-1&&(s=o),s==-1&&(s=t),n+=i.substring(0,s)+"\n",r=r.substring(s+1)}return n+r}var r=e.getCtx(),i=t.pos.getc(!0);r.font=t.getLabelData("style")+" "+t.getLabelData("size")+"px "+t.getLabelData("family"),r.textAlign=t.getLabelData("textAlign"),r.textBaseline=t.getLabelData("textBaseline");var o=s(t.name,30).split("\n");r.fillStyle="rgba(24,32,46, 1)",r.strokeStyle=t.getData("whiteCircle")?"#FFF":"rgba(24,32,46, 1)",r.lineWidth=2;var u=25*o.length,a,f=[];for(a=0;a=n.width||e.x<0||e.y>=n.height||e.y<0?!1:!0}}),d.Label.HTML=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){i=document.createElement("div");var s=this.getLabelContainer();i.id=r,i.className="node",i.style.position="absolute",n.onCreateLabel(i,t),s.appendChild(i),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Label.SVG=new t({Implements:d.Label.DOM,plotLabel:function(e,t,n){var r=t.id,i=this.getLabel(r);if(!i&&!(i=document.getElementById(r))){var s="http://www.w3.org/2000/svg";i=document.createElementNS(s,"svg:text");var o=document.createElementNS(s,"svg:tspan");i.appendChild(o);var u=this.getLabelContainer();i.setAttribute("id",r),i.setAttribute("class","node"),u.appendChild(i),n.onCreateLabel(i,t),this.labels[t.id]=i}this.placeLabel(i,t,n)}}),d.Geom=new t({initialize:function(e){this.viz=e,this.config=e.config,this.node=e.config.Node,this.edge=e.config.Edge},translate:function(t,n){n=e.splat(n),this.viz.graph.eachNode(function(r){e.each(n,function(e){r.getPos(e).$add(t)})})},setRightLevelToShow:function(t,n,r){var i=this.getRightLevelToShow(t,n),s=this.viz.labels,o=e.merge({execShow:!0,execHide:!0,onHide:e.empty,onShow:e.empty},r||{});t.eachLevel(0,this.config.levelsToShow,function(e){var n=e._depth-t._depth;n>i?(o.onHide(e),o.execHide&&(e.drawn=!1,e.exist=!1,s.hideLabel(e,!1))):(o.onShow(e),o.execShow&&(e.exist=!0))}),t.drawn=!0},getRightLevelToShow:function(e,t){var n=this.config,r=n.levelsToShow,i=n.constrained;if(!i)return r;while(!this.treeFitsInCanvas(e,t,r)&&r>1)r--;return r}});var y={construct:function(t){var n=e.type(t)=="array",r=new d(this.graphOptions,this.config.Node,this.config.Edge,this.config.Label);return n?function(t,n){var r=function(e){for(var r=0,i=n.length;rf?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=r){n.onComplete();return}}n.onStep(Math.round(i/(r-1)*100)),setTimeout(o,1)})();else for(;if[i]?s:f[i]:s}a.push(e)},"ignore"),s&&s.id==e.id&&a.length>0&&a[0].dist&&a.sort(function(e,t){return(e.dist>=t.dist)-(e.dist<=t.dist)});for(var l=0,h=a.length;l1&&s[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render(n,r,i,o,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.arrow.contains(n,r,t,this.edge.epsilon)}}})}($jit.ForceDirected),$jit.RGraph=new t({Implements:[y,a,b.Radial],initialize:function(t){var n=$jit.RGraph,r={interpolation:"linear",levelDistance:100};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),r,t);var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(s.background&&(s.background=e.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;i1&&s[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render(n,r,i,o,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.arrow.contains(n,r,t,this.edge.epsilon)}}})}($jit.RGraph),h.prototype.moebiusTransformation=function(e){var t=this.add(e),n=e.$conjugate().$prod(this);return n.x++,t.$div(n)},d.Util.moebiusTransformation=function(e,t,n,r,i){this.eachNode(e,function(e){for(var i=0;i").find(":last")[0];if(!i.getContext&&e.browser.msie)this.element=i=f.append("").find(":last")[0],i.src=t.src,i.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+r*100+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+n/u*100+")";else{s=i.getContext("2d");try{e(i).attr({width:o,height:n}),s.save(),s.translate(0,u-1),s.scale(1,-1),s.drawImage(t,0,0,o,u),s.restore(),s.globalCompositeOperation="destination-out",a=s.createLinearGradient(0,0,0,n),a.addColorStop(0,"rgba(255, 255, 255, "+(1-r)+")"),a.addColorStop(1,"rgba(255, 255, 255, 1.0)"),s.fillStyle=a,s.fillRect(0,0,o,n)}catch(l){return}}e(i).attr({alt:e(t).attr("alt"),title:e(t).attr("title")})}var n=function(n,r){this.orgWidth=n.width,this.orgHeight=n.height,this.image=n,this.reflection=null,this.alt=n.alt,this.title=n.title,this.imageOK=!1,this.options=r,this.imageOK=!0,this.options.reflHeight>0&&(this.reflection=new t(this.image,this.options.reflHeight,this.options.reflOpacity)),e(this.image).css("position","absolute")},r=function(t,r,i){var s=[],o=Math.sin,u=Math.cos,a=this;this.controlTimer=0,this.stopped=!1,this.container=t,this.xRadius=i.xRadius,this.yRadius=i.yRadius,this.showFrontTextTimer=0,this.autoRotateTimer=0,i.xRadius===0&&(this.xRadius=e(t).width()/2.3),i.yRadius===0&&(this.yRadius=e(t).height()/6),this.xCentre=i.xPos,this.yCentre=i.yPos,this.frontIndex=0,this.rotation=this.destRotation=Math.PI/2,this.timeDelay=1e3/i.FPS,i.altBox!==null&&(e(i.altBox).css("display","block"),e(i.titleBox).css("display","block")),e(t).css({position:"relative",overflow:"hidden"}),e(i.buttonLeft).css("display","inline"),e(i.buttonRight).css("display","inline"),e(i.buttonLeft).bind("mouseup",this,function(e){return e.data.rotate(-1),!1}),e(i.buttonRight).bind("mouseup",this,function(e){return e.data.rotate(1),!1}),e(".new_topic").bind("keydown",this,function(e){(e.keyCode==9||e.keyCode==9&&e.shiftKey)&&e.preventDefault()}),e(".new_topic").bind("keyup",this,function(e){e.keyCode==9&&e.shiftKey?e.data.rotate(-1):e.keyCode==9&&e.data.rotate(1)}),i.mouseWheel&&e(t).bind("mousewheel",this,function(e,t){return e.data.rotate(t),!1}),e(t).bind("mouseover click",this,function(t){clearInterval(t.data.autoRotateTimer);var n=e(t.target).attr("alt");if(n!==undefined&&n!==null){clearTimeout(t.data.showFrontTextTimer),e(i.altBox).html(e(t.target).attr("alt"));if(i.bringToFront&&t.type=="click"){e(i.titleBox).html(e(t.target).attr("title")),e("#topic_metacode").val(e(t.target).attr("title"));var s=e(t.target).data("itemIndex"),o=t.data.frontIndex,u=(s-o)%r.length;Math.abs(u)>r.length/2&&(u+=u>0?-r.length:r.length),t.data.rotate(-u)}}}),e(t).bind("mouseout",this,function(e){var t=e.data;clearTimeout(t.showFrontTextTimer),t.showFrontTextTimer=setTimeout(function(){t.showFrontText()},1e3),t.autoRotate()}),e(t).bind("mousedown",this,function(e){return e.data.container.focus(),!1}),t.onselectstart=function(){return!1},this.innerWrapper=e(t).wrapInner('
      ').children()[0],this.showFrontText=function(){if(s[this.frontIndex]===undefined)return;e("#topic_metacode").val(e(s[this.frontIndex].image).attr("title")),e("img.cloudcarousel").css({background:"none",width:"",height:""}),e(s[this.frontIndex].image).css({width:"45px",height:"45px"}),e(i.titleBox).html(e(s[this.frontIndex].image).attr("title")),e(i.altBox).html(e(s[this.frontIndex].image).attr("alt"))},this.go=function(){if(this.controlTimer!==0)return;var e=this;this.controlTimer=setTimeout(function(){e.updateAll()},this.timeDelay)},this.stop=function(){clearTimeout(this.controlTimer),this.controlTimer=0},this.rotate=function(e){this.frontIndex-=e,this.frontIndex==-1&&(this.frontIndex=s.length-1),this.frontIndex%=s.length,this.destRotation+=Math.PI/s.length*2*e,this.showFrontText(),this.go()},this.autoRotate=function(){if(i.autoRotate!=="no"){var e=i.autoRotate==="right"?1:-1;this.autoRotateTimer=setInterval(function(){a.rotate(e)},i.autoRotateDelay)}},this.updateAll=function(){var t=i.minScale,n=(1-t)*.5,r,a,f,l,c,h,p,d=this.destRotation-this.rotation,v=Math.abs(d);this.rotation+=d*i.speed,v<.001&&(this.rotation=this.destRotation);var m=s.length,g=Math.PI/m*2,y=this.rotation,b=e.browser.msie;this.innerWrapper.style.display="none";var w,E="px",S,x=this;for(var T=0;T>0,r=N.width=h.orgWidth*c,a=N.height=h.orgHeight*c,N.style.left=f+E,N.style.top=l+E,h.reflection!==null&&(S=i.reflHeight*c,w=h.reflection.element.style,w.left=f+E,w.top=l+a+i.reflGap*c+E,w.width=r+E,b?w.filter.finishy=S/a*100:w.height=S+E)}y+=g}this.innerWrapper.style.display="block",v>=.001?this.controlTimer=setTimeout(function(){x.updateAll()},this.timeDelay):this.stop()},this.checkImagesLoaded=function(){var t;for(t=0;t=0;u--){s=t[u];if(s&&typeof s=="object"&&e in s){i=s[e],o=!0;break}}return o?(!r&&typeof i=="function"&&(i=this.lv(i,t,n)),i):r?!1:""},ho:function(e,t,n,r,i){var s=this.c,o=this.options;o.delimiters=i;var r=e.call(t,r);return r=r==null?String(r):r.toString(),this.b(s.compile(r,o).render(t,n)),!1},b:t?function(e){this.buf.push(e)}:function(e){this.buf+=e},fl:t?function(){var e=this.buf.join("");return this.buf=[],e}:function(){var e=this.buf;return this.buf="",e},ls:function(e,t,n,r,i,s,o){var u=t[t.length-1],a=null;if(!r&&this.c&&e.length>0)return this.ho(e,u,n,this.text.substring(i,s),o);a=e.call(u);if(typeof a=="function"){if(r)return!0;if(this.c)return this.ho(a,u,n,this.text.substring(i,s),o)}return a},lv:function(e,t,n){var r=t[t.length-1],i=e.call(r);if(typeof i=="function"){i=a(i.call(r));if(this.c&&~i.indexOf("{{"))return this.c.compile(i,this.options).render(r,n)}return a(i)}};var n=/&/g,r=//g,s=/\'/g,o=/\"/g,u=/[&<>\"\']/,l=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(e){function u(e){e.n.substr(e.n.length-1)==="}"&&(e.n=e.n.substring(0,e.n.length-1))}function a(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function f(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r0){o=e.shift();if(o.tag=="#"||o.tag=="^"||c(o,r))n.push(o),o.nodes=l(e,o.tag,n,r),i.push(o);else{if(o.tag=="/"){if(n.length===0)throw new Error("Closing tag without opener: /"+o.n);s=n.pop();if(o.n!=s.n&&!h(o.n,s.n,r))throw new Error("Nesting error: "+s.n+" vs. "+o.n);return s.end=o.i,i}i.push(o)}}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return i}function c(e,t){for(var n=0,r=t.length;n"?t+=y(e[n]):i=="{"||i=="&"?t+=b(e[n].n,d(e[n].n)):i=="\n"?t+=E('"\\n"'+(e.length-1==n?"":" + i")):i=="_v"?t+=w(e[n].n,d(e[n].n)):i===undefined&&(t+=E('"'+p(e[n])+'"'))}return t}function m(e,t,n,r,i,s){return"if(_.s(_."+n+'("'+p(t)+'",c,p,1),'+"c,p,0,"+r+","+i+',"'+s+'")){'+"_.rs(c,p,"+"function(c,p,_){"+v(e)+"});c.pop();}"}function g(e,t,n){return"if(!_.s(_."+n+'("'+p(t)+'",c,p,1),c,p,1,0,0,"")){'+v(e)+"};"}function y(e){return'_.b(_.rp("'+p(e.n)+'",c,p,"'+(e.indent||"")+'"));'}function b(e,t){return"_.b(_.t(_."+t+'("'+p(e)+'",c,p,0)));'}function w(e,t){return"_.b(_.v(_."+t+'("'+p(e)+'",c,p,0)));'}function E(e){return"_.b("+e+");"}var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,s=/\\/g,o={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};e.scan=function(n,r){function S(){v.length>0&&(m.push(new String(v)),v="")}function x(){var e=!0;for(var n=b;n"&&(r.indent=m[n].toString()),m.splice(n,1));else t||m.push({tag:"\n"});g=!1,b=m.length}function N(e,t){var n="="+E,r=e.indexOf(n,t),i=a(e.substring(e.indexOf("=",t)+1,r)).split(" ");return w=i[0],E=i[1],r+n.length-1}var i=n.length,s=0,l=1,c=2,h=s,p=null,d=null,v="",m=[],g=!1,y=0,b=0,w="{{",E="}}";r&&(r=r.split(" "),w=r[0],E=r[1]);for(y=0;y").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function i(t,n,r,i){return e.each(s,function(){n-=parseFloat(e.curCSS(t,"padding"+this,!0))||0,r&&(n-=parseFloat(e.curCSS(t,"border"+this+"Width",!0))||0),i&&(n-=parseFloat(e.curCSS(t,"margin"+this,!0))||0)}),n}var s=r==="Width"?["Left","Right"]:["Top","Bottom"],o=r.toLowerCase(),u={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n) +{return n===t?u["inner"+r].call(this):this.each(function(){e(this).css(o,i(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?u["outer"+r].call(this,t):this.each(function(){e(this).css(o,i(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return n(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var r=e.attr(t,"tabindex"),i=isNaN(r);return(i||r>=0)&&n(t,!i)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e.curCSS||(e.curCSS=e.css),e.extend(e.ui,{plugin:{add:function(t,n,r){var i=e.ui[t].prototype;for(var s in r)i.plugins[s]=i.plugins[s]||[],i.plugins[s].push([n,r[s]])},call:function(e,t,n){var r=e.plugins[t];if(!r||!e.element[0].parentNode)return;for(var i=0;i0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target==this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){e.ui=e.ui||{};var n=/left|center|right/,r=/top|center|bottom/,i="center",s={},o=e.fn.position,u=e.fn.offset;e.fn.position=function(t){if(!t||!t.of)return o.apply(this,arguments);t=e.extend({},t);var u=e(t.of),l=u[0],h=(t.collision||"flip").split(" "),p=t.offset?t.offset.split(" "):[0,0],v,m,y;return l.nodeType===9?(v=u.width(),m=u.height(),y={top:0,left:0}):l.setTimeout?(v=u.width(),m=u.height(),y={top:u.scrollTop(),left:u.scrollLeft()}):l.preventDefault?(t.at="left top",v=m=0,y={top:t.of.pageY,left:t.of.pageX}):(v=u.outerWidth(),m=u.outerHeight(),y=u.offset()),e.each(["my","at"],function(){var e=(t[this]||"").split(" ");e.length===1&&(e=n.test(e[0])?e.concat([i]):r.test(e[0])?[i].concat(e):[i,i]),e[0]=n.test(e[0])?e[0]:i,e[1]=r.test(e[1])?e[1]:i,t[this]=e}),h.length===1&&(h[1]=h[0]),p[0]=parseInt(p[0],10)||0,p.length===1&&(p[1]=p[0]),p[1]=parseInt(p[1],10)||0,t.at[0]==="right"?y.left+=v:t.at[0]===i&&(y.left+=v/2),t.at[1]==="bottom"?y.top+=m:t.at[1]===i&&(y.top+=m/2),y.left+=p[0],y.top+=p[1],this.each(function(){var n=e(this),r=n.outerWidth(),o=n.outerHeight(),u=parseInt(e.curCSS(this,"marginLeft",!0))||0,l=parseInt(e.curCSS(this,"marginTop",!0))||0,c=r+u+(parseInt(e.curCSS(this,"marginRight",!0))||0),d=o+l+(parseInt(e.curCSS(this,"marginBottom",!0))||0),g=e.extend({},y),w;t.my[0]==="right"?g.left-=r:t.my[0]===i&&(g.left-=r/2),t.my[1]==="bottom"?g.top-=o:t.my[1]===i&&(g.top-=o/2),s.fractions||(g.left=Math.round(g.left),g.top=Math.round(g.top)),w={left:g.left-u,top:g.top-l},e.each(["left","top"],function(n,i){e.ui.position[h[n]]&&e.ui.position[h[n]][i](g,{targetWidth:v,targetHeight:m,elemWidth:r,elemHeight:o,collisionPosition:w,collisionWidth:c,collisionHeight:d,offset:p,my:t.my,at:t.at})}),e.fn.bgiframe&&n.bgiframe(),n.offset(e.extend(g,{using:t.using}))})},e.ui.position={fit:{left:function(t,n){var r=e(window),i=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft();t.left=i>0?t.left-i:Math.max(t.left-n.collisionPosition.left,t.left)},top:function(t,n){var r=e(window),i=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop();t.top=i>0?t.top-i:Math.max(t.top-n.collisionPosition.top,t.top)}},flip:{left:function(t,n){if(n.at[0]===i)return;var r=e(window),s=n.collisionPosition.left+n.collisionWidth-r.width()-r.scrollLeft(),o=n.my[0]==="left"?-n.elemWidth:n.my[0]==="right"?n.elemWidth:0,u=n.at[0]==="left"?n.targetWidth:-n.targetWidth,f=-2*n.offset[0];t.left+=n.collisionPosition.left<0?o+u+f:s>0?o+u+f:0},top:function(t,n){if(n.at[1]===i)return;var r=e(window),s=n.collisionPosition.top+n.collisionHeight-r.height()-r.scrollTop(),o=n.my[1]==="top"?-n.elemHeight:n.my[1]==="bottom"?n.elemHeight:0,u=n.at[1]==="top"?n.targetHeight:-n.targetHeight,f=-2*n.offset[1];t.top+=n.collisionPosition.top<0?o+u+f:s>0?o+u+f:0}}},e.offset.setOffset||(e.offset.setOffset=function(t,n){/static/.test(e.curCSS(t,"position"))&&(t.style.position="relative");var r=e(t),i=r.offset(),s=parseInt(e.curCSS(t,"top",!0),10)||0,o=parseInt(e.curCSS(t,"left",!0),10)||0,u={top:n.top-i.top+s,left:n.left-i.left+o};"using"in n?n.using.call(t,u):r.css(u)},e.fn.offset=function(t){var n=this[0];return!n||!n.ownerDocument?null:t?e.isFunction(t)?this.each(function(n){e(this).offset(t.call(this,n,e(this).offset()))}):this.each(function(){e.offset.setOffset(this,t)}):u.call(this)}),e.curCSS||(e.curCSS=e.css),function(){var t=document.getElementsByTagName("body")[0],n=document.createElement("div"),r,i,o,u,l;r=document.createElement(t?"div":"body"),o={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},t&&e.extend(o,{position:"absolute",left:"-1000px",top:"-1000px"});for(var c in o)r.style[c]=o[c];r.appendChild(n),i=t||document.documentElement,i.insertBefore(r,i.firstChild),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),l=u.top+u.left+(t?2e3:0),s.fractions=l>21&&l<22}()}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(n.iframeFix&&e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
      ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&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.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.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var l=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?l-this.offset.click.topu[3]?l-this.offset.click.topu[2]?c-this.offset.click.left=0;c--){var h=r.snapElements[c].left,p=h+r.snapElements[c].width,d=r.snapElements[c].top,v=d+r.snapElements[c].height;if(!(h-s
      ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i=document.activeElement;try{i.id}catch(s){i=document.body}return t.wrap(r),(t[0]===i||e.contains(t[0],i))&&e(i).focus(),r=t.parent(),t.css("position")=="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),r.css(n).show()},removeWrapper:function(t){var n,r=document.activeElement;return t.parent().is(".ui-effects-wrapper")?(n=t.parent().replaceWith(t),(t[0]===r||e.contains(t[0],r))&&e(r).focus(),n):t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(t,n,r,i){var s=u.apply(this,arguments),o={options:s[1],duration:s[2],callback:s[3]},a=o.options.mode,f=e.effects[t];return e.fx.off||!f?a?this[a](o.duration,o.callback):this.each(function(){o.callback&&o.callback.call(this)}):f.call(this,o)},_show:e.fn.show,show:function(e){if(a(e))return this._show.apply(this,arguments);var t=u.apply(this,arguments);return t[1].mode="show",this.effect.apply(this,t)},_hide:e.fn.hide,hide:function(e){if(a(e))return this._hide.apply(this,arguments);var t=u.apply(this,arguments);return t[1].mode="hide",this.effect.apply(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(a(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=u.apply(this,arguments);return n[1].mode="toggle",this.effect.apply(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}});var h={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){h[t]=function(t){return Math.pow(t,e+2)}}),e.extend(h,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(h,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:n(e*-2+2)/-2+1}})}(jQuery),function(e){var t={init:function(t){var n={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:950,mouseWheel:!0,mouseWheelPixels:"auto",autoDraggerLength:!0,autoHideScrollbar:!1,alwaysShowScrollbar:!1,snapAmount:null,snapOffset:0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1,autoScrollOnFocus:!0,normalizeMouseWheelDelta:!1},contentTouchScroll:!0,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},t=e.extend(!0,n,t);return this.each(function(){var n=e(this);t.set_width&&n.css("width",t.set_width),t.set_height&&n.css("height",t.set_height);if(!e(document).data("mCustomScrollbar-index"))e(document).data("mCustomScrollbar-index","1");else{var r=parseInt(e(document).data("mCustomScrollbar-index"));e(document).data("mCustomScrollbar-index",r+1)}n.wrapInner("
      ").addClass("mCustomScrollbar _mCS_"+e(document).data("mCustomScrollbar-index"));var i=n.children(".mCustomScrollBox");if(t.horizontalScroll){i.addClass("mCSB_horizontal").wrapInner("
      ");var s=i.children(".mCSB_h_wrapper");s.wrapInner("
      ").children(".mCSB_container").css({width:s.children().outerWidth(),position:"relative"}).unwrap()}else i.wrapInner("
      ");var o=i.children(".mCSB_container");e.support.touch&&o.addClass("mCS_touch"),o.after("
      ");var u=i.children(".mCSB_scrollTools"),a=u.children(".mCSB_draggerContainer"),f=a.children(".mCSB_dragger");t.horizontalScroll?f.data("minDraggerWidth",f.width()):f.data("minDraggerHeight",f.height()),t.scrollButtons.enable&&(t.horizontalScroll?u.prepend("").append(""):u.prepend("").append("")),i.bind("scroll",function(){n.is(".mCS_disabled")||i.scrollTop(0).scrollLeft(0)}),n.data({mCS_Init:!0,mCustomScrollbarIndex:e(document).data("mCustomScrollbar-index"),horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:t.mouseWheel,mouseWheelPixels:t.mouseWheelPixels,autoDraggerLength:t.autoDraggerLength,autoHideScrollbar:t.autoHideScrollbar,alwaysShowScrollbar:t.alwaysShowScrollbar,snapAmount:t.snapAmount,snapOffset:t.snapOffset,scrollButtons_enable:t.scrollButtons.enable,scrollButtons_scrollType:t.scrollButtons.scrollType,scrollButtons_scrollSpeed:t.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:t.scrollButtons.scrollAmount,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:t.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:t.advanced.normalizeMouseWheelDelta,contentTouchScroll:t.contentTouchScroll,onScrollStart_Callback:t.callbacks.onScrollStart,onScroll_Callback:t.callbacks.onScroll,onTotalScroll_Callback:t.callbacks.onTotalScroll,onTotalScrollBack_Callback:t.callbacks.onTotalScrollBack,onTotalScroll_Offset:t.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:t.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:t.callbacks.whileScrolling,bindEvent_scrollbar_drag:!1,bindEvent_content_touch:!1,bindEvent_scrollbar_click:!1,bindEvent_mousewheel:!1,bindEvent_buttonsContinuous_y:!1,bindEvent_buttonsContinuous_x:!1,bindEvent_buttonsPixels_y:!1,bindEvent_buttonsPixels_x:!1,bindEvent_focusin:!1,bindEvent_autoHideScrollbar:!1,mCSB_buttonScrollRight:!1,mCSB_buttonScrollLeft:!1,mCSB_buttonScrollDown:!1,mCSB_buttonScrollUp:!1});if(t.horizontalScroll)n.css("max-width")!=="none"&&(t.advanced.updateOnContentResize||(t.advanced.updateOnContentResize=!0));else if(n.css("max-height")!=="none"){var l=!1,h=parseInt(n.css("max-height"));n.css("max-height").indexOf("%")>=0&&(l=h,h=n.parent().height()*l/100),n.css("overflow","hidden"),i.css("max-height",h)}n.mCustomScrollbar("update");if(t.advanced.updateOnBrowserResize){var p,d=e(window).width(),v=e(window).height();e(window).bind("resize."+n.data("mCustomScrollbarIndex"),function(){p&&clearTimeout(p),p=setTimeout(function(){if(!n.is(".mCS_disabled")&&!n.is(".mCS_destroyed")){var t=e(window).width(),r=e(window).height();if(d!==t||v!==r)n.css("max-height")!=="none"&&l&&i.css("max-height",n.parent().height()*l/100),n.mCustomScrollbar("update"),d=t,v=r}},150)})}if(t.advanced.updateOnContentResize){var m;if(t.horizontalScroll)var g=o.outerWidth();else var g=o.outerHeight();m=setInterval(function(){if(t.horizontalScroll){t.advanced.autoExpandHorizontalScroll&&o.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:o.outerWidth(),position:"relative"}).unwrap();var e=o.outerWidth()}else var e=o.outerHeight();e!=g&&(n.mCustomScrollbar("update"),g=e)},300)}})},update:function(){var t=e(this),n=t.children(".mCustomScrollBox"),r=n.children(".mCSB_container");r.removeClass("mCS_no_scrollbar"),t.removeClass("mCS_disabled mCS_destroyed"),n.scrollTop(0).scrollLeft(0);var i=n.children(".mCSB_scrollTools"),s=i.children(".mCSB_draggerContainer"),o=s.children(".mCSB_dragger");if(t.data("horizontalScroll")){var u=i.children(".mCSB_buttonLeft"),a=i.children(".mCSB_buttonRight"),f=n.width();t.data("autoExpandHorizontalScroll")&&r.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:r.outerWidth(),position:"relative"}).unwrap();var l=r.outerWidth()}else var h=i.children(".mCSB_buttonUp"),p=i.children(".mCSB_buttonDown"),d=n.height(),v=r.outerHeight();if(v>d&&!t.data("horizontalScroll")){i.css("display","block");var m=s.height();if(t.data("autoDraggerLength")){var g=Math.round(d/v*m),y=o.data("minDraggerHeight");if(g<=y)o.css({height:y});else if(g>=m-10){var b=m-10;o.css({height:b})}else o.css({height:g});o.children(".mCSB_dragger_bar").css({"line-height":o.height()+"px"})}var w=o.height(),E=(v-d)/(m-w);t.data("scrollAmount",E).mCustomScrollbar("scrolling",n,r,s,o,h,p,u,a);var S=Math.abs(r.position().top);t.mCustomScrollbar("scrollTo",S,{scrollInertia:0,trigger:"internal"})}else if(l>f&&t.data("horizontalScroll")){i.css("display","block");var x=s.width();if(t.data("autoDraggerLength")){var T=Math.round(f/l*x),N=o.data("minDraggerWidth");if(T<=N)o.css({width:N});else if(T>=x-10){var C=x-10;o.css({width:C})}else o.css({width:T})}var k=o.width(),E=(l-f)/(x-k);t.data("scrollAmount",E).mCustomScrollbar("scrolling",n,r,s,o,h,p,u,a);var S=Math.abs(r.position().left);t.mCustomScrollbar("scrollTo",S,{scrollInertia:0,trigger:"internal"})}else n.unbind("mousewheel focusin"),t.data("horizontalScroll")?o.add(r).css("left",0):o.add(r).css("top",0),t.data("alwaysShowScrollbar")?t.data("horizontalScroll")?t.data("horizontalScroll")&&o.css({width:s.width()}):o.css({height:s.height()}):(i.css("display","none"),r.addClass("mCS_no_scrollbar")),t.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1})},scrolling:function(t,r,i,s,o,u,a,f){function y(e,t,n,r){l.data("horizontalScroll")?l.mCustomScrollbar("scrollTo",s.position().left-t+r,{moveDragger:!0,trigger:"internal"}):l.mCustomScrollbar("scrollTo",s.position().top-e+n,{moveDragger:!0,trigger:"internal"})}var l=e(this);if(!l.data("bindEvent_scrollbar_drag")){var h,p,v,m,g;e.support.pointer?(v="pointerdown",m="pointermove",g="pointerup"):e.support.msPointer&&(v="MSPointerDown",m="MSPointerMove",g="MSPointerUp"),e.support.pointer||e.support.msPointer?(s.bind(v,function(t){t.preventDefault(),l.data({on_drag:!0}),s.addClass("mCSB_dragger_onDrag");var n=e(this),r=n.offset(),i=t.originalEvent.pageX-r.left,o=t.originalEvent.pageY-r.top;i0&&o0&&(h=o,p=i)}),e(document).bind(m+"."+l.data("mCustomScrollbarIndex"),function(e){e.preventDefault();if(l.data("on_drag")){var t=s,n=t.offset(),r=e.originalEvent.pageX-n.left,i=e.originalEvent.pageY-n.top;y(h,p,i,r)}}).bind(g+"."+l.data("mCustomScrollbarIndex"),function(e){l.data({on_drag:!1}),s.removeClass("mCSB_dragger_onDrag")})):(s.bind("mousedown touchstart",function(t){t.preventDefault(),t.stopImmediatePropagation();var n=e(this),r=n.offset(),i,o;if(t.type==="touchstart"){var u=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];i=u.pageX-r.left,o=u.pageY-r.top}else l.data({on_drag:!0}),s.addClass("mCSB_dragger_onDrag"),i=t.pageX-r.left,o=t.pageY-r.top;i0&&o0&&(h=o,p=i)}).bind("touchmove",function(t){t.preventDefault(),t.stopImmediatePropagation();var n=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=e(this),i=r.offset(),s=n.pageX-i.left,o=n.pageY-i.top;y(h,p,o,s)}),e(document).bind("mousemove."+l.data("mCustomScrollbarIndex"),function(e){if(l.data("on_drag")){var t=s,n=t.offset(),r=e.pageX-n.left,i=e.pageY-n.top;y(h,p,i,r)}}).bind("mouseup."+l.data("mCustomScrollbarIndex"),function(e){l.data({on_drag:!1}),s.removeClass("mCSB_dragger_onDrag")})),l.data({bindEvent_scrollbar_drag:!0})}if(e.support.touch&&l.data("contentTouchScroll")&&!l.data("bindEvent_content_touch")){var b,w,E,S,x,T,N;r.bind("touchstart",function(t){t.stopImmediatePropagation(),b=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],w=e(this),E=w.offset(),x=b.pageX-E.left,S=b.pageY-E.top,T=S,N=x}),r.bind("touchmove",function(t){t.preventDefault(),t.stopImmediatePropagation(),b=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],w=e(this).parent(),E=w.offset(),x=b.pageX-E.left,S=b.pageY-E.top,l.data("horizontalScroll")?l.mCustomScrollbar("scrollTo",N-x,{trigger:"internal"}):l.mCustomScrollbar("scrollTo",T-S,{trigger:"internal"})})}l.data("bindEvent_scrollbar_click")||(i.bind("click",function(t){var n=(t.pageY-i.offset().top)*l.data("scrollAmount"),r=e(t.target);l.data("horizontalScroll")&&(n=(t.pageX-i.offset().left)*l.data("scrollAmount")),(r.hasClass("mCSB_draggerContainer")||r.hasClass("mCSB_draggerRail"))&&l.mCustomScrollbar("scrollTo",n,{trigger:"internal",scrollEasing:"draggerRailEase"})}),l.data({bindEvent_scrollbar_click:!0})),l.data("mouseWheel")&&(l.data("bindEvent_mousewheel")||(t.bind("mousewheel",function(e,t){var n,o=l.data("mouseWheelPixels"),u=Math.abs(r.position().top),a=s.position().top,f=i.height()-s.height();l.data("normalizeMouseWheelDelta")&&(t<0?t=-1:t=1),o==="auto"&&(o=100+Math.round(l.data("scrollAmount")/2)),l.data("horizontalScroll")&&(a=s.position().left,f=i.width()-s.width(),u=Math.abs(r.position().left));if(t>0&&a!==0||t<0&&a!==f)e.preventDefault(),e.stopImmediatePropagation();n=u-t*o,l.mCustomScrollbar("scrollTo",n,{trigger:"internal"})}),l.data({bindEvent_mousewheel:!0})));if(l.data("scrollButtons_enable"))if(l.data("scrollButtons_scrollType")==="pixels"){l.data("horizontalScroll")?(f.add(a).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",k,L),l.data({bindEvent_buttonsContinuous_x:!1}),l.data("bindEvent_buttonsPixels_x")||(f.bind("click",function(e){e.preventDefault(),C(Math.abs(r.position().left)+l.data("scrollButtons_scrollAmount"))}),a.bind("click",function(e){e.preventDefault(),C(Math.abs(r.position().left)-l.data("scrollButtons_scrollAmount"))}),l.data({bindEvent_buttonsPixels_x:!0}))):(u.add(o).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",k,L),l.data({bindEvent_buttonsContinuous_y:!1}),l.data("bindEvent_buttonsPixels_y")||(u.bind("click",function(e){e.preventDefault(),C(Math.abs(r.position().top)+l.data("scrollButtons_scrollAmount"))}),o.bind("click",function(e){e.preventDefault(),C(Math.abs(r.position().top)-l.data("scrollButtons_scrollAmount"))}),l.data({bindEvent_buttonsPixels_y:!0})));function C(e){s.data("preventAction")||(s.data("preventAction",!0),l.mCustomScrollbar("scrollTo",e,{trigger:"internal"}))}}else{if(l.data("horizontalScroll")){f.add(a).unbind("click"),l.data({bindEvent_buttonsPixels_x:!1});if(!l.data("bindEvent_buttonsContinuous_x")){f.bind("mousedown touchstart MSPointerDown pointerdown",function(e){e.preventDefault();var t=M();l.data({mCSB_buttonScrollRight:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(r.position().left)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var k=function(e){e.preventDefault(),clearInterval(l.data("mCSB_buttonScrollRight"))};f.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",k),a.bind("mousedown touchstart MSPointerDown pointerdown",function(e){e.preventDefault();var t=M();l.data({mCSB_buttonScrollLeft:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(r.position().left)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var L=function(e){e.preventDefault(),clearInterval(l.data("mCSB_buttonScrollLeft"))};a.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",L),l.data({bindEvent_buttonsContinuous_x:!0})}}else{u.add(o).unbind("click"),l.data({bindEvent_buttonsPixels_y:!1});if(!l.data("bindEvent_buttonsContinuous_y")){u.bind("mousedown touchstart MSPointerDown pointerdown",function(e){e.preventDefault();var t=M();l.data({mCSB_buttonScrollDown:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(r.position().top)+t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var A=function(e){e.preventDefault(),clearInterval(l.data("mCSB_buttonScrollDown"))};u.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",A),o.bind("mousedown touchstart MSPointerDown pointerdown",function(e){e.preventDefault();var t=M();l.data({mCSB_buttonScrollUp:setInterval(function(){l.mCustomScrollbar("scrollTo",Math.abs(r.position().top)-t,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var O=function(e){e.preventDefault(),clearInterval(l.data("mCSB_buttonScrollUp"))};o.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",O),l.data({bindEvent_buttonsContinuous_y:!0})}}function M(){var e=l.data("scrollButtons_scrollSpeed");return l.data("scrollButtons_scrollSpeed")==="auto"&&(e=Math.round((l.data("scrollInertia")+100)/40)),e}}l.data("autoScrollOnFocus")&&(l.data("bindEvent_focusin")||(t.bind("focusin",function(){t.scrollTop(0).scrollLeft(0);var n=e(document.activeElement);if(n.is("input,textarea,select,button,a[tabindex],area,object")){var i=r.position().top,s=n.position().top,o=t.height()-n.outerHeight();l.data("horizontalScroll")&&(i=r.position().left,s=n.position().left,o=t.width()-n.outerWidth()),(i+s<0||i+s>o)&&l.mCustomScrollbar("scrollTo",s,{trigger:"internal"})}}),l.data({bindEvent_focusin:!0}))),l.data("autoHideScrollbar")&&!l.data("alwaysShowScrollbar")&&(l.data("bindEvent_autoHideScrollbar")||(t.bind("mouseenter",function(e){t.addClass("mCS-mouse-over"),n.showScrollbar.call(t.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(e){t.removeClass("mCS-mouse-over"),e.type==="mouseleave"&&n.hideScrollbar.call(t.children(".mCSB_scrollTools"))}),l.data({bindEvent_autoHideScrollbar:!0})))},scrollTo:function(t,r){function E(e){if(i.data("mCustomScrollbarIndex")){this.mcs={top:a.position().top,left:a.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round(100*Math.abs(a.position().top)/Math.abs(a.outerHeight()-u.height())),leftPct:Math.round(100*Math.abs(a.position().left)/Math.abs(a.outerWidth()-u.width()))};switch(e){case"onScrollStart":i.data("mCS_tweenRunning",!0).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs)}}}var i=e(this),s={moveDragger:!1,trigger:"external",callbacks:!0,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},r=e.extend(s,r),o,u=i.children(".mCustomScrollBox"),a=u.children(".mCSB_container"),f=u.children(".mCSB_scrollTools"),l=f.children(".mCSB_draggerContainer"),h=l.children(".mCSB_dragger"),p=draggerSpeed=r.scrollInertia,v,m,g,y;if(!a.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:r.trigger}),i.data("mCS_Init")&&(r.callbacks=!1);if(t||t===0){if(typeof t=="number")r.moveDragger?(o=t,i.data("horizontalScroll")?t=h.position().left*i.data("scrollAmount"):t=h.position().top*i.data("scrollAmount"),draggerSpeed=0):o=t/i.data("scrollAmount");else if(typeof t=="string"){var b;t==="top"?b=0:t==="bottom"&&!i.data("horizontalScroll")?b=a.outerHeight()-u.height():t==="left"?b=0:t==="right"&&i.data("horizontalScroll")?b=a.outerWidth()-u.width():t==="first"?b=i.find(".mCSB_container").find(":first"):t==="last"?b=i.find(".mCSB_container").find(":last"):b=i.find(t),b.length===1?(i.data("horizontalScroll")?t=b.position().left:t=b.position().top,o=t/i.data("scrollAmount")):o=t=b}if(i.data("horizontalScroll")){i.data("onTotalScrollBack_Offset")&&(m=-i.data("onTotalScrollBack_Offset")),i.data("onTotalScroll_Offset")&&(y=u.width()-a.outerWidth()+i.data("onTotalScroll_Offset")),o<0?(o=t=0,clearInterval(i.data("mCSB_buttonScrollLeft")),m||(v=!0)):o>=l.width()-h.width()?(o=l.width()-h.width(),t=u.width()-a.outerWidth(),clearInterval(i.data("mCSB_buttonScrollRight")),y||(g=!0)):t=-t;var w=i.data("snapAmount");w&&(t=Math.round(t/w)*w-i.data("snapOffset")),n.mTweenAxis.call(this,h[0],"left",Math.round(o),draggerSpeed,r.scrollEasing),n.mTweenAxis.call(this,a[0],"left",Math.round(t),p,r.scrollEasing,{onStart:function(){r.callbacks&&!i.data("mCS_tweenRunning")&&E("onScrollStart"),i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")&&n.showScrollbar.call(f)},onUpdate:function(){r.callbacks&&E("whileScrolling")},onComplete:function(){r.callbacks&&(E("onScroll"),(v||m&&a.position().left>=m)&&E("onTotalScrollBack"),(g||y&&a.position().left<=y)&&E("onTotalScroll")),h.data("preventAction",!1),i.data("mCS_tweenRunning",!1),i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")&&(u.hasClass("mCS-mouse-over")||n.hideScrollbar.call(f))}})}else{i.data("onTotalScrollBack_Offset")&&(m=-i.data("onTotalScrollBack_Offset")),i.data("onTotalScroll_Offset")&&(y=u.height()-a.outerHeight()+i.data("onTotalScroll_Offset")),o<0?(o=t=0,clearInterval(i.data("mCSB_buttonScrollUp")),m||(v=!0)):o>=l.height()-h.height()?(o=l.height()-h.height(),t=u.height()-a.outerHeight(),clearInterval(i.data("mCSB_buttonScrollDown")),y||(g=!0)):t=-t;var w=i.data("snapAmount");w&&(t=Math.round(t/w)*w-i.data("snapOffset")),n.mTweenAxis.call(this,h[0],"top",Math.round(o),draggerSpeed,r.scrollEasing),n.mTweenAxis.call(this,a[0],"top",Math.round(t),p,r.scrollEasing,{onStart:function(){r.callbacks&&!i.data("mCS_tweenRunning")&&E("onScrollStart"),i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")&&n.showScrollbar.call(f)},onUpdate:function(){r.callbacks&&E("whileScrolling")},onComplete:function(){r.callbacks&&(E("onScroll"),(v||m&&a.position().top>=m)&&E("onTotalScrollBack"),(g||y&&a.position().top<=y)&&E("onTotalScroll")),h.data("preventAction",!1),i.data("mCS_tweenRunning",!1),i.data("autoHideScrollbar")&&!i.data("alwaysShowScrollbar")&&(u.hasClass("mCS-mouse-over")||n.hideScrollbar.call(f))}})}i.data("mCS_Init")&&i.data({mCS_Init:!1})}}},stop:function(){var t=e(this),r=t.children().children(".mCSB_container"),i=t.children().children().children().children(".mCSB_dragger");n.mTweenAxisStop.call(this,r[0]),n.mTweenAxisStop.call(this,i[0])},disable:function(t){var n=e(this),r=n.children(".mCustomScrollBox"),i=r.children(".mCSB_container"),s=r.children(".mCSB_scrollTools"),o=s.children().children(".mCSB_dragger");r.unbind("mousewheel focusin mouseenter mouseleave touchend"),i.unbind("touchstart touchmove"),t&&(n.data("horizontalScroll")?o.add(i).css("left",0):o.add(i).css("top",0)),s.css("display","none"),i.addClass("mCS_no_scrollbar"),n.data({bindEvent_mousewheel:!1,bindEvent_focusin:!1,bindEvent_content_touch:!1,bindEvent_autoHideScrollbar:!1}).addClass("mCS_disabled")},destroy:function(){var t=e(this);t.removeClass("mCustomScrollbar _mCS_"+t.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove(),e(document).unbind("mousemove."+t.data("mCustomScrollbarIndex")+" mouseup."+t.data("mCustomScrollbarIndex")+" MSPointerMove."+t.data("mCustomScrollbarIndex")+" MSPointerUp."+t.data("mCustomScrollbarIndex")),e(window).unbind("resize."+t.data("mCustomScrollbarIndex"))}},n={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(e,t,n,r,i,s){function v(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()}function m(){c||o.call(),c=v()-f,g(),c>=e._time&&(e._time=c>e._time?c+l-(c-e._time):c+l-1,e._time0?(e.currVal=w(e._time,h,d,r,i),p[t]=Math.round(e.currVal)+"px"):p[t]=n+"px",u.call()}function y(){l=1e3/60,e._time=c+l,_request=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return g(),setTimeout(e,.01)},e._id=_request(m)}function b(){if(e._id==null)return;window.requestAnimationFrame?window.cancelAnimationFrame(e._id):clearTimeout(e._id),e._id=null}function w(e,t,n,r,i){switch(i){case"linear":return n*e/r+t;case"easeOutQuad":return e/=r,-n*e*(e-2)+t;case"easeInOutQuad":e/=r/2;if(e<1)return n/2*e*e+t;return e--,-n/2*(e*(e-2)-1)+t;case"easeOutCubic":return e/=r,e--,n*(e*e*e+1)+t;case"easeOutQuart":return e/=r,e--,-n*(e*e*e*e-1)+t;case"easeOutQuint":return e/=r,e--,n*(e*e*e*e*e+1)+t;case"easeOutCirc":return e/=r,e--,n*Math.sqrt(1-e*e)+t;case"easeOutSine":return n*Math.sin(e/r*(Math.PI/2))+t;case"easeOutExpo":return n*(-Math.pow(2,-10*e/r)+1)+t;case"mcsEaseOut":var s=(e/=r)*e,o=s*e;return t+n*(.499999999999997*o*s+ -2.5*s*s+5.5*o+ -6.5*s+4*e);case"draggerRailEase":e/=r/2;if(e<1)return n/2*e*e*e+t;return e-=2,n/2*(e*e*e+2)+t}}var s=s||{},o=s.onStart||function(){},u=s.onUpdate||function(){},a=s.onComplete||function(){},f=v(),l,c=0,h=e.offsetTop,p=e.style;t==="left"&&(h=e.offsetLeft);var d=n-h;b(),y()},mTweenAxisStop:function(e){if(e._id==null)return;window.requestAnimationFrame?window.cancelAnimationFrame(e._id):clearTimeout(e._id),e._id=null},rafPolyfill:function(){var e=["ms","moz","webkit","o"],t=e.length;while(--t>-1&&!window.requestAnimationFrame)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"]}};n.rafPolyfill.call(),e.support.touch="ontouchstart"in window,e.support.pointer=window.navigator.pointerEnabled,e.support.msPointer=window.navigator.msPointerEnabled;var r="https:"==document.location.protocol?"https:":"http:";e.event.special.mousewheel||document.write(''),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),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var n=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var r=n.length;r;)e.event.fixHooks[n[--r]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=n.length;e;)this.addEventListener(n[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=n.length;e;)this.removeEventListener(n[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);var io="undefined"==typeof module?{}:module.exports;(function(){(function(e,t){var n=e;n.version="0.9.11",n.protocol=1,n.transports=[],n.j=[],n.sockets={},n.connect=function(e,r){var i=n.util.parseUri(e),s,o;t&&t.location&&(i.protocol=i.protocol||t.location.protocol.slice(0,-1),i.host=i.host||(t.document?t.document.domain:t.location.hostname),i.port=i.port||t.location.port),s=n.util.uniqueUri(i);var u={host:i.host,secure:"https"==i.protocol,port:i.port||("https"==i.protocol?443:80),query:i.query||""};n.util.merge(u,r);if(u["force new connection"]||!n.sockets[s])o=new n.Socket(u);return!u["force new connection"]&&o&&(n.sockets[s]=o),o=o||n.sockets[s],o.of(i.path.length>1?i.path:"")}})("object"==typeof module?module.exports:this.io={},this),function(e,t){var n=e.util={},r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.parseUri=function(e){var t=r.exec(e||""),n={},s=14;while(s--)n[i[s]]=t[s]||"";return n},n.uniqueUri=function(e){var n=e.protocol,r=e.host,i=e.port;return"document"in t?(r=r||document.domain,i=i||(n=="https"&&document.location.protocol!=="https:"?443:document.location.port)):(r=r||"localhost",!i&&n=="https"&&(i=443)),(n||"http")+"://"+r+":"+(i||80)},n.query=function(e,t){var r=n.chunkQuery(e||""),i=[];n.merge(r,n.chunkQuery(t||""));for(var s in r)r.hasOwnProperty(s)&&i.push(s+"="+r[s]);return i.length?"?"+i.join("&"):""},n.chunkQuery=function(e){var t={},n=e.split("&"),r=0,i=n.length,s;for(;rt.length?e:t,s=e.length>t.length?t:e;for(var o=0,u=s.length;o0&&e.splice(0,1)[0]!=n.transport.name);e.length?u(e):n.publish("connect_failed")}}},n.options["connect timeout"]))})}n.sessionid=r,n.closeTimeout=s*1e3,n.heartbeatTimeout=i*1e3,n.transports||(n.transports=n.origTransports=o?t.util.intersect(o.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),u(n.transports),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),e&&typeof e=="function"&&e()})}),this},r.prototype.setHeartbeatTimeout=function(){clearTimeout(this.heartbeatTimeoutTimer);if(this.transport&&!this.transport.heartbeats())return;var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport.onClose()},this.heartbeatTimeout)},r.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},r.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},r.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},r.prototype.disconnect=function(){if(this.connected||this.connecting)this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted");return this},r.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},r.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},r.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},r.prototype.onOpen=function(){this.open=!0},r.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},r.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},r.prototype.onError=function(e){e&&e.advice&&e.advice==="reconnect"&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},r.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1;if(t||n)this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect())},r.prototype.reconnect=function(){function i(){if(e.connected){for(var t in e.namespaces)e.namespaces.hasOwnProperty(t)&&""!==t&&e.namespaces[t].packet({type:"connect"});e.publish("reconnect",e.transport.name,e.reconnectionAttempts)}clearTimeout(e.reconnectionTimer),e.removeListener("connect_failed",s),e.removeListener("connect",s),e.reconnecting=!1,delete e.reconnectionAttempts,delete e.reconnectionDelay,delete e.reconnectionTimer,delete e.redoTransports,e.options["try multiple transports"]=n}function s(){if(!e.reconnecting)return;if(e.connected)return i();if(e.connecting&&e.reconnecting)return e.reconnectionTimer=setTimeout(s,1e3);e.reconnectionAttempts++>=t?e.redoTransports?(e.publish("reconnect_failed"),i()):(e.on("connect_failed",s),e.options["try multiple transports"]=!0,e.transports=e.origTransports,e.transport=e.getTransport(),e.redoTransports=!0,e.connect()):(e.reconnectionDelay=10:!1},n.xdomainCheck=function(){return!0},typeof window!="undefined"&&(WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),t.transports.push("flashsocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports);if("undefined"!=typeof window)var swfobject=function(){function C(){if(b)return;try{var e=a.getElementsByTagName("body")[0].appendChild(U("span"));e.parentNode.removeChild(e)}catch(t){return}b=!0;var n=c.length;for(var r=0;r0)for(var n=0;n0){var o=R(r);if(o)if(W(h[n].swfVersion)&&!(T.wk&&T.wk<312))V(r,!0),i&&(s.success=!0,s.ref=_(r),i(s));else if(h[n].expressInstall&&D()){var u={};u.data=h[n].expressInstall,u.width=o.getAttribute("width")||"0",u.height=o.getAttribute("height")||"0",o.getAttribute("class")&&(u.styleclass=o.getAttribute("class")),o.getAttribute("align")&&(u.align=o.getAttribute("align"));var a={},f=o.getElementsByTagName("param"),l=f.length;for(var c=0;c');u.outerHTML='"+l+"",p[p.length]=n.id,o=R(n.id)}else{var h=U(t);h.setAttribute("type",i);for(var d in n)n[d]!=Object.prototype[d]&&(d.toLowerCase()=="styleclass"?h.setAttribute("class",n[d]):d.toLowerCase()!="classid"&&h.setAttribute(d,n[d]));for(var v in r)r[v]!=Object.prototype[v]&&v.toLowerCase()!="movie"&&F(h,v,r[v]);u.parentNode.replaceChild(h,u),o=h}}return o}function F(e,t,n){var r=U("param");r.setAttribute("name",t),r.setAttribute("value",n),e.appendChild(r)}function I(e){var t=R(e);t&&t.nodeName=="OBJECT"&&(T.ie&&T.win?(t.style.display="none",function(){t.readyState==4?q(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function q(e){var t=R(e);if(t){for(var n in t)typeof t[n]=="function"&&(t[n]=null);t.parentNode.removeChild(t)}}function R(e){var t=null;try{t=a.getElementById(e)}catch(n){}return t}function U(e){return a.createElement(e)}function z(e,t,n){e.attachEvent(t,n),d[d.length]=[e,t,n]}function W(e){var t=T.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]?!0:!1}function X(n,r,i,s){if(T.ie&&T.mac)return;var o=a.getElementsByTagName("head")[0];if(!o)return;var u=i&&typeof i=="string"?i:"screen";s&&(E=null,S=null);if(!E||S!=u){var f=U("style");f.setAttribute("type","text/css"),f.setAttribute("media",u),E=o.appendChild(f),T.ie&&T.win&&typeof a.styleSheets!=e&&a.styleSheets.length>0&&(E=a.styleSheets[a.styleSheets.length-1]),S=u}T.ie&&T.win?E&&typeof E.addRule==t&&E.addRule(n,r):E&&typeof a.createTextNode!=e&&E.appendChild(a.createTextNode(n+" {"+r+"}"))}function V(e,t){if(!x)return;var n=t?"visible":"hidden";b&&R(e)?R(e).style.visibility=n:X("#"+e,"visibility:"+n)}function $(t){var n=/[\\\"<>\.;]/,r=n.exec(t)!=null;return r&&typeof encodeURIComponent!=e?encodeURIComponent(t):t}var e="undefined",t="object",n="Shockwave Flash",r="ShockwaveFlash.ShockwaveFlash",i="application/x-shockwave-flash",s="SWFObjectExprInst",o="onreadystatechange",u=window,a=document,f=navigator,l=!1,c=[A],h=[],p=[],d=[],v,m,g,y,b=!1,w=!1,E,S,x=!0,T=function(){var s=typeof a.getElementById!=e&&typeof a.getElementsByTagName!=e&&typeof a.createElement!=e,o=f.userAgent.toLowerCase(),c=f.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(o),p=c?/mac/.test(c):/mac/.test(o),d=/webkit/.test(o)?parseFloat(o.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,v=!1,m=[0,0,0],g=null;if(typeof f.plugins!=e&&typeof f.plugins[n]==t)g=f.plugins[n].description,g&&(typeof f.mimeTypes==e||!f.mimeTypes[i]||!!f.mimeTypes[i].enabledPlugin)&&(l=!0,v=!1,g=g.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),m[0]=parseInt(g.replace(/^(.*)\..*$/,"$1"),10),m[1]=parseInt(g.replace(/^.*\.(.*)\s.*$/,"$1"),10),m[2]=/[a-zA-Z]/.test(g)?parseInt(g.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof u[["Active"].concat("Object").join("X")]!=e)try{var y=new(window[["Active"].concat("Object").join("X")])(r);y&&(g=y.GetVariable("$version"),g&&(v=!0,g=g.split(" ")[1].split(","),m=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)]))}catch(b){}return{w3:s,pv:m,wk:d,ie:v,win:h,mac:p}}(),N=function(){if(!T.w3)return;(typeof a.readyState!=e&&a.readyState=="complete"||typeof a.readyState==e&&(a.getElementsByTagName("body")[0]||a.body))&&C(),b||(typeof a.addEventListener!=e&&a.addEventListener("DOMContentLoaded",C,!1),T.ie&&T.win&&(a.attachEvent(o,function(){a.readyState=="complete"&&(a.detachEvent(o,arguments.callee),C())}),u==top&&function(){if(b)return;try{a.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}C()}()),T.wk&&function(){if(b)return;if(!/loaded|complete/.test(a.readyState)){setTimeout(arguments.callee,0);return}C()}(),L(C))}(),J=function(){T.ie&&T.win&&window.attachEvent("onunload",function(){var e=d.length;for(var t=0;t= 10.0.0 is required.");return}location.protocol=="file:"&&e.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),WebSocket=function(e,t,n,r,i){var s=this;s.__id=WebSocket.__nextId++,WebSocket.__instances[s.__id]=s,s.readyState=WebSocket.CONNECTING,s.bufferedAmount=0,s.__events={},t?typeof t=="string"&&(t=[t]):t=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(s.__id,e,t,n||null,r||0,i||null)})},0)},WebSocket.prototype.send=function(e){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var t=WebSocket.__flash.send(this.__id,encodeURIComponent(e));return t<0?!0:(this.bufferedAmount+=t,!1)},WebSocket.prototype.close=function(){if(this.readyState==WebSocket.CLOSED||this.readyState==WebSocket.CLOSING)return;this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id)},WebSocket.prototype.addEventListener=function(e,t,n){e in this.__events||(this.__events[e]=[]),this.__events[e].push(t)},WebSocket.prototype.removeEventListener=function(e,t,n){if(!(e in this.__events))return;var r=this.__events[e];for(var i=r.length-1;i>=0;--i)if(r[i]===t){r.splice(i,1);break}},WebSocket.prototype.dispatchEvent=function(e){var t=this.__events[e.type]||[];for(var n=0;n"),this.doc.close(),this.doc.parentWindow.s=this;var e=this.doc.createElement("div");e.className="socketio",this.doc.body.appendChild(e),this.iframe=this.doc.createElement("iframe"),e.appendChild(this.iframe);var n=this,r=t.util.query(this.socket.options.query,"t="+ +(new Date));this.iframe.src=this.prepareUrl()+r,t.util.on(window,"unload",function(){n.destroy()})},n.prototype._=function(e,t){this.onData(e);try{var n=t.getElementsByTagName("script")[0];n.parentNode.removeChild(n)}catch(r){}},n.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},n.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},n.check=function(e){if(typeof window!="undefined"&&["Active"].concat("Object").join("X")in window)try{var n=new(window[["Active"].concat("Object").join("X")])("htmlfile");return n&&t.Transport.XHR.check(e)}catch(r){}return!1},n.xdomainCheck=function(){return!1},t.transports.push("htmlfile")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function r(){t.Transport.XHR.apply(this,arguments)}function i(){}e["xhr-polling"]=r,t.util.inherit(r,t.Transport.XHR),t.util.merge(r,t.Transport.XHR),r.prototype.name="xhr-polling",r.prototype.heartbeats=function(){return!1},r.prototype.open=function(){var e=this;return t.Transport.XHR.prototype.open.call(e),!1},r.prototype.get=function(){function t(){this.readyState==4&&(this.onreadystatechange=i,this.status==200?(e.onData(this.responseText),e.get()):e.onClose())}function r(){this.onload=i,this.onerror=i,e.retryCounter=1,e.onData(this.responseText),e.get()}function s(){e.retryCounter++,!e.retryCounter||e.retryCounter>3?e.onClose():e.get()}if(!this.isOpen)return;var e=this;this.xhr=this.request(),n.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=r,this.xhr.onerror=s):this.xhr.onreadystatechange=t,this.xhr.send(null)},r.prototype.onClose=function(){t.Transport.XHR.prototype.onClose.call(this);if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=i;try{this.xhr.abort()}catch(e){}this.xhr=null}},r.prototype.ready=function(e,n){var r=this;t.util.defer(function(){n.call(r)})},t.transports.push("xhr-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this),function(e,t,n){function i(e){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var n=this;t.j.push(function(e){n._(e)})}var r=n.document&&"MozAppearance"in n.document.documentElement.style;e["jsonp-polling"]=i,t.util.inherit(i,t.Transport["xhr-polling"]),i.prototype.name="jsonp-polling",i.prototype.post=function(e){function a(){f(),n.socket.setBuffer(!1)}function f(){n.iframe&&n.form.removeChild(n.iframe);try{u=document.createElement('