diff --git a/Gemfile b/Gemfile index 4df07731..23495a03 100644 --- a/Gemfile +++ b/Gemfile @@ -14,8 +14,8 @@ gem 'formtastic' gem 'json' gem 'rails3-jquery-autocomplete' gem 'best_in_place' -gem 'therubyracer' #optional -gem 'rb-readline' +#gem 'therubyracer' #optional +#gem 'rb-readline' # Gems used only for assets and not required # in production environments by default. diff --git a/Gemfile~ b/Gemfile~ index 23495a03..4df07731 100644 --- a/Gemfile~ +++ b/Gemfile~ @@ -14,8 +14,8 @@ gem 'formtastic' gem 'json' gem 'rails3-jquery-autocomplete' gem 'best_in_place' -#gem 'therubyracer' #optional -#gem 'rb-readline' +gem 'therubyracer' #optional +gem 'rb-readline' # Gems used only for assets and not required # in production environments by default. diff --git a/app/assets/images/MMCCicon_add_map.png b/app/assets/images/MMCCicon_add_map.png index af4832b7..ded32adc 100644 Binary files a/app/assets/images/MMCCicon_add_map.png and b/app/assets/images/MMCCicon_add_map.png differ diff --git a/app/assets/images/MMCCicon_left_arrow.png b/app/assets/images/MMCCicon_left_arrow.png new file mode 100644 index 00000000..23cd9559 Binary files /dev/null and b/app/assets/images/MMCCicon_left_arrow.png differ diff --git a/app/assets/images/MMCCicon_right_arrow.png b/app/assets/images/MMCCicon_right_arrow.png new file mode 100644 index 00000000..5b57c191 Binary files /dev/null and b/app/assets/images/MMCCicon_right_arrow.png differ diff --git a/app/assets/images/fresnel-mountainous-landscape-002.png b/app/assets/images/fresnel-mountainous-landscape-002.png new file mode 100644 index 00000000..4f7920f4 Binary files /dev/null and b/app/assets/images/fresnel-mountainous-landscape-002.png differ diff --git a/public/assets/scroll/mCSB_buttons.png b/app/assets/images/mCSB_buttons.png similarity index 100% rename from public/assets/scroll/mCSB_buttons.png rename to app/assets/images/mCSB_buttons.png diff --git a/app/assets/images/metacode-watermark.png b/app/assets/images/metacode-watermark.png new file mode 100644 index 00000000..2196e907 Binary files /dev/null and b/app/assets/images/metacode-watermark.png differ diff --git a/app/assets/images/metacodes75ms300x300.gif b/app/assets/images/metacodes75ms300x300.gif new file mode 100644 index 00000000..baeff962 Binary files /dev/null and b/app/assets/images/metacodes75ms300x300.gif differ diff --git a/app/assets/images/metamap128x128.png b/app/assets/images/metamap128x128.png new file mode 100644 index 00000000..6285f6d6 Binary files /dev/null and b/app/assets/images/metamap128x128.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b72fce39..f83e2142 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -15,6 +15,9 @@ //= require jquery //= require jquery-ui //= require jquery.purr +//= require jquery.lettering +//= require jquery.textillate +//= require jquery.roundabout.min //= require best_in_place //= require jquery_ujs //= require_tree . @@ -491,8 +494,10 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, }); //bind lightbox clicks - $('.openLightbox').click(function() { + $('.openLightbox').click(function(event) { openLightbox($(this).attr('data-open')); + event.preventDefault(); + return false; }); // bind permission changer events diff --git a/app/assets/javascripts/carousel/cloud-carousel.1.0.5.js b/app/assets/javascripts/carousel/cloud-carousel.1.0.5.js index 7820a5f5..c10a835f 100644 --- a/app/assets/javascripts/carousel/cloud-carousel.1.0.5.js +++ b/app/assets/javascripts/carousel/cloud-carousel.1.0.5.js @@ -318,10 +318,11 @@ jQuery.browser = browser; x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale); y = this.yCentre + (( (sinVal * this.yRadius) ) * scale); - if (item.imageOK) + if (item.imageOK) { var img = item.image; - img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index. + + img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index. w = img.width = item.orgWidth * scale; h = img.height = item.orgHeight * scale; img.style.left = x + px ; diff --git a/app/assets/javascripts/jquery.lettering.js b/app/assets/javascripts/jquery.lettering.js new file mode 100644 index 00000000..4515590c --- /dev/null +++ b/app/assets/javascripts/jquery.lettering.js @@ -0,0 +1,66 @@ +/*global jQuery */ +/*! +* Lettering.JS 0.6.1 +* +* Copyright 2010, Dave Rupert http://daverupert.com +* Released under the WTFPL license +* http://sam.zoy.org/wtfpl/ +* +* Thanks to Paul Irish - http://paulirish.com - for the feedback. +* +* Date: Mon Sep 20 17:14:00 2010 -0600 +*/ +(function($){ + function injector(t, splitter, klass, after) { + var a = t.text().split(splitter), inject = ''; + if (a.length) { + $(a).each(function(i, item) { + inject += ''+item+''+after; + }); + t.empty().append(inject); + } + } + + var methods = { + init : function() { + + return this.each(function() { + injector($(this), '', 'char', ''); + }); + + }, + + words : function() { + + return this.each(function() { + injector($(this), ' ', 'word', ' '); + }); + + }, + + lines : function() { + + return this.each(function() { + var r = "eefec303079ad17405c889e092e105b0"; + // Because it's hard to split a
tag consistently across browsers, + // (*ahem* IE *ahem*), we replaces all
instances with an md5 hash + // (of the word "split"). If you're trying to use this plugin on that + // md5 hash string, it will fail because you're being ridiculous. + injector($(this).children("br").replaceWith(r).end(), r, 'line', ''); + }); + + } + }; + + $.fn.lettering = function( method ) { + // Method calling logic + if ( method && methods[method] ) { + return methods[ method ].apply( this, [].slice.call( arguments, 1 )); + } else if ( method === 'letters' || ! method ) { + return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array + } + $.error( 'Method ' + method + ' does not exist on jQuery.lettering' ); + return this; + }; + +})(jQuery); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.roundabout.min.js b/app/assets/javascripts/jquery.roundabout.min.js new file mode 100644 index 00000000..63b7bba8 --- /dev/null +++ b/app/assets/javascripts/jquery.roundabout.min.js @@ -0,0 +1,41 @@ +/** + * jQuery Roundabout - v2.3 + * http://fredhq.com/projects/roundabout + * + * Moves list-items of enabled ordered and unordered lists long + * a chosen path. Includes the default "lazySusan" path, that + * moves items long a spinning turntable. + * + * Terms of Use // jQuery Roundabout + * + * Open source under the BSD license + * + * Copyright (c) 2011-2012, Fred LeBlanc + * 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 author 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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(a){"use strict";var b,c,d;a.extend({roundaboutShapes:{def:"lazySusan",lazySusan:function(a,b,c){return{x:Math.sin(a+b),y:Math.sin(a+3*Math.PI/2+b)/8*c,z:(Math.cos(a+b)+1)/2,scale:Math.sin(a+Math.PI/2+b)/2+.5}}}});b={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:true,clickToFocusCallback:function(){},focusBearing:0,shape:"lazySusan",debug:false,childSelector:"li",startingChild:null,reflect:false,floatComparisonThreshold:.001,autoplay:false,autoplayDuration:1e3,autoplayPauseOnHover:false,autoplayCallback:function(){},autoplayInitialDelay:0,enableDrag:false,dropDuration:600,dropEasing:"swing",dropAnimateTo:"nearest",dropCallback:function(){},dragAxis:"x",dragFactor:4,triggerFocusEvents:true,triggerBlurEvents:true,responsive:false};c={autoplayInterval:null,autoplayIsRunning:false,autoplayStartTimeout:null,animating:false,childInFocus:-1,touchMoveStartPosition:null,stopAnimation:false,lastAnimationStep:false};d={init:function(e,f,g){var h,i=(new Date).getTime();e=typeof e==="object"?e:{};f=a.isFunction(f)?f:function(){};f=a.isFunction(e)?e:f;h=a.extend({},b,e,c);return this.each(function(){var b=a(this),c=b.children(h.childSelector).length,e=360/c,i=h.startingChild&&h.startingChild>c-1?c-1:h.startingChild,j=h.startingChild===null?h.bearing:360-i*e,k=b.css("position")!=="static"?b.css("position"):"relative";b.css({padding:0,position:k}).addClass("roundabout-holder").data("roundabout",a.extend({},h,{startingChild:i,bearing:j,oppositeOfFocusBearing:d.normalize.apply(null,[h.focusBearing-180]),dragBearing:j,period:e}));if(g){b.unbind(".roundabout").children(h.childSelector).unbind(".roundabout")}else{if(h.responsive){a(window).bind("resize",function(){d.relayoutChildren.apply(b)})}}if(h.clickToFocus){b.children(h.childSelector).each(function(c){a(this).bind("click.roundabout",function(){var e=d.getPlacement.apply(b,[c]);if(!d.isInFocus.apply(b,[e])){d.stopAnimation.apply(a(this));if(!b.data("roundabout").animating){d.animateBearingToFocus.apply(b,[e,b.data("roundabout").clickToFocusCallback])}return false}})})}if(h.btnNext){a(h.btnNext).bind("click.roundabout",function(){if(!b.data("roundabout").animating){d.animateToNextChild.apply(b,[b.data("roundabout").btnNextCallback])}return false})}if(h.btnPrev){a(h.btnPrev).bind("click.roundabout",function(){d.animateToPreviousChild.apply(b,[b.data("roundabout").btnPrevCallback]);return false})}if(h.btnToggleAutoplay){a(h.btnToggleAutoplay).bind("click.roundabout",function(){d.toggleAutoplay.apply(b);return false})}if(h.btnStartAutoplay){a(h.btnStartAutoplay).bind("click.roundabout",function(){d.startAutoplay.apply(b);return false})}if(h.btnStopAutoplay){a(h.btnStopAutoplay).bind("click.roundabout",function(){d.stopAutoplay.apply(b);return false})}if(h.autoplayPauseOnHover){b.bind("mouseenter.roundabout.autoplay",function(){d.stopAutoplay.apply(b,[true])}).bind("mouseleave.roundabout.autoplay",function(){d.startAutoplay.apply(b)})}if(h.enableDrag){if(!a.isFunction(b.drag)){if(h.debug){alert("You do not have the drag plugin loaded.")}}else if(!a.isFunction(b.drop)){if(h.debug){alert("You do not have the drop plugin loaded.")}}else{b.drag(function(a,c){var e=b.data("roundabout"),f=e.dragAxis.toLowerCase()==="x"?"deltaX":"deltaY";d.stopAnimation.apply(b);d.setBearing.apply(b,[e.dragBearing+c[f]/e.dragFactor])}).drop(function(a){var c=b.data("roundabout"),e=d.getAnimateToMethod(c.dropAnimateTo);d.allowAnimation.apply(b);d[e].apply(b,[c.dropDuration,c.dropEasing,c.dropCallback]);c.dragBearing=c.period*d.getNearestChild.apply(b)})}b.each(function(){var b=a(this).get(0),c=a(this).data("roundabout"),e=c.dragAxis.toLowerCase()==="x"?"pageX":"pageY",f=d.getAnimateToMethod(c.dropAnimateTo);if(b.addEventListener){b.addEventListener("touchstart",function(a){c.touchMoveStartPosition=a.touches[0][e]},false);b.addEventListener("touchmove",function(b){var f=(b.touches[0][e]-c.touchMoveStartPosition)/c.dragFactor;b.preventDefault();d.stopAnimation.apply(a(this));d.setBearing.apply(a(this),[c.dragBearing+f])},false);b.addEventListener("touchend",function(b){b.preventDefault();d.allowAnimation.apply(a(this));f=d.getAnimateToMethod(c.dropAnimateTo);d[f].apply(a(this),[c.dropDuration,c.dropEasing,c.dropCallback]);c.dragBearing=c.period*d.getNearestChild.apply(a(this))},false)}})}d.initChildren.apply(b,[f,g])})},initChildren:function(b,c){var e=a(this),f=e.data("roundabout");b=b||function(){};e.children(f.childSelector).each(function(b){var f,g,h,i=d.getPlacement.apply(e,[b]);if(c&&a(this).data("roundabout")){f=a(this).data("roundabout").startWidth;g=a(this).data("roundabout").startHeight;h=a(this).data("roundabout").startFontSize}a(this).addClass("roundabout-moveable-item").css("position","absolute");a(this).data("roundabout",{startWidth:f||a(this).width(),startHeight:g||a(this).height(),startFontSize:h||parseInt(a(this).css("font-size"),10),degrees:i,backDegrees:d.normalize.apply(null,[i-180]),childNumber:b,currentScale:1,parent:e})});d.updateChildren.apply(e);if(f.autoplay){f.autoplayStartTimeout=setTimeout(function(){d.startAutoplay.apply(e)},f.autoplayInitialDelay)}e.trigger("ready");b.apply(e);return e},updateChildren:function(){return this.each(function(){var b=a(this),c=b.data("roundabout"),e=-1,f={bearing:c.bearing,tilt:c.tilt,stage:{width:Math.floor(a(this).width()*.9),height:Math.floor(a(this).height()*.9)},animating:c.animating,inFocus:c.childInFocus,focusBearingRadian:d.degToRad.apply(null,[c.focusBearing]),shape:a.roundaboutShapes[c.shape]||a.roundaboutShapes[a.roundaboutShapes.def]};f.midStage={width:f.stage.width/2,height:f.stage.height/2};f.nudge={width:f.midStage.width+f.stage.width*.05,height:f.midStage.height+f.stage.height*.05};f.zValues={min:c.minZ,max:c.maxZ,diff:c.maxZ-c.minZ};f.opacity={min:c.minOpacity,max:c.maxOpacity,diff:c.maxOpacity-c.minOpacity};f.scale={min:c.minScale,max:c.maxScale,diff:c.maxScale-c.minScale};b.children(c.childSelector).each(function(g){if(d.updateChild.apply(b,[a(this),f,g,function(){a(this).trigger("ready")}])&&(!f.animating||c.lastAnimationStep)){e=g;a(this).addClass("roundabout-in-focus")}else{a(this).removeClass("roundabout-in-focus")}});if(e!==f.inFocus){if(c.triggerBlurEvents){b.children(c.childSelector).eq(f.inFocus).trigger("blur")}c.childInFocus=e;if(c.triggerFocusEvents&&e!==-1){b.children(c.childSelector).eq(e).trigger("focus")}}b.trigger("childrenUpdated")})},updateChild:function(b,c,e,f){var g,h=this,i=a(b),j=i.data("roundabout"),k=[],l=d.degToRad.apply(null,[360-j.degrees+c.bearing]);f=f||function(){};l=d.normalizeRad.apply(null,[l]);g=c.shape(l,c.focusBearingRadian,c.tilt);g.scale=g.scale>1?1:g.scale;g.adjustedScale=(c.scale.min+c.scale.diff*g.scale).toFixed(4);g.width=(g.adjustedScale*j.startWidth).toFixed(4);g.height=(g.adjustedScale*j.startHeight).toFixed(4);i.css({left:(g.x*c.midStage.width+c.nudge.width-g.width/2).toFixed(0)+"px",top:(g.y*c.midStage.height+c.nudge.height-g.height/2).toFixed(0)+"px",width:g.width+"px",height:g.height+"px",opacity:(c.opacity.min+c.opacity.diff*g.scale).toFixed(2),zIndex:Math.round(c.zValues.min+c.zValues.diff*g.z),fontSize:(g.adjustedScale*j.startFontSize).toFixed(1)+"px"});j.currentScale=g.adjustedScale;if(h.data("roundabout").debug){k.push('
');k.push('Child '+e+"
");k.push("left: "+i.css("left")+"
");k.push("top: "+i.css("top")+"
");k.push("width: "+i.css("width")+"
");k.push("opacity: "+i.css("opacity")+"
");k.push("height: "+i.css("height")+"
");k.push("z-index: "+i.css("z-index")+"
");k.push("font-size: "+i.css("font-size")+"
");k.push("scale: "+i.data("roundabout").currentScale);k.push("
");i.html(k.join(""))}i.trigger("reposition");f.apply(h);return d.isInFocus.apply(h,[j.degrees])},setBearing:function(b,c){c=c||function(){};b=d.normalize.apply(null,[b]);this.each(function(){var c,e,f,g=a(this),h=g.data("roundabout"),i=h.bearing;h.bearing=b;g.trigger("bearingSet");d.updateChildren.apply(g);c=Math.abs(i-b);if(!h.animating||c>180){return}c=Math.abs(i-b);g.children(h.childSelector).each(function(c){var e;if(d.isChildBackDegreesBetween.apply(a(this),[b,i])){e=i>b?"Clockwise":"Counterclockwise";a(this).trigger("move"+e+"ThroughBack")}})});c.apply(this);return this},adjustBearing:function(b,c){c=c||function(){};if(b===0){return this}this.each(function(){d.setBearing.apply(a(this),[a(this).data("roundabout").bearing+b])});c.apply(this);return this},setTilt:function(b,c){c=c||function(){};this.each(function(){a(this).data("roundabout").tilt=b;d.updateChildren.apply(a(this))});c.apply(this);return this},adjustTilt:function(b,c){c=c||function(){};this.each(function(){d.setTilt.apply(a(this),[a(this).data("roundabout").tilt+b])});c.apply(this);return this},animateToBearing:function(b,c,e,f,g){var h=(new Date).getTime();g=g||function(){};if(a.isFunction(f)){g=f;f=null}else if(a.isFunction(e)){g=e;e=null}else if(a.isFunction(c)){g=c;c=null}this.each(function(){var i,j,k,l=a(this),m=l.data("roundabout"),n=!c?m.duration:c,o=e?e:m.easing||"swing";if(!f){f={timerStart:h,start:m.bearing,totalTime:n}}i=h-f.timerStart;if(m.stopAnimation){d.allowAnimation.apply(l);m.animating=false;return}if(i=Math.floor(h.lower)){if(l===2&&k===360){d.animateToDelta.apply(i,[-180,e,f,g])}else{d.animateBearingToFocus.apply(i,[h.lower,e,f,g])}break}}}else{k=Math.abs(k)=0;b-=1){h={lower:j.period*b,upper:j.period*(b+1)};h.upper=b===l-1?360:h.upper;if(k>=Math.floor(h.lower)&&k180?-(360-g):g;if(g!==0){d.animateToDelta.apply(a(this),[g,c,e,f])}})},stopAnimation:function(){return this.each(function(){a(this).data("roundabout").stopAnimation=true})},allowAnimation:function(){return this.each(function(){a(this).data("roundabout").stopAnimation=false})},startAutoplay:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");b=b||e.autoplayCallback||function(){};clearInterval(e.autoplayInterval);e.autoplayInterval=setInterval(function(){d.animateToNextChild.apply(c,[b])},e.autoplayDuration);e.autoplayIsRunning=true;c.trigger("autoplayStart")})},stopAutoplay:function(b){return this.each(function(){clearInterval(a(this).data("roundabout").autoplayInterval);a(this).data("roundabout").autoplayInterval=null;a(this).data("roundabout").autoplayIsRunning=false;if(!b){a(this).unbind(".autoplay")}a(this).trigger("autoplayStop")})},toggleAutoplay:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");b=b||e.autoplayCallback||function(){};if(!d.isAutoplaying.apply(a(this))){d.startAutoplay.apply(a(this),[b])}else{d.stopAutoplay.apply(a(this),[b])}})},isAutoplaying:function(){return this.data("roundabout").autoplayIsRunning},changeAutoplayDuration:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");e.autoplayDuration=b;if(d.isAutoplaying.apply(c)){d.stopAutoplay.apply(c);setTimeout(function(){d.startAutoplay.apply(c)},10)}})},normalize:function(a){var b=a%360;return b<0?360+b:b},normalizeRad:function(a){while(a<0){a+=Math.PI*2}while(a>Math.PI*2){a-=Math.PI*2}return a},isChildBackDegreesBetween:function(b,c){var d=a(this).data("roundabout").backDegrees;if(b>c){return d>=c&&d=b}},getAnimateToMethod:function(a){a=a.toLowerCase();if(a==="next"){return"animateToNextChild"}else if(a==="previous"){return"animateToPreviousChild"}return"animateToNearestChild"},relayoutChildren:function(){return this.each(function(){var b=a(this),c=a.extend({},b.data("roundabout"));c.startingChild=b.data("roundabout").childInFocus;d.init.apply(b,[c,null,true])})},getNearestChild:function(){var b=a(this),c=b.data("roundabout"),d=b.children(c.childSelector).length;if(!c.reflect){return(d-Math.round(c.bearing/c.period)%d)%d}else{return Math.round(c.bearing/c.period)%d}},degToRad:function(a){return d.normalize.apply(null,[a])*Math.PI/180},getPlacement:function(a){var b=this.data("roundabout");return!b.reflect?360-b.period*a:b.period*a},isInFocus:function(a){var b,c=this,e=c.data("roundabout"),f=d.normalize.apply(null,[e.bearing]);a=d.normalize.apply(null,[a]);b=Math.abs(f-a);return b<=e.floatComparisonThreshold||b>=360-e.floatComparisonThreshold},getChildInFocus:function(){var b=a(this).data("roundabout");return b.childInFocus>-1?b.childInFocus:false}};a.fn.roundabout=function(b){if(d[b]){return d[b].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof b==="object"||a.isFunction(b)||!b){return d.init.apply(this,arguments)}else{a.error("Method "+b+" does not exist for jQuery.roundabout.")}}})(jQuery) \ No newline at end of file diff --git a/app/assets/javascripts/jquery.textillate.js b/app/assets/javascripts/jquery.textillate.js new file mode 100644 index 00000000..dc7f441d --- /dev/null +++ b/app/assets/javascripts/jquery.textillate.js @@ -0,0 +1,262 @@ +/* + * textillate.js + * http://jschr.github.com/textillate + * MIT licensed + * + * Copyright (C) 2012-2013 Jordan Schroter + */ + +(function ($) { + "use strict"; + + function isInEffect (effect) { + return /In/.test(effect) || $.inArray(effect, $.fn.textillate.defaults.inEffects) >= 0; + }; + + function isOutEffect (effect) { + return /Out/.test(effect) || $.inArray(effect, $.fn.textillate.defaults.outEffects) >= 0; + }; + + // custom get data api method + function getData (node) { + var attrs = node.attributes || [] + , data = {}; + + if (!attrs.length) return data; + + $.each(attrs, function (i, attr) { + if (/^data-in-*/.test(attr.nodeName)) { + data.in = data.in || {}; + data.in[attr.nodeName.replace(/data-in-/, '')] = attr.nodeValue; + } else if (/^data-out-*/.test(attr.nodeName)) { + data.out = data.out || {}; + data.out[attr.nodeName.replace(/data-out-/, '')] = attr.nodeValue; + } else if (/^data-*/.test(attr.nodeName)) { + data[attr.nodeName] = attr.nodeValue; + } + }) + + return data; + } + + function shuffle (o) { + for (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); + return o; + } + + function animate ($c, effect, cb) { + $c.addClass('animated ' + effect) + .css('visibility', 'visible') + .show(); + + $c.one('animationend webkitAnimationEnd oAnimationEnd', function () { + $c.removeClass('animated ' + effect); + cb && cb(); + }); + } + + function animateChars ($chars, options, cb) { + var that = this + , count = $chars.length; + + if (!count) { + cb && cb(); + return; + } + + if (options.shuffle) $chars = shuffle($chars); + if (options.reverse) $chars = $chars.toArray().reverse(); + + $.each($chars, function (i, c) { + var $char = $(c); + + function complete () { + if (isInEffect(options.effect)) { + $char.css('visibility', 'visible'); + } else if (isOutEffect(options.effect)) { + $char.css('visibility', 'hidden'); + } + count -= 1; + if (!count && cb) cb(); + } + + var delay = options.sync ? options.delay : options.delay * i * options.delayScale; + + $char.text() ? + setTimeout(function () { animate($char, options.effect, complete) }, delay) : + complete(); + }); + }; + + var Textillate = function (element, options) { + var base = this + , $element = $(element); + + base.init = function () { + base.$texts = $element.find(options.selector); + + if (!base.$texts.length) { + base.$texts = $('
  • ' + $element.html() + '
'); + $element.html(base.$texts); + } + + base.$texts.hide(); + + base.$current = $('') + .text(base.$texts.find(':first-child').html()) + .prependTo($element); + + if (isInEffect(options.effect)) { + base.$current.css('visibility', 'hidden'); + } else if (isOutEffect(options.effect)) { + base.$current.css('visibility', 'visible'); + } + + base.setOptions(options); + + setTimeout(function () { + base.options.autoStart && base.start(); + }, base.options.initialDelay) + }; + + base.setOptions = function (options) { + base.options = options; + }; + + base.triggerEvent = function (name) { + var e = $.Event(name + '.tlt', { data: base }); + $element.trigger(e); + return e; + }; + + base.in = function (index, cb) { + index = index || 0; + + var $elem = base.$texts.find(':nth-child(' + (index + 1) + ')') + , options = $.extend({}, base.options, getData($elem)) + , $chars; + + base.triggerEvent('inAnimationBegin'); + + base.$current + .text($elem.html()) + .lettering('words'); + + base.$current.find('[class^="word"]') + .css({ + 'display': 'inline-block', + // fix for poor ios performance + '-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 () { $(this).lettering() }); + + $chars = base.$current + .find('[class^="char"]') + .css('display', 'inline-block'); + + if (isInEffect(options.in.effect)) { + $chars.css('visibility', 'hidden'); + } else if (isOutEffect(options.in.effect)) { + $chars.css('visibility', 'visible'); + } + + base.currentIndex = index; + + animateChars($chars, options.in, function () { + base.triggerEvent('inAnimationEnd'); + if (options.in.callback) options.in.callback(); + if (cb) cb(base); + }); + }; + + base.out = function (cb) { + var $elem = base.$texts.find(':nth-child(' + (base.currentIndex + 1) + ')') + , $chars = base.$current.find('[class^="char"]') + , options = $.extend({}, base.options, getData($elem)); + + base.triggerEvent('outAnimationBegin'); + + animateChars($chars, options.out, function () { + base.triggerEvent('outAnimationEnd'); + if (options.out.callback) options.out.callback(); + if (cb) cb(base); + }); + }; + + base.start = function (index) { + base.triggerEvent('start'); + + (function run (index) { + base.in(index, function () { + var length = base.$texts.children().length; + + index += 1; + + if (!base.options.loop && index >= length) { + if (base.options.callback) base.options.callback(); + base.triggerEvent('end'); + } else { + index = index % length; + + setTimeout(function () { + base.out(function () { + run(index) + }); + }, base.options.minDisplayTime); + } + }); + }(index || 0)); + }; + + base.init(); + } + + $.fn.textillate = function (settings, args) { + return this.each(function () { + var $this = $(this) + , data = $this.data('textillate') + , options = $.extend(true, {}, $.fn.textillate.defaults, getData(this), typeof settings == 'object' && settings); + + if (!data) { + $this.data('textillate', (data = new Textillate(this, options))); + } else if (typeof settings == 'string') { + data[settings].apply(data, [].concat(args)); + } else { + data.setOptions.call(data, options); + } + }) + }; + + $.fn.textillate.defaults = { + selector: '.texts', + loop: false, + minDisplayTime: 2000, + initialDelay: 0, + in: { + effect: 'fadeInLeftBig', + delayScale: 1.5, + delay: 50, + sync: false, + reverse: false, + shuffle: false, + callback: function () {} + }, + out: { + effect: 'hinge', + delayScale: 1.5, + delay: 50, + sync: false, + reverse: false, + shuffle: false, + callback: function () {} + }, + autoStart: true, + inEffects: [], + outEffects: [ 'hinge' ], + callback: function () {} + }; + +}(jQuery)); diff --git a/app/assets/jquery.airport.js b/app/assets/jquery.airport.js new file mode 100644 index 00000000..39646439 --- /dev/null +++ b/app/assets/jquery.airport.js @@ -0,0 +1,46 @@ +(function($){ + $.fn.extend({ + airport: function(array) { + + var self = $(this); + var chars = ['a','b','c','d','e','f','g',' ','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','-']; + var longest = 0; + var items = items2 = array.length; + + function pad(a,b) { return a + new Array(b - a.length + 1).join(' '); } + + $(this).empty(); + + while(items--) + if(array[items].length > longest) longest = array[items].length; + + while(items2--) + array[items2] = pad(array[items2],longest); + + spans = longest; + while(spans--) + $(this).prepend(""); + + + function testChar(a,b,c,d){ + if(c >= array.length) + setTimeout(function() { testChar(0,0,0,0); }, 3000); + else if(d >= longest) + setTimeout(function() { testChar(0,0,c+1,0); }, 3000); + else { + $(self).find('.c'+a).html((chars[b]==" ")?" ":chars[b]); + setTimeout(function() { + if(b > chars.length) + testChar(a+1,0,c,d+1); + else if(chars[b] != array[c].substring(d,d+1).toLowerCase()) + testChar(a,b+1,c,d); + else + testChar(a+1,0,c,d+1); + }, 20); + } + } + + testChar(0,0,0,0); + } + }); +})(jQuery); \ No newline at end of file diff --git a/app/assets/stylesheets/animate.css b/app/assets/stylesheets/animate.css new file mode 100644 index 00000000..274c303e --- /dev/null +++ b/app/assets/stylesheets/animate.css @@ -0,0 +1,3263 @@ +@charset "UTF-8"; +/* +Animate.css - http://daneden.me/animate +Licensed under the ☺ license (http://licence.visualidiot.com/) + +Copyright (c) 2012 Dan Eden + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +body { /* Addresses a small issue in webkit: http://bit.ly/NEdoDq */ + -webkit-backface-visibility: hidden; +} +.animated { + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -o-animation-duration: 1s; + animation-duration: 1s; + -webkit-animation-fill-mode: both; + -moz-animation-fill-mode: both; + -o-animation-fill-mode: both; + animation-fill-mode: both; +} + +.animated.hinge { + -webkit-animation-duration: 2s; + -moz-animation-duration: 2s; + -o-animation-duration: 2s; + animation-duration: 2s; +} + +@-webkit-keyframes flash { + 0%, 50%, 100% {opacity: 1;} + 25%, 75% {opacity: 0;} +} + +@-moz-keyframes flash { + 0%, 50%, 100% {opacity: 1;} + 25%, 75% {opacity: 0;} +} + +@-o-keyframes flash { + 0%, 50%, 100% {opacity: 1;} + 25%, 75% {opacity: 0;} +} + +@keyframes flash { + 0%, 50%, 100% {opacity: 1;} + 25%, 75% {opacity: 0;} +} + +.flash { + -webkit-animation-name: flash; + -moz-animation-name: flash; + -o-animation-name: flash; + animation-name: flash; +} +@-webkit-keyframes shake { + 0%, 100% {-webkit-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-webkit-transform: translateX(10px);} +} + +@-moz-keyframes shake { + 0%, 100% {-moz-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-moz-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-moz-transform: translateX(10px);} +} + +@-o-keyframes shake { + 0%, 100% {-o-transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {-o-transform: translateX(-10px);} + 20%, 40%, 60%, 80% {-o-transform: translateX(10px);} +} + +@keyframes shake { + 0%, 100% {transform: translateX(0);} + 10%, 30%, 50%, 70%, 90% {transform: translateX(-10px);} + 20%, 40%, 60%, 80% {transform: translateX(10px);} +} + +.shake { + -webkit-animation-name: shake; + -moz-animation-name: shake; + -o-animation-name: shake; + animation-name: shake; +} +@-webkit-keyframes bounce { + 0%, 20%, 50%, 80%, 100% {-webkit-transform: translateY(0);} + 40% {-webkit-transform: translateY(-30px);} + 60% {-webkit-transform: translateY(-15px);} +} + +@-moz-keyframes bounce { + 0%, 20%, 50%, 80%, 100% {-moz-transform: translateY(0);} + 40% {-moz-transform: translateY(-30px);} + 60% {-moz-transform: translateY(-15px);} +} + +@-o-keyframes bounce { + 0%, 20%, 50%, 80%, 100% {-o-transform: translateY(0);} + 40% {-o-transform: translateY(-30px);} + 60% {-o-transform: translateY(-15px);} +} +@keyframes bounce { + 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} + 40% {transform: translateY(-30px);} + 60% {transform: translateY(-15px);} +} + +.bounce { + -webkit-animation-name: bounce; + -moz-animation-name: bounce; + -o-animation-name: bounce; + animation-name: bounce; +} +@-webkit-keyframes tada { + 0% {-webkit-transform: scale(1);} + 10%, 20% {-webkit-transform: scale(0.9) rotate(-3deg);} + 30%, 50%, 70%, 90% {-webkit-transform: scale(1.1) rotate(3deg);} + 40%, 60%, 80% {-webkit-transform: scale(1.1) rotate(-3deg);} + 100% {-webkit-transform: scale(1) rotate(0);} +} + +@-moz-keyframes tada { + 0% {-moz-transform: scale(1);} + 10%, 20% {-moz-transform: scale(0.9) rotate(-3deg);} + 30%, 50%, 70%, 90% {-moz-transform: scale(1.1) rotate(3deg);} + 40%, 60%, 80% {-moz-transform: scale(1.1) rotate(-3deg);} + 100% {-moz-transform: scale(1) rotate(0);} +} + +@-o-keyframes tada { + 0% {-o-transform: scale(1);} + 10%, 20% {-o-transform: scale(0.9) rotate(-3deg);} + 30%, 50%, 70%, 90% {-o-transform: scale(1.1) rotate(3deg);} + 40%, 60%, 80% {-o-transform: scale(1.1) rotate(-3deg);} + 100% {-o-transform: scale(1) rotate(0);} +} + +@keyframes tada { + 0% {transform: scale(1);} + 10%, 20% {transform: scale(0.9) rotate(-3deg);} + 30%, 50%, 70%, 90% {transform: scale(1.1) rotate(3deg);} + 40%, 60%, 80% {transform: scale(1.1) rotate(-3deg);} + 100% {transform: scale(1) rotate(0);} +} + +.tada { + -webkit-animation-name: tada; + -moz-animation-name: tada; + -o-animation-name: tada; + animation-name: tada; +} +@-webkit-keyframes swing { + 20%, 40%, 60%, 80%, 100% { -webkit-transform-origin: top center; } + 20% { -webkit-transform: rotate(15deg); } + 40% { -webkit-transform: rotate(-10deg); } + 60% { -webkit-transform: rotate(5deg); } + 80% { -webkit-transform: rotate(-5deg); } + 100% { -webkit-transform: rotate(0deg); } +} + +@-moz-keyframes swing { + 20% { -moz-transform: rotate(15deg); } + 40% { -moz-transform: rotate(-10deg); } + 60% { -moz-transform: rotate(5deg); } + 80% { -moz-transform: rotate(-5deg); } + 100% { -moz-transform: rotate(0deg); } +} + +@-o-keyframes swing { + 20% { -o-transform: rotate(15deg); } + 40% { -o-transform: rotate(-10deg); } + 60% { -o-transform: rotate(5deg); } + 80% { -o-transform: rotate(-5deg); } + 100% { -o-transform: rotate(0deg); } +} + +@keyframes swing { + 20% { transform: rotate(15deg); } + 40% { transform: rotate(-10deg); } + 60% { transform: rotate(5deg); } + 80% { transform: rotate(-5deg); } + 100% { transform: rotate(0deg); } +} + +.swing { + -webkit-transform-origin: top center; + -moz-transform-origin: top center; + -o-transform-origin: top center; + transform-origin: top center; + -webkit-animation-name: swing; + -moz-animation-name: swing; + -o-animation-name: swing; + animation-name: swing; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes wobble { + 0% { -webkit-transform: translateX(0%); } + 15% { -webkit-transform: translateX(-25%) rotate(-5deg); } + 30% { -webkit-transform: translateX(20%) rotate(3deg); } + 45% { -webkit-transform: translateX(-15%) rotate(-3deg); } + 60% { -webkit-transform: translateX(10%) rotate(2deg); } + 75% { -webkit-transform: translateX(-5%) rotate(-1deg); } + 100% { -webkit-transform: translateX(0%); } +} + +@-moz-keyframes wobble { + 0% { -moz-transform: translateX(0%); } + 15% { -moz-transform: translateX(-25%) rotate(-5deg); } + 30% { -moz-transform: translateX(20%) rotate(3deg); } + 45% { -moz-transform: translateX(-15%) rotate(-3deg); } + 60% { -moz-transform: translateX(10%) rotate(2deg); } + 75% { -moz-transform: translateX(-5%) rotate(-1deg); } + 100% { -moz-transform: translateX(0%); } +} + +@-o-keyframes wobble { + 0% { -o-transform: translateX(0%); } + 15% { -o-transform: translateX(-25%) rotate(-5deg); } + 30% { -o-transform: translateX(20%) rotate(3deg); } + 45% { -o-transform: translateX(-15%) rotate(-3deg); } + 60% { -o-transform: translateX(10%) rotate(2deg); } + 75% { -o-transform: translateX(-5%) rotate(-1deg); } + 100% { -o-transform: translateX(0%); } +} + +@keyframes wobble { + 0% { transform: translateX(0%); } + 15% { transform: translateX(-25%) rotate(-5deg); } + 30% { transform: translateX(20%) rotate(3deg); } + 45% { transform: translateX(-15%) rotate(-3deg); } + 60% { transform: translateX(10%) rotate(2deg); } + 75% { transform: translateX(-5%) rotate(-1deg); } + 100% { transform: translateX(0%); } +} + +.wobble { + -webkit-animation-name: wobble; + -moz-animation-name: wobble; + -o-animation-name: wobble; + animation-name: wobble; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes pulse { + 0% { -webkit-transform: scale(1); } + 50% { -webkit-transform: scale(1.1); } + 100% { -webkit-transform: scale(1); } +} +@-moz-keyframes pulse { + 0% { -moz-transform: scale(1); } + 50% { -moz-transform: scale(1.1); } + 100% { -moz-transform: scale(1); } +} +@-o-keyframes pulse { + 0% { -o-transform: scale(1); } + 50% { -o-transform: scale(1.1); } + 100% { -o-transform: scale(1); } +} +@keyframes pulse { + 0% { transform: scale(1); } + 50% { transform: scale(1.1); } + 100% { transform: scale(1); } +} + +.pulse { + -webkit-animation-name: pulse; + -moz-animation-name: pulse; + -o-animation-name: pulse; + animation-name: pulse; +} +@-webkit-keyframes flip { + 0% { + -webkit-transform: perspective(400px) rotateY(0); + -webkit-animation-timing-function: ease-out; + } + 40% { + -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg); + -webkit-animation-timing-function: ease-out; + } + 50% { + -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1); + -webkit-animation-timing-function: ease-in; + } + 80% { + -webkit-transform: perspective(400px) rotateY(360deg) scale(.95); + -webkit-animation-timing-function: ease-in; + } + 100% { + -webkit-transform: perspective(400px) scale(1); + -webkit-animation-timing-function: ease-in; + } +} +@-moz-keyframes flip { + 0% { + -moz-transform: perspective(400px) rotateY(0); + -moz-animation-timing-function: ease-out; + } + 40% { + -moz-transform: perspective(400px) translateZ(150px) rotateY(170deg); + -moz-animation-timing-function: ease-out; + } + 50% { + -moz-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1); + -moz-animation-timing-function: ease-in; + } + 80% { + -moz-transform: perspective(400px) rotateY(360deg) scale(.95); + -moz-animation-timing-function: ease-in; + } + 100% { + -moz-transform: perspective(400px) scale(1); + -moz-animation-timing-function: ease-in; + } +} +@-o-keyframes flip { + 0% { + -o-transform: perspective(400px) rotateY(0); + -o-animation-timing-function: ease-out; + } + 40% { + -o-transform: perspective(400px) translateZ(150px) rotateY(170deg); + -o-animation-timing-function: ease-out; + } + 50% { + -o-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1); + -o-animation-timing-function: ease-in; + } + 80% { + -o-transform: perspective(400px) rotateY(360deg) scale(.95); + -o-animation-timing-function: ease-in; + } + 100% { + -o-transform: perspective(400px) scale(1); + -o-animation-timing-function: ease-in; + } +} +@keyframes flip { + 0% { + transform: perspective(400px) rotateY(0); + animation-timing-function: ease-out; + } + 40% { + transform: perspective(400px) translateZ(150px) rotateY(170deg); + animation-timing-function: ease-out; + } + 50% { + transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1); + animation-timing-function: ease-in; + } + 80% { + transform: perspective(400px) rotateY(360deg) scale(.95); + animation-timing-function: ease-in; + } + 100% { + transform: perspective(400px) scale(1); + animation-timing-function: ease-in; + } +} + +.flip { + -webkit-backface-visibility: visible !important; + -webkit-animation-name: flip; + -moz-backface-visibility: visible !important; + -moz-animation-name: flip; + -o-backface-visibility: visible !important; + -o-animation-name: flip; + backface-visibility: visible !important; + animation-name: flip; +} +@-webkit-keyframes flipInX { + 0% { + -webkit-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotateX(-10deg); + } + + 70% { + -webkit-transform: perspective(400px) rotateX(10deg); + } + + 100% { + -webkit-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } +} +@-moz-keyframes flipInX { + 0% { + -moz-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } + + 40% { + -moz-transform: perspective(400px) rotateX(-10deg); + } + + 70% { + -moz-transform: perspective(400px) rotateX(10deg); + } + + 100% { + -moz-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } +} +@-o-keyframes flipInX { + 0% { + -o-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } + + 40% { + -o-transform: perspective(400px) rotateX(-10deg); + } + + 70% { + -o-transform: perspective(400px) rotateX(10deg); + } + + 100% { + -o-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } +} +@keyframes flipInX { + 0% { + transform: perspective(400px) rotateX(90deg); + opacity: 0; + } + + 40% { + transform: perspective(400px) rotateX(-10deg); + } + + 70% { + transform: perspective(400px) rotateX(10deg); + } + + 100% { + transform: perspective(400px) rotateX(0deg); + opacity: 1; + } +} + +.flipInX { + -webkit-backface-visibility: visible !important; + -webkit-animation-name: flipInX; + -moz-backface-visibility: visible !important; + -moz-animation-name: flipInX; + -o-backface-visibility: visible !important; + -o-animation-name: flipInX; + backface-visibility: visible !important; + animation-name: flipInX; +} +@-webkit-keyframes flipOutX { + 0% { + -webkit-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } +} + +@-moz-keyframes flipOutX { + 0% { + -moz-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } + 100% { + -moz-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } +} + +@-o-keyframes flipOutX { + 0% { + -o-transform: perspective(400px) rotateX(0deg); + opacity: 1; + } + 100% { + -o-transform: perspective(400px) rotateX(90deg); + opacity: 0; + } +} + +@keyframes flipOutX { + 0% { + transform: perspective(400px) rotateX(0deg); + opacity: 1; + } + 100% { + transform: perspective(400px) rotateX(90deg); + opacity: 0; + } +} + +.flipOutX { + -webkit-animation-name: flipOutX; + -webkit-backface-visibility: visible !important; + -moz-animation-name: flipOutX; + -moz-backface-visibility: visible !important; + -o-animation-name: flipOutX; + -o-backface-visibility: visible !important; + animation-name: flipOutX; + backface-visibility: visible !important; +} +@-webkit-keyframes flipInY { + 0% { + -webkit-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotateY(-10deg); + } + + 70% { + -webkit-transform: perspective(400px) rotateY(10deg); + } + + 100% { + -webkit-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } +} +@-moz-keyframes flipInY { + 0% { + -moz-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } + + 40% { + -moz-transform: perspective(400px) rotateY(-10deg); + } + + 70% { + -moz-transform: perspective(400px) rotateY(10deg); + } + + 100% { + -moz-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } +} +@-o-keyframes flipInY { + 0% { + -o-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } + + 40% { + -o-transform: perspective(400px) rotateY(-10deg); + } + + 70% { + -o-transform: perspective(400px) rotateY(10deg); + } + + 100% { + -o-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } +} +@keyframes flipInY { + 0% { + transform: perspective(400px) rotateY(90deg); + opacity: 0; + } + + 40% { + transform: perspective(400px) rotateY(-10deg); + } + + 70% { + transform: perspective(400px) rotateY(10deg); + } + + 100% { + transform: perspective(400px) rotateY(0deg); + opacity: 1; + } +} + +.flipInY { + -webkit-backface-visibility: visible !important; + -webkit-animation-name: flipInY; + -moz-backface-visibility: visible !important; + -moz-animation-name: flipInY; + -o-backface-visibility: visible !important; + -o-animation-name: flipInY; + backface-visibility: visible !important; + animation-name: flipInY; +} +@-webkit-keyframes flipOutY { + 0% { + -webkit-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } +} +@-moz-keyframes flipOutY { + 0% { + -moz-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } + 100% { + -moz-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } +} +@-o-keyframes flipOutY { + 0% { + -o-transform: perspective(400px) rotateY(0deg); + opacity: 1; + } + 100% { + -o-transform: perspective(400px) rotateY(90deg); + opacity: 0; + } +} +@keyframes flipOutY { + 0% { + transform: perspective(400px) rotateY(0deg); + opacity: 1; + } + 100% { + transform: perspective(400px) rotateY(90deg); + opacity: 0; + } +} + +.flipOutY { + -webkit-backface-visibility: visible !important; + -webkit-animation-name: flipOutY; + -moz-backface-visibility: visible !important; + -moz-animation-name: flipOutY; + -o-backface-visibility: visible !important; + -o-animation-name: flipOutY; + backface-visibility: visible !important; + animation-name: flipOutY; +} +@-webkit-keyframes fadeIn { + 0% {opacity: 0;} + 100% {opacity: 1;} +} + +@-moz-keyframes fadeIn { + 0% {opacity: 0;} + 100% {opacity: 1;} +} + +@-o-keyframes fadeIn { + 0% {opacity: 0;} + 100% {opacity: 1;} +} + +@keyframes fadeIn { + 0% {opacity: 0;} + 100% {opacity: 1;} +} + +.fadeIn { + -webkit-animation-name: fadeIn; + -moz-animation-name: fadeIn; + -o-animation-name: fadeIn; + animation-name: fadeIn; +} +@-webkit-keyframes fadeInUp { + 0% { + opacity: 0; + -webkit-transform: translateY(20px); + } + + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeInUp { + 0% { + opacity: 0; + -moz-transform: translateY(20px); + } + + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-o-keyframes fadeInUp { + 0% { + opacity: 0; + -o-transform: translateY(20px); + } + + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeInUp { + 0% { + opacity: 0; + transform: translateY(20px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeInUp { + -webkit-animation-name: fadeInUp; + -moz-animation-name: fadeInUp; + -o-animation-name: fadeInUp; + animation-name: fadeInUp; +} +@-webkit-keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeInDown { + 0% { + opacity: 0; + -moz-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-o-keyframes fadeInDown { + 0% { + opacity: 0; + -o-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeInDown { + 0% { + opacity: 0; + transform: translateY(-20px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeInDown { + -webkit-animation-name: fadeInDown; + -moz-animation-name: fadeInDown; + -o-animation-name: fadeInDown; + animation-name: fadeInDown; +} +@-webkit-keyframes fadeInLeft { + 0% { + opacity: 0; + -webkit-transform: translateX(-20px); + } + + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes fadeInLeft { + 0% { + opacity: 0; + -moz-transform: translateX(-20px); + } + + 100% { + opacity: 1; + -moz-transform: translateX(0); + } +} + +@-o-keyframes fadeInLeft { + 0% { + opacity: 0; + -o-transform: translateX(-20px); + } + + 100% { + opacity: 1; + -o-transform: translateX(0); + } +} + +@keyframes fadeInLeft { + 0% { + opacity: 0; + transform: translateX(-20px); + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.fadeInLeft { + -webkit-animation-name: fadeInLeft; + -moz-animation-name: fadeInLeft; + -o-animation-name: fadeInLeft; + animation-name: fadeInLeft; +} +@-webkit-keyframes fadeInRight { + 0% { + opacity: 0; + -webkit-transform: translateX(20px); + } + + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes fadeInRight { + 0% { + opacity: 0; + -moz-transform: translateX(20px); + } + + 100% { + opacity: 1; + -moz-transform: translateX(0); + } +} + +@-o-keyframes fadeInRight { + 0% { + opacity: 0; + -o-transform: translateX(20px); + } + + 100% { + opacity: 1; + -o-transform: translateX(0); + } +} + +@keyframes fadeInRight { + 0% { + opacity: 0; + transform: translateX(20px); + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.fadeInRight { + -webkit-animation-name: fadeInRight; + -moz-animation-name: fadeInRight; + -o-animation-name: fadeInRight; + animation-name: fadeInRight; +} +@-webkit-keyframes fadeInUpBig { + 0% { + opacity: 0; + -webkit-transform: translateY(2000px); + } + + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeInUpBig { + 0% { + opacity: 0; + -moz-transform: translateY(2000px); + } + + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-o-keyframes fadeInUpBig { + 0% { + opacity: 0; + -o-transform: translateY(2000px); + } + + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeInUpBig { + 0% { + opacity: 0; + transform: translateY(2000px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeInUpBig { + -webkit-animation-name: fadeInUpBig; + -moz-animation-name: fadeInUpBig; + -o-animation-name: fadeInUpBig; + animation-name: fadeInUpBig; +} +@-webkit-keyframes fadeInDownBig { + 0% { + opacity: 0; + -webkit-transform: translateY(-2000px); + } + + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeInDownBig { + 0% { + opacity: 0; + -moz-transform: translateY(-2000px); + } + + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-o-keyframes fadeInDownBig { + 0% { + opacity: 0; + -o-transform: translateY(-2000px); + } + + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeInDownBig { + 0% { + opacity: 0; + transform: translateY(-2000px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeInDownBig { + -webkit-animation-name: fadeInDownBig; + -moz-animation-name: fadeInDownBig; + -o-animation-name: fadeInDownBig; + animation-name: fadeInDownBig; +} +@-webkit-keyframes fadeInLeftBig { + 0% { + opacity: 0; + -webkit-transform: translateX(-2000px); + } + + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } +} +@-moz-keyframes fadeInLeftBig { + 0% { + opacity: 0; + -moz-transform: translateX(-2000px); + } + + 100% { + opacity: 1; + -moz-transform: translateX(0); + } +} +@-o-keyframes fadeInLeftBig { + 0% { + opacity: 0; + -o-transform: translateX(-2000px); + } + + 100% { + opacity: 1; + -o-transform: translateX(0); + } +} +@keyframes fadeInLeftBig { + 0% { + opacity: 0; + transform: translateX(-2000px); + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.fadeInLeftBig { + -webkit-animation-name: fadeInLeftBig; + -moz-animation-name: fadeInLeftBig; + -o-animation-name: fadeInLeftBig; + animation-name: fadeInLeftBig; +} +@-webkit-keyframes fadeInRightBig { + 0% { + opacity: 0; + -webkit-transform: translateX(2000px); + } + + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes fadeInRightBig { + 0% { + opacity: 0; + -moz-transform: translateX(2000px); + } + + 100% { + opacity: 1; + -moz-transform: translateX(0); + } +} + +@-o-keyframes fadeInRightBig { + 0% { + opacity: 0; + -o-transform: translateX(2000px); + } + + 100% { + opacity: 1; + -o-transform: translateX(0); + } +} + +@keyframes fadeInRightBig { + 0% { + opacity: 0; + transform: translateX(2000px); + } + + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.fadeInRightBig { + -webkit-animation-name: fadeInRightBig; + -moz-animation-name: fadeInRightBig; + -o-animation-name: fadeInRightBig; + animation-name: fadeInRightBig; +} +@-webkit-keyframes fadeOut { + 0% {opacity: 1;} + 100% {opacity: 0;} +} + +@-moz-keyframes fadeOut { + 0% {opacity: 1;} + 100% {opacity: 0;} +} + +@-o-keyframes fadeOut { + 0% {opacity: 1;} + 100% {opacity: 0;} +} + +@keyframes fadeOut { + 0% {opacity: 1;} + 100% {opacity: 0;} +} + +.fadeOut { + -webkit-animation-name: fadeOut; + -moz-animation-name: fadeOut; + -o-animation-name: fadeOut; + animation-name: fadeOut; +} +@-webkit-keyframes fadeOutUp { + 0% { + opacity: 1; + -webkit-transform: translateY(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(-20px); + } +} +@-moz-keyframes fadeOutUp { + 0% { + opacity: 1; + -moz-transform: translateY(0); + } + + 100% { + opacity: 0; + -moz-transform: translateY(-20px); + } +} +@-o-keyframes fadeOutUp { + 0% { + opacity: 1; + -o-transform: translateY(0); + } + + 100% { + opacity: 0; + -o-transform: translateY(-20px); + } +} +@keyframes fadeOutUp { + 0% { + opacity: 1; + transform: translateY(0); + } + + 100% { + opacity: 0; + transform: translateY(-20px); + } +} + +.fadeOutUp { + -webkit-animation-name: fadeOutUp; + -moz-animation-name: fadeOutUp; + -o-animation-name: fadeOutUp; + animation-name: fadeOutUp; +} +@-webkit-keyframes fadeOutDown { + 0% { + opacity: 1; + -webkit-transform: translateY(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(20px); + } +} + +@-moz-keyframes fadeOutDown { + 0% { + opacity: 1; + -moz-transform: translateY(0); + } + + 100% { + opacity: 0; + -moz-transform: translateY(20px); + } +} + +@-o-keyframes fadeOutDown { + 0% { + opacity: 1; + -o-transform: translateY(0); + } + + 100% { + opacity: 0; + -o-transform: translateY(20px); + } +} + +@keyframes fadeOutDown { + 0% { + opacity: 1; + transform: translateY(0); + } + + 100% { + opacity: 0; + transform: translateY(20px); + } +} + +.fadeOutDown { + -webkit-animation-name: fadeOutDown; + -moz-animation-name: fadeOutDown; + -o-animation-name: fadeOutDown; + animation-name: fadeOutDown; +} +@-webkit-keyframes fadeOutLeft { + 0% { + opacity: 1; + -webkit-transform: translateX(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(-20px); + } +} + +@-moz-keyframes fadeOutLeft { + 0% { + opacity: 1; + -moz-transform: translateX(0); + } + + 100% { + opacity: 0; + -moz-transform: translateX(-20px); + } +} + +@-o-keyframes fadeOutLeft { + 0% { + opacity: 1; + -o-transform: translateX(0); + } + + 100% { + opacity: 0; + -o-transform: translateX(-20px); + } +} + +@keyframes fadeOutLeft { + 0% { + opacity: 1; + transform: translateX(0); + } + + 100% { + opacity: 0; + transform: translateX(-20px); + } +} + +.fadeOutLeft { + -webkit-animation-name: fadeOutLeft; + -moz-animation-name: fadeOutLeft; + -o-animation-name: fadeOutLeft; + animation-name: fadeOutLeft; +} +@-webkit-keyframes fadeOutRight { + 0% { + opacity: 1; + -webkit-transform: translateX(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(20px); + } +} + +@-moz-keyframes fadeOutRight { + 0% { + opacity: 1; + -moz-transform: translateX(0); + } + + 100% { + opacity: 0; + -moz-transform: translateX(20px); + } +} + +@-o-keyframes fadeOutRight { + 0% { + opacity: 1; + -o-transform: translateX(0); + } + + 100% { + opacity: 0; + -o-transform: translateX(20px); + } +} + +@keyframes fadeOutRight { + 0% { + opacity: 1; + transform: translateX(0); + } + + 100% { + opacity: 0; + transform: translateX(20px); + } +} + +.fadeOutRight { + -webkit-animation-name: fadeOutRight; + -moz-animation-name: fadeOutRight; + -o-animation-name: fadeOutRight; + animation-name: fadeOutRight; +} +@-webkit-keyframes fadeOutUpBig { + 0% { + opacity: 1; + -webkit-transform: translateY(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(-2000px); + } +} + +@-moz-keyframes fadeOutUpBig { + 0% { + opacity: 1; + -moz-transform: translateY(0); + } + + 100% { + opacity: 0; + -moz-transform: translateY(-2000px); + } +} + +@-o-keyframes fadeOutUpBig { + 0% { + opacity: 1; + -o-transform: translateY(0); + } + + 100% { + opacity: 0; + -o-transform: translateY(-2000px); + } +} + +@keyframes fadeOutUpBig { + 0% { + opacity: 1; + transform: translateY(0); + } + + 100% { + opacity: 0; + transform: translateY(-2000px); + } +} + +.fadeOutUpBig { + -webkit-animation-name: fadeOutUpBig; + -moz-animation-name: fadeOutUpBig; + -o-animation-name: fadeOutUpBig; + animation-name: fadeOutUpBig; +} +@-webkit-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -webkit-transform: translateY(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(2000px); + } +} + +@-moz-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -moz-transform: translateY(0); + } + + 100% { + opacity: 0; + -moz-transform: translateY(2000px); + } +} + +@-o-keyframes fadeOutDownBig { + 0% { + opacity: 1; + -o-transform: translateY(0); + } + + 100% { + opacity: 0; + -o-transform: translateY(2000px); + } +} + +@keyframes fadeOutDownBig { + 0% { + opacity: 1; + transform: translateY(0); + } + + 100% { + opacity: 0; + transform: translateY(2000px); + } +} + +.fadeOutDownBig { + -webkit-animation-name: fadeOutDownBig; + -moz-animation-name: fadeOutDownBig; + -o-animation-name: fadeOutDownBig; + animation-name: fadeOutDownBig; +} +@-webkit-keyframes fadeOutLeftBig { + 0% { + opacity: 1; + -webkit-transform: translateX(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(-2000px); + } +} + +@-moz-keyframes fadeOutLeftBig { + 0% { + opacity: 1; + -moz-transform: translateX(0); + } + + 100% { + opacity: 0; + -moz-transform: translateX(-2000px); + } +} + +@-o-keyframes fadeOutLeftBig { + 0% { + opacity: 1; + -o-transform: translateX(0); + } + + 100% { + opacity: 0; + -o-transform: translateX(-2000px); + } +} + +@keyframes fadeOutLeftBig { + 0% { + opacity: 1; + transform: translateX(0); + } + + 100% { + opacity: 0; + transform: translateX(-2000px); + } +} + +.fadeOutLeftBig { + -webkit-animation-name: fadeOutLeftBig; + -moz-animation-name: fadeOutLeftBig; + -o-animation-name: fadeOutLeftBig; + animation-name: fadeOutLeftBig; +} +@-webkit-keyframes fadeOutRightBig { + 0% { + opacity: 1; + -webkit-transform: translateX(0); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(2000px); + } +} +@-moz-keyframes fadeOutRightBig { + 0% { + opacity: 1; + -moz-transform: translateX(0); + } + + 100% { + opacity: 0; + -moz-transform: translateX(2000px); + } +} +@-o-keyframes fadeOutRightBig { + 0% { + opacity: 1; + -o-transform: translateX(0); + } + + 100% { + opacity: 0; + -o-transform: translateX(2000px); + } +} +@keyframes fadeOutRightBig { + 0% { + opacity: 1; + transform: translateX(0); + } + + 100% { + opacity: 0; + transform: translateX(2000px); + } +} + +.fadeOutRightBig { + -webkit-animation-name: fadeOutRightBig; + -moz-animation-name: fadeOutRightBig; + -o-animation-name: fadeOutRightBig; + animation-name: fadeOutRightBig; +} +@-webkit-keyframes bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.3); + } + + 50% { + opacity: 1; + -webkit-transform: scale(1.05); + } + + 70% { + -webkit-transform: scale(.9); + } + + 100% { + -webkit-transform: scale(1); + } +} + +@-moz-keyframes bounceIn { + 0% { + opacity: 0; + -moz-transform: scale(.3); + } + + 50% { + opacity: 1; + -moz-transform: scale(1.05); + } + + 70% { + -moz-transform: scale(.9); + } + + 100% { + -moz-transform: scale(1); + } +} + +@-o-keyframes bounceIn { + 0% { + opacity: 0; + -o-transform: scale(.3); + } + + 50% { + opacity: 1; + -o-transform: scale(1.05); + } + + 70% { + -o-transform: scale(.9); + } + + 100% { + -o-transform: scale(1); + } +} + +@keyframes bounceIn { + 0% { + opacity: 0; + transform: scale(.3); + } + + 50% { + opacity: 1; + transform: scale(1.05); + } + + 70% { + transform: scale(.9); + } + + 100% { + transform: scale(1); + } +} + +.bounceIn { + -webkit-animation-name: bounceIn; + -moz-animation-name: bounceIn; + -o-animation-name: bounceIn; + animation-name: bounceIn; +} +@-webkit-keyframes bounceInUp { + 0% { + opacity: 0; + -webkit-transform: translateY(2000px); + } + + 60% { + opacity: 1; + -webkit-transform: translateY(-30px); + } + + 80% { + -webkit-transform: translateY(10px); + } + + 100% { + -webkit-transform: translateY(0); + } +} +@-moz-keyframes bounceInUp { + 0% { + opacity: 0; + -moz-transform: translateY(2000px); + } + + 60% { + opacity: 1; + -moz-transform: translateY(-30px); + } + + 80% { + -moz-transform: translateY(10px); + } + + 100% { + -moz-transform: translateY(0); + } +} + +@-o-keyframes bounceInUp { + 0% { + opacity: 0; + -o-transform: translateY(2000px); + } + + 60% { + opacity: 1; + -o-transform: translateY(-30px); + } + + 80% { + -o-transform: translateY(10px); + } + + 100% { + -o-transform: translateY(0); + } +} + +@keyframes bounceInUp { + 0% { + opacity: 0; + transform: translateY(2000px); + } + + 60% { + opacity: 1; + transform: translateY(-30px); + } + + 80% { + transform: translateY(10px); + } + + 100% { + transform: translateY(0); + } +} + +.bounceInUp { + -webkit-animation-name: bounceInUp; + -moz-animation-name: bounceInUp; + -o-animation-name: bounceInUp; + animation-name: bounceInUp; +} +@-webkit-keyframes bounceInDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-2000px); + } + + 60% { + opacity: 1; + -webkit-transform: translateY(30px); + } + + 80% { + -webkit-transform: translateY(-10px); + } + + 100% { + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes bounceInDown { + 0% { + opacity: 0; + -moz-transform: translateY(-2000px); + } + + 60% { + opacity: 1; + -moz-transform: translateY(30px); + } + + 80% { + -moz-transform: translateY(-10px); + } + + 100% { + -moz-transform: translateY(0); + } +} + +@-o-keyframes bounceInDown { + 0% { + opacity: 0; + -o-transform: translateY(-2000px); + } + + 60% { + opacity: 1; + -o-transform: translateY(30px); + } + + 80% { + -o-transform: translateY(-10px); + } + + 100% { + -o-transform: translateY(0); + } +} + +@keyframes bounceInDown { + 0% { + opacity: 0; + transform: translateY(-2000px); + } + + 60% { + opacity: 1; + transform: translateY(30px); + } + + 80% { + transform: translateY(-10px); + } + + 100% { + transform: translateY(0); + } +} + +.bounceInDown { + -webkit-animation-name: bounceInDown; + -moz-animation-name: bounceInDown; + -o-animation-name: bounceInDown; + animation-name: bounceInDown; +} +@-webkit-keyframes bounceInLeft { + 0% { + opacity: 0; + -webkit-transform: translateX(-2000px); + } + + 60% { + opacity: 1; + -webkit-transform: translateX(30px); + } + + 80% { + -webkit-transform: translateX(-10px); + } + + 100% { + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes bounceInLeft { + 0% { + opacity: 0; + -moz-transform: translateX(-2000px); + } + + 60% { + opacity: 1; + -moz-transform: translateX(30px); + } + + 80% { + -moz-transform: translateX(-10px); + } + + 100% { + -moz-transform: translateX(0); + } +} + +@-o-keyframes bounceInLeft { + 0% { + opacity: 0; + -o-transform: translateX(-2000px); + } + + 60% { + opacity: 1; + -o-transform: translateX(30px); + } + + 80% { + -o-transform: translateX(-10px); + } + + 100% { + -o-transform: translateX(0); + } +} + +@keyframes bounceInLeft { + 0% { + opacity: 0; + transform: translateX(-2000px); + } + + 60% { + opacity: 1; + transform: translateX(30px); + } + + 80% { + transform: translateX(-10px); + } + + 100% { + transform: translateX(0); + } +} + +.bounceInLeft { + -webkit-animation-name: bounceInLeft; + -moz-animation-name: bounceInLeft; + -o-animation-name: bounceInLeft; + animation-name: bounceInLeft; +} +@-webkit-keyframes bounceInRight { + 0% { + opacity: 0; + -webkit-transform: translateX(2000px); + } + + 60% { + opacity: 1; + -webkit-transform: translateX(-30px); + } + + 80% { + -webkit-transform: translateX(10px); + } + + 100% { + -webkit-transform: translateX(0); + } +} + +@-moz-keyframes bounceInRight { + 0% { + opacity: 0; + -moz-transform: translateX(2000px); + } + + 60% { + opacity: 1; + -moz-transform: translateX(-30px); + } + + 80% { + -moz-transform: translateX(10px); + } + + 100% { + -moz-transform: translateX(0); + } +} + +@-o-keyframes bounceInRight { + 0% { + opacity: 0; + -o-transform: translateX(2000px); + } + + 60% { + opacity: 1; + -o-transform: translateX(-30px); + } + + 80% { + -o-transform: translateX(10px); + } + + 100% { + -o-transform: translateX(0); + } +} + +@keyframes bounceInRight { + 0% { + opacity: 0; + transform: translateX(2000px); + } + + 60% { + opacity: 1; + transform: translateX(-30px); + } + + 80% { + transform: translateX(10px); + } + + 100% { + transform: translateX(0); + } +} + +.bounceInRight { + -webkit-animation-name: bounceInRight; + -moz-animation-name: bounceInRight; + -o-animation-name: bounceInRight; + animation-name: bounceInRight; +} +@-webkit-keyframes bounceOut { + 0% { + -webkit-transform: scale(1); + } + + 25% { + -webkit-transform: scale(.95); + } + + 50% { + opacity: 1; + -webkit-transform: scale(1.1); + } + + 100% { + opacity: 0; + -webkit-transform: scale(.3); + } +} + +@-moz-keyframes bounceOut { + 0% { + -moz-transform: scale(1); + } + + 25% { + -moz-transform: scale(.95); + } + + 50% { + opacity: 1; + -moz-transform: scale(1.1); + } + + 100% { + opacity: 0; + -moz-transform: scale(.3); + } +} + +@-o-keyframes bounceOut { + 0% { + -o-transform: scale(1); + } + + 25% { + -o-transform: scale(.95); + } + + 50% { + opacity: 1; + -o-transform: scale(1.1); + } + + 100% { + opacity: 0; + -o-transform: scale(.3); + } +} + +@keyframes bounceOut { + 0% { + transform: scale(1); + } + + 25% { + transform: scale(.95); + } + + 50% { + opacity: 1; + transform: scale(1.1); + } + + 100% { + opacity: 0; + transform: scale(.3); + } +} + +.bounceOut { + -webkit-animation-name: bounceOut; + -moz-animation-name: bounceOut; + -o-animation-name: bounceOut; + animation-name: bounceOut; +} +@-webkit-keyframes bounceOutUp { + 0% { + -webkit-transform: translateY(0); + } + + 20% { + opacity: 1; + -webkit-transform: translateY(20px); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(-2000px); + } +} + +@-moz-keyframes bounceOutUp { + 0% { + -moz-transform: translateY(0); + } + + 20% { + opacity: 1; + -moz-transform: translateY(20px); + } + + 100% { + opacity: 0; + -moz-transform: translateY(-2000px); + } +} + +@-o-keyframes bounceOutUp { + 0% { + -o-transform: translateY(0); + } + + 20% { + opacity: 1; + -o-transform: translateY(20px); + } + + 100% { + opacity: 0; + -o-transform: translateY(-2000px); + } +} + +@keyframes bounceOutUp { + 0% { + transform: translateY(0); + } + + 20% { + opacity: 1; + transform: translateY(20px); + } + + 100% { + opacity: 0; + transform: translateY(-2000px); + } +} + +.bounceOutUp { + -webkit-animation-name: bounceOutUp; + -moz-animation-name: bounceOutUp; + -o-animation-name: bounceOutUp; + animation-name: bounceOutUp; +} +@-webkit-keyframes bounceOutDown { + 0% { + -webkit-transform: translateY(0); + } + + 20% { + opacity: 1; + -webkit-transform: translateY(-20px); + } + + 100% { + opacity: 0; + -webkit-transform: translateY(2000px); + } +} + +@-moz-keyframes bounceOutDown { + 0% { + -moz-transform: translateY(0); + } + + 20% { + opacity: 1; + -moz-transform: translateY(-20px); + } + + 100% { + opacity: 0; + -moz-transform: translateY(2000px); + } +} + +@-o-keyframes bounceOutDown { + 0% { + -o-transform: translateY(0); + } + + 20% { + opacity: 1; + -o-transform: translateY(-20px); + } + + 100% { + opacity: 0; + -o-transform: translateY(2000px); + } +} + +@keyframes bounceOutDown { + 0% { + transform: translateY(0); + } + + 20% { + opacity: 1; + transform: translateY(-20px); + } + + 100% { + opacity: 0; + transform: translateY(2000px); + } +} + +.bounceOutDown { + -webkit-animation-name: bounceOutDown; + -moz-animation-name: bounceOutDown; + -o-animation-name: bounceOutDown; + animation-name: bounceOutDown; +} +@-webkit-keyframes bounceOutLeft { + 0% { + -webkit-transform: translateX(0); + } + + 20% { + opacity: 1; + -webkit-transform: translateX(20px); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(-2000px); + } +} + +@-moz-keyframes bounceOutLeft { + 0% { + -moz-transform: translateX(0); + } + + 20% { + opacity: 1; + -moz-transform: translateX(20px); + } + + 100% { + opacity: 0; + -moz-transform: translateX(-2000px); + } +} + +@-o-keyframes bounceOutLeft { + 0% { + -o-transform: translateX(0); + } + + 20% { + opacity: 1; + -o-transform: translateX(20px); + } + + 100% { + opacity: 0; + -o-transform: translateX(-2000px); + } +} + +@keyframes bounceOutLeft { + 0% { + transform: translateX(0); + } + + 20% { + opacity: 1; + transform: translateX(20px); + } + + 100% { + opacity: 0; + transform: translateX(-2000px); + } +} + +.bounceOutLeft { + -webkit-animation-name: bounceOutLeft; + -moz-animation-name: bounceOutLeft; + -o-animation-name: bounceOutLeft; + animation-name: bounceOutLeft; +} +@-webkit-keyframes bounceOutRight { + 0% { + -webkit-transform: translateX(0); + } + + 20% { + opacity: 1; + -webkit-transform: translateX(-20px); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(2000px); + } +} + +@-moz-keyframes bounceOutRight { + 0% { + -moz-transform: translateX(0); + } + + 20% { + opacity: 1; + -moz-transform: translateX(-20px); + } + + 100% { + opacity: 0; + -moz-transform: translateX(2000px); + } +} + +@-o-keyframes bounceOutRight { + 0% { + -o-transform: translateX(0); + } + + 20% { + opacity: 1; + -o-transform: translateX(-20px); + } + + 100% { + opacity: 0; + -o-transform: translateX(2000px); + } +} + +@keyframes bounceOutRight { + 0% { + transform: translateX(0); + } + + 20% { + opacity: 1; + transform: translateX(-20px); + } + + 100% { + opacity: 0; + transform: translateX(2000px); + } +} + +.bounceOutRight { + -webkit-animation-name: bounceOutRight; + -moz-animation-name: bounceOutRight; + -o-animation-name: bounceOutRight; + animation-name: bounceOutRight; +} +@-webkit-keyframes rotateIn { + 0% { + -webkit-transform-origin: center center; + -webkit-transform: rotate(-200deg); + opacity: 0; + } + + 100% { + -webkit-transform-origin: center center; + -webkit-transform: rotate(0); + opacity: 1; + } +} +@-moz-keyframes rotateIn { + 0% { + -moz-transform-origin: center center; + -moz-transform: rotate(-200deg); + opacity: 0; + } + + 100% { + -moz-transform-origin: center center; + -moz-transform: rotate(0); + opacity: 1; + } +} +@-o-keyframes rotateIn { + 0% { + -o-transform-origin: center center; + -o-transform: rotate(-200deg); + opacity: 0; + } + + 100% { + -o-transform-origin: center center; + -o-transform: rotate(0); + opacity: 1; + } +} +@keyframes rotateIn { + 0% { + transform-origin: center center; + transform: rotate(-200deg); + opacity: 0; + } + + 100% { + transform-origin: center center; + transform: rotate(0); + opacity: 1; + } +} + +.rotateIn { + -webkit-animation-name: rotateIn; + -moz-animation-name: rotateIn; + -o-animation-name: rotateIn; + animation-name: rotateIn; +} +@-webkit-keyframes rotateInUpLeft { + 0% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(0); + opacity: 1; + } +} + +@-moz-keyframes rotateInUpLeft { + 0% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(0); + opacity: 1; + } +} + +@-o-keyframes rotateInUpLeft { + 0% { + -o-transform-origin: left bottom; + -o-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -o-transform-origin: left bottom; + -o-transform: rotate(0); + opacity: 1; + } +} + +@keyframes rotateInUpLeft { + 0% { + transform-origin: left bottom; + transform: rotate(90deg); + opacity: 0; + } + + 100% { + transform-origin: left bottom; + transform: rotate(0); + opacity: 1; + } +} + +.rotateInUpLeft { + -webkit-animation-name: rotateInUpLeft; + -moz-animation-name: rotateInUpLeft; + -o-animation-name: rotateInUpLeft; + animation-name: rotateInUpLeft; +} +@-webkit-keyframes rotateInDownLeft { + 0% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(0); + opacity: 1; + } +} + +@-moz-keyframes rotateInDownLeft { + 0% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(0); + opacity: 1; + } +} + +@-o-keyframes rotateInDownLeft { + 0% { + -o-transform-origin: left bottom; + -o-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -o-transform-origin: left bottom; + -o-transform: rotate(0); + opacity: 1; + } +} + +@keyframes rotateInDownLeft { + 0% { + transform-origin: left bottom; + transform: rotate(-90deg); + opacity: 0; + } + + 100% { + transform-origin: left bottom; + transform: rotate(0); + opacity: 1; + } +} + +.rotateInDownLeft { + -webkit-animation-name: rotateInDownLeft; + -moz-animation-name: rotateInDownLeft; + -o-animation-name: rotateInDownLeft; + animation-name: rotateInDownLeft; +} +@-webkit-keyframes rotateInUpRight { + 0% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(0); + opacity: 1; + } +} + +@-moz-keyframes rotateInUpRight { + 0% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(0); + opacity: 1; + } +} + +@-o-keyframes rotateInUpRight { + 0% { + -o-transform-origin: right bottom; + -o-transform: rotate(-90deg); + opacity: 0; + } + + 100% { + -o-transform-origin: right bottom; + -o-transform: rotate(0); + opacity: 1; + } +} + +@keyframes rotateInUpRight { + 0% { + transform-origin: right bottom; + transform: rotate(-90deg); + opacity: 0; + } + + 100% { + transform-origin: right bottom; + transform: rotate(0); + opacity: 1; + } +} + +.rotateInUpRight { + -webkit-animation-name: rotateInUpRight; + -moz-animation-name: rotateInUpRight; + -o-animation-name: rotateInUpRight; + animation-name: rotateInUpRight; +} +@-webkit-keyframes rotateInDownRight { + 0% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(0); + opacity: 1; + } +} + +@-moz-keyframes rotateInDownRight { + 0% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(0); + opacity: 1; + } +} + +@-o-keyframes rotateInDownRight { + 0% { + -o-transform-origin: right bottom; + -o-transform: rotate(90deg); + opacity: 0; + } + + 100% { + -o-transform-origin: right bottom; + -o-transform: rotate(0); + opacity: 1; + } +} + +@keyframes rotateInDownRight { + 0% { + transform-origin: right bottom; + transform: rotate(90deg); + opacity: 0; + } + + 100% { + transform-origin: right bottom; + transform: rotate(0); + opacity: 1; + } +} + +.rotateInDownRight { + -webkit-animation-name: rotateInDownRight; + -moz-animation-name: rotateInDownRight; + -o-animation-name: rotateInDownRight; + animation-name: rotateInDownRight; +} +@-webkit-keyframes rotateOut { + 0% { + -webkit-transform-origin: center center; + -webkit-transform: rotate(0); + opacity: 1; + } + + 100% { + -webkit-transform-origin: center center; + -webkit-transform: rotate(200deg); + opacity: 0; + } +} + +@-moz-keyframes rotateOut { + 0% { + -moz-transform-origin: center center; + -moz-transform: rotate(0); + opacity: 1; + } + + 100% { + -moz-transform-origin: center center; + -moz-transform: rotate(200deg); + opacity: 0; + } +} + +@-o-keyframes rotateOut { + 0% { + -o-transform-origin: center center; + -o-transform: rotate(0); + opacity: 1; + } + + 100% { + -o-transform-origin: center center; + -o-transform: rotate(200deg); + opacity: 0; + } +} + +@keyframes rotateOut { + 0% { + transform-origin: center center; + transform: rotate(0); + opacity: 1; + } + + 100% { + transform-origin: center center; + transform: rotate(200deg); + opacity: 0; + } +} + +.rotateOut { + -webkit-animation-name: rotateOut; + -moz-animation-name: rotateOut; + -o-animation-name: rotateOut; + animation-name: rotateOut; +} +@-webkit-keyframes rotateOutUpLeft { + 0% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(0); + opacity: 1; + } + + 100% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(-90deg); + opacity: 0; + } +} + +@-moz-keyframes rotateOutUpLeft { + 0% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(0); + opacity: 1; + } + + 100% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(-90deg); + opacity: 0; + } +} + +@-o-keyframes rotateOutUpLeft { + 0% { + -o-transform-origin: left bottom; + -o-transform: rotate(0); + opacity: 1; + } + + 100% { + -o-transform-origin: left bottom; + -o-transform: rotate(-90deg); + opacity: 0; + } +} + +@keyframes rotateOutUpLeft { + 0% { + transform-origin: left bottom; + transform: rotate(0); + opacity: 1; + } + + 100% { + transform-origin: left bottom; + transform: rotate(-90deg); + opacity: 0; + } +} + +.rotateOutUpLeft { + -webkit-animation-name: rotateOutUpLeft; + -moz-animation-name: rotateOutUpLeft; + -o-animation-name: rotateOutUpLeft; + animation-name: rotateOutUpLeft; +} +@-webkit-keyframes rotateOutDownLeft { + 0% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(0); + opacity: 1; + } + + 100% { + -webkit-transform-origin: left bottom; + -webkit-transform: rotate(90deg); + opacity: 0; + } +} + +@-moz-keyframes rotateOutDownLeft { + 0% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(0); + opacity: 1; + } + + 100% { + -moz-transform-origin: left bottom; + -moz-transform: rotate(90deg); + opacity: 0; + } +} + +@-o-keyframes rotateOutDownLeft { + 0% { + -o-transform-origin: left bottom; + -o-transform: rotate(0); + opacity: 1; + } + + 100% { + -o-transform-origin: left bottom; + -o-transform: rotate(90deg); + opacity: 0; + } +} + +@keyframes rotateOutDownLeft { + 0% { + transform-origin: left bottom; + transform: rotate(0); + opacity: 1; + } + + 100% { + transform-origin: left bottom; + transform: rotate(90deg); + opacity: 0; + } +} + +.rotateOutDownLeft { + -webkit-animation-name: rotateOutDownLeft; + -moz-animation-name: rotateOutDownLeft; + -o-animation-name: rotateOutDownLeft; + animation-name: rotateOutDownLeft; +} +@-webkit-keyframes rotateOutUpRight { + 0% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(0); + opacity: 1; + } + + 100% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(90deg); + opacity: 0; + } +} + +@-moz-keyframes rotateOutUpRight { + 0% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(0); + opacity: 1; + } + + 100% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(90deg); + opacity: 0; + } +} + +@-o-keyframes rotateOutUpRight { + 0% { + -o-transform-origin: right bottom; + -o-transform: rotate(0); + opacity: 1; + } + + 100% { + -o-transform-origin: right bottom; + -o-transform: rotate(90deg); + opacity: 0; + } +} + +@keyframes rotateOutUpRight { + 0% { + transform-origin: right bottom; + transform: rotate(0); + opacity: 1; + } + + 100% { + transform-origin: right bottom; + transform: rotate(90deg); + opacity: 0; + } +} + +.rotateOutUpRight { + -webkit-animation-name: rotateOutUpRight; + -moz-animation-name: rotateOutUpRight; + -o-animation-name: rotateOutUpRight; + animation-name: rotateOutUpRight; +} +@-webkit-keyframes rotateOutDownRight { + 0% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(0); + opacity: 1; + } + + 100% { + -webkit-transform-origin: right bottom; + -webkit-transform: rotate(-90deg); + opacity: 0; + } +} + +@-moz-keyframes rotateOutDownRight { + 0% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(0); + opacity: 1; + } + + 100% { + -moz-transform-origin: right bottom; + -moz-transform: rotate(-90deg); + opacity: 0; + } +} + +@-o-keyframes rotateOutDownRight { + 0% { + -o-transform-origin: right bottom; + -o-transform: rotate(0); + opacity: 1; + } + + 100% { + -o-transform-origin: right bottom; + -o-transform: rotate(-90deg); + opacity: 0; + } +} + +@keyframes rotateOutDownRight { + 0% { + transform-origin: right bottom; + transform: rotate(0); + opacity: 1; + } + + 100% { + transform-origin: right bottom; + transform: rotate(-90deg); + opacity: 0; + } +} + +.rotateOutDownRight { + -webkit-animation-name: rotateOutDownRight; + -moz-animation-name: rotateOutDownRight; + -o-animation-name: rotateOutDownRight; + animation-name: rotateOutDownRight; +} +@-webkit-keyframes hinge { + 0% { -webkit-transform: rotate(0); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; } + 20%, 60% { -webkit-transform: rotate(80deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; } + 40% { -webkit-transform: rotate(60deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; } + 80% { -webkit-transform: rotate(60deg) translateY(0); opacity: 1; -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; } + 100% { -webkit-transform: translateY(700px); opacity: 0; } +} + +@-moz-keyframes hinge { + 0% { -moz-transform: rotate(0); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; } + 20%, 60% { -moz-transform: rotate(80deg); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; } + 40% { -moz-transform: rotate(60deg); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; } + 80% { -moz-transform: rotate(60deg) translateY(0); opacity: 1; -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; } + 100% { -moz-transform: translateY(700px); opacity: 0; } +} + +@-o-keyframes hinge { + 0% { -o-transform: rotate(0); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; } + 20%, 60% { -o-transform: rotate(80deg); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; } + 40% { -o-transform: rotate(60deg); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; } + 80% { -o-transform: rotate(60deg) translateY(0); opacity: 1; -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; } + 100% { -o-transform: translateY(700px); opacity: 0; } +} + +@keyframes hinge { + 0% { transform: rotate(0); transform-origin: top left; animation-timing-function: ease-in-out; } + 20%, 60% { transform: rotate(80deg); transform-origin: top left; animation-timing-function: ease-in-out; } + 40% { transform: rotate(60deg); transform-origin: top left; animation-timing-function: ease-in-out; } + 80% { transform: rotate(60deg) translateY(0); opacity: 1; transform-origin: top left; animation-timing-function: ease-in-out; } + 100% { transform: translateY(700px); opacity: 0; } +} + +.hinge { + -webkit-animation-name: hinge; + -moz-animation-name: hinge; + -o-animation-name: hinge; + animation-name: hinge; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes rollIn { + 0% { opacity: 0; -webkit-transform: translateX(-100%) rotate(-120deg); } + 100% { opacity: 1; -webkit-transform: translateX(0px) rotate(0deg); } +} + +@-moz-keyframes rollIn { + 0% { opacity: 0; -moz-transform: translateX(-100%) rotate(-120deg); } + 100% { opacity: 1; -moz-transform: translateX(0px) rotate(0deg); } +} + +@-o-keyframes rollIn { + 0% { opacity: 0; -o-transform: translateX(-100%) rotate(-120deg); } + 100% { opacity: 1; -o-transform: translateX(0px) rotate(0deg); } +} + +@keyframes rollIn { + 0% { opacity: 0; transform: translateX(-100%) rotate(-120deg); } + 100% { opacity: 1; transform: translateX(0px) rotate(0deg); } +} + +.rollIn { + -webkit-animation-name: rollIn; + -moz-animation-name: rollIn; + -o-animation-name: rollIn; + animation-name: rollIn; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@-webkit-keyframes rollOut { + 0% { + opacity: 1; + -webkit-transform: translateX(0px) rotate(0deg); + } + + 100% { + opacity: 0; + -webkit-transform: translateX(100%) rotate(120deg); + } +} + +@-moz-keyframes rollOut { + 0% { + opacity: 1; + -moz-transform: translateX(0px) rotate(0deg); + } + + 100% { + opacity: 0; + -moz-transform: translateX(100%) rotate(120deg); + } +} + +@-o-keyframes rollOut { + 0% { + opacity: 1; + -o-transform: translateX(0px) rotate(0deg); + } + + 100% { + opacity: 0; + -o-transform: translateX(100%) rotate(120deg); + } +} + +@keyframes rollOut { + 0% { + opacity: 1; + transform: translateX(0px) rotate(0deg); + } + + 100% { + opacity: 0; + transform: translateX(100%) rotate(120deg); + } +} + +.rollOut { + -webkit-animation-name: rollOut; + -moz-animation-name: rollOut; + -o-animation-name: rollOut; + animation-name: rollOut; +} + +/* originally authored by Angelo Rohit - https://github.com/angelorohit */ + +@-webkit-keyframes lightSpeedIn { + 0% { -webkit-transform: translateX(100%) skewX(-30deg); opacity: 0; } + 60% { -webkit-transform: translateX(-20%) skewX(30deg); opacity: 1; } + 80% { -webkit-transform: translateX(0%) skewX(-15deg); opacity: 1; } + 100% { -webkit-transform: translateX(0%) skewX(0deg); opacity: 1; } +} + +@-moz-keyframes lightSpeedIn { + 0% { -moz-transform: translateX(100%) skewX(-30deg); opacity: 0; } + 60% { -moz-transform: translateX(-20%) skewX(30deg); opacity: 1; } + 80% { -moz-transform: translateX(0%) skewX(-15deg); opacity: 1; } + 100% { -moz-transform: translateX(0%) skewX(0deg); opacity: 1; } +} + +@-o-keyframes lightSpeedIn { + 0% { -o-transform: translateX(100%) skewX(-30deg); opacity: 0; } + 60% { -o-transform: translateX(-20%) skewX(30deg); opacity: 1; } + 80% { -o-transform: translateX(0%) skewX(-15deg); opacity: 1; } + 100% { -o-transform: translateX(0%) skewX(0deg); opacity: 1; } +} + +@keyframes lightSpeedIn { + 0% { transform: translateX(100%) skewX(-30deg); opacity: 0; } + 60% { transform: translateX(-20%) skewX(30deg); opacity: 1; } + 80% { transform: translateX(0%) skewX(-15deg); opacity: 1; } + 100% { transform: translateX(0%) skewX(0deg); opacity: 1; } +} + +.lightSpeedIn { + -webkit-animation-name: lightSpeedIn; + -moz-animation-name: lightSpeedIn; + -o-animation-name: lightSpeedIn; + animation-name: lightSpeedIn; + + -webkit-animation-timing-function: ease-out; + -moz-animation-timing-function: ease-out; + -o-animation-timing-function: ease-out; + animation-timing-function: ease-out; +} + +.animated.lightSpeedIn { + -webkit-animation-duration: 0.5s; + -moz-animation-duration: 0.5s; + -o-animation-duration: 0.5s; + animation-duration: 0.5s; +} + +/* originally authored by Angelo Rohit - https://github.com/angelorohit */ + +@-webkit-keyframes lightSpeedOut { + 0% { -webkit-transform: translateX(0%) skewX(0deg); opacity: 1; } + 100% { -webkit-transform: translateX(100%) skewX(-30deg); opacity: 0; } +} + +@-moz-keyframes lightSpeedOut { + 0% { -moz-transform: translateX(0%) skewX(0deg); opacity: 1; } + 100% { -moz-transform: translateX(100%) skewX(-30deg); opacity: 0; } +} + +@-o-keyframes lightSpeedOut { + 0% { -o-transform: translateX(0%) skewX(0deg); opacity: 1; } + 100% { -o-transform: translateX(100%) skewX(-30deg); opacity: 0; } +} + +@keyframes lightSpeedOut { + 0% { transform: translateX(0%) skewX(0deg); opacity: 1; } + 100% { transform: translateX(100%) skewX(-30deg); opacity: 0; } +} + +.lightSpeedOut { + -webkit-animation-name: lightSpeedOut; + -moz-animation-name: lightSpeedOut; + -o-animation-name: lightSpeedOut; + animation-name: lightSpeedOut; + + -webkit-animation-timing-function: ease-in; + -moz-animation-timing-function: ease-in; + -o-animation-timing-function: ease-in; + animation-timing-function: ease-in; +} + +.animated.lightSpeedOut { + -webkit-animation-duration: 0.25s; + -moz-animation-duration: 0.25s; + -o-animation-duration: 0.25s; + animation-duration: 0.25s; +} + +/* originally authored by Angelo Rohit - https://github.com/angelorohit */ + +@-webkit-keyframes wiggle { + 0% { -webkit-transform: skewX(9deg); } + 10% { -webkit-transform: skewX(-8deg); } + 20% { -webkit-transform: skewX(7deg); } + 30% { -webkit-transform: skewX(-6deg); } + 40% { -webkit-transform: skewX(5deg); } + 50% { -webkit-transform: skewX(-4deg); } + 60% { -webkit-transform: skewX(3deg); } + 70% { -webkit-transform: skewX(-2deg); } + 80% { -webkit-transform: skewX(1deg); } + 90% { -webkit-transform: skewX(0deg); } + 100% { -webkit-transform: skewX(0deg); } +} + +@-moz-keyframes wiggle { + 0% { -moz-transform: skewX(9deg); } + 10% { -moz-transform: skewX(-8deg); } + 20% { -moz-transform: skewX(7deg); } + 30% { -moz-transform: skewX(-6deg); } + 40% { -moz-transform: skewX(5deg); } + 50% { -moz-transform: skewX(-4deg); } + 60% { -moz-transform: skewX(3deg); } + 70% { -moz-transform: skewX(-2deg); } + 80% { -moz-transform: skewX(1deg); } + 90% { -moz-transform: skewX(0deg); } + 100% { -moz-transform: skewX(0deg); } +} + +@-o-keyframes wiggle { + 0% { -o-transform: skewX(9deg); } + 10% { -o-transform: skewX(-8deg); } + 20% { -o-transform: skewX(7deg); } + 30% { -o-transform: skewX(-6deg); } + 40% { -o-transform: skewX(5deg); } + 50% { -o-transform: skewX(-4deg); } + 60% { -o-transform: skewX(3deg); } + 70% { -o-transform: skewX(-2deg); } + 80% { -o-transform: skewX(1deg); } + 90% { -o-transform: skewX(0deg); } + 100% { -o-transform: skewX(0deg); } +} + +@keyframes wiggle { + 0% { transform: skewX(9deg); } + 10% { transform: skewX(-8deg); } + 20% { transform: skewX(7deg); } + 30% { transform: skewX(-6deg); } + 40% { transform: skewX(5deg); } + 50% { transform: skewX(-4deg); } + 60% { transform: skewX(3deg); } + 70% { transform: skewX(-2deg); } + 80% { transform: skewX(1deg); } + 90% { transform: skewX(0deg); } + 100% { transform: skewX(0deg); } +} + +.wiggle { + -webkit-animation-name: wiggle; + -moz-animation-name: wiggle; + -o-animation-name: wiggle; + animation-name: wiggle; + + -webkit-animation-timing-function: ease-in; + -moz-animation-timing-function: ease-in; + -o-animation-timing-function: ease-in; + animation-timing-function: ease-in; +} + +.animated.wiggle { + -webkit-animation-duration: 0.75s; + -moz-animation-duration: 0.75s; + -o-animation-duration: 0.75s; + animation-duration: 0.75s; +} \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 97cb8dcd..26cdd05f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -15,6 +15,7 @@ *= require ForceDirected *= require jquery.mCustomScrollbar *= require jquery-ui + *= require animate */ @font-face { @@ -58,15 +59,48 @@ html { } body { - background:#031924 url(background2-for-repeating.jpg) repeat 0 0; + /* IE10 Consumer Preview */ + background-image: -ms-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Mozilla Firefox */ + background-image: -moz-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Opera */ + background-image: -o-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Webkit (Safari/Chrome 10) */ + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #C199FB), color-stop(1, #E4D9F5)); + + /* Webkit (Chrome 11+) */ + background-image: -webkit-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* W3C Markup, IE10 Release Preview */ + background-image: linear-gradient(to top, #C199FB 0%, #E4D9F5 100%); + background: url(fresnel-mountainous-landscape-002.png) no-repeat; + background-size:cover; font-family: 'LatoLight', helvetica, sans-serif; background-attachment:fixed; color:#FFF; } -body.bodyFAQ { -/*background: #031924 url(mushroom.jpg) no-repeat center center; -background-size: cover;*/ +body.mapBody { + /* IE10 Consumer Preview */ + background-image: -ms-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Mozilla Firefox */ + background-image: -moz-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Opera */ + background-image: -o-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* Webkit (Safari/Chrome 10) */ + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #C199FB), color-stop(1, #E4D9F5)); + + /* Webkit (Chrome 11+) */ + background-image: -webkit-linear-gradient(bottom, #C199FB 0%, #E4D9F5 100%); + + /* W3C Markup, IE10 Release Preview */ + background-image: linear-gradient(to top, #C199FB 0%, #E4D9F5 100%); } h1,h2,h3,h4,h5,h6 { @@ -106,14 +140,11 @@ padding: 0 0; width: 60px; -webkit-box-shadow: none; box-shadow: none; -background: #69a3a4; -background: -webkit-linear-gradient(top,#69a3a4,#69a3aF); -background: linear-gradient(top,#4387fd,#4683ea); -filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4387fd,endColorstr=#4683ea,GradientType=1); +background: #AEA9FD; vertical-align: top; -color: #fff; +color: black; margin: 0px; -cursor: default; +cursor: pointer; display: inline-block; font-weight: bold; line-height: 29px; @@ -126,8 +157,7 @@ border-radius: 2px; } button.button:hover, a.button:hover, input[type="submit"]:hover { --webkit-box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); -box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); + background: #B6B2FD; } /* @@ -180,7 +210,7 @@ box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); .centeredProfile { margin:0 auto; display: block; - width: 845px; + width: 830px; } .requestInvite { @@ -431,14 +461,12 @@ border-radius: 5px; right: 0px; z-index: 9999; width: auto; - background: #0F1519; padding: 1px 10px 0px 10px; font-family: "vinyl",sans-serif; font-style:italic; height: 35px; font-size: 30px; line-height: 38px; - border:1px solid #000; border-right:none; border-bottom-left-radius:5px; border-top-left-radius:5px; @@ -446,17 +474,16 @@ border-radius: 5px; .wrapper div.index .openCheatsheet { position:absolute; top:0; - left:-45px; - background: #0F1519 url('MMCCicon_help.png') no-repeat center center; + left:-30px; + background: url('MMCCicon_help.png') no-repeat center center; background-size: 32px 32px; - border:1px solid #000; border-radius:5px; height:36px; width:36px; cursor:pointer; } .wrapper div.index .openCheatsheet:hover { - background-color: #161E24; + } .wrapper div.index span { float:left; @@ -482,14 +509,12 @@ border-radius: 5px; right: 0; z-index: 9999; width: auto; - background: #0F1519; padding: 1px 10px 0px 20px; text-transform:uppercase; font-style:italic; height: 35px; font-size: 30px; line-height: 38px; - border:1px solid #000; border-right:none; border-bottom-left-radius:5px; border-top-left-radius:5px; @@ -1624,7 +1649,7 @@ border: solid 2px #000; } #lightbox_content { - background: white; + background: white url(metacode-watermark.png) 443px -30px no-repeat; padding: 20px; border-radius:5px; } @@ -1980,33 +2005,30 @@ background-image: url('/assets/MMCCicon_minimize_arrow.png') !important; bottom: 9px; height: 35px; z-index: 15000; - border:1px solid #000; border-bottom-right-radius:5px; border-top-right-radius:5px; } .addMap { position: absolute; -right: -50px; +right: -40px; top: -1px; width: 44px; -height: 35px; -background: #69a3a4 url('MMCCicon_add_map.png') no-repeat 3px -4px; +height: 37px; +background: url('MMCCicon_add_map.png') no-repeat 3px -4px; background-size: 40px 40px; -border-left: 1px solid rgba(255,255,255,0.6); border-radius: 5px; -border: 1px solid black; cursor:pointer; } .addMap:hover { -background-color: #6FA9AA; + } .logo { z-index:12; display:block; width: 136px; -background: #0F1519 url(menu_icon_32.png) no-repeat -10px 8px; +background: url(menu_icon_32.png) no-repeat -10px 8px; padding: 5px 0px 1px 15px; background-size: 22px 20px; } @@ -2041,9 +2063,7 @@ background-size: 22px 20px; overflow: hidden; padding: 0 0 0 30px; margin: 0; - background: #0F1519 url(beta_gen002.png) no-repeat 6px 12px; - border-left:1px solid #000; - border-right:1px solid #000; + background: url(beta_gen002.png) no-repeat 6px 12px; } .footer ul li { @@ -2083,6 +2103,7 @@ li.meta, li.tutorial, li.exploreMaps { } +/* home page */ .home_content { width: 830px; @@ -2094,35 +2115,140 @@ span.blue { } .home_desc { -font-style: oblique; -text-transform: uppercase; -font-family: 'vinyl'; -font-size: 40px; +font-family: 'LatoLight'; +font-size: 32px; margin: 40px 20px 25px; text-align:center; } +.home_desc .welcomeTo { + text-transform: uppercase; + font-size: 50px; + font-family: 'Vinyl'; + font-style: italic; +} .home_content .request { -margin: 5px auto; -background: #15bad4; -height: 40px; -font-family: 'LatoLight'; -font-size: 16px; -font-style: italic; -width: auto; -padding: 0 30px; -cursor: pointer; -color:white; -line-height:40px; + margin-right:17px !important; } -.home_content .request:hover{ -background: #19C8E4; +.home_content .request, .home_content .learnmore { +margin: 5px auto; +background: white; +height: 40px; +font-family: 'Vinyl'; +font-size: 18px; +font-style: italic; +width: 135px; +padding: 0 15px; +cursor: pointer; +color:black; +line-height:44px; +font-weight: normal; +text-transform: uppercase; +} +.home_content .request:hover, .home_content .learnmore:hover { +background: white; -webkit-box-shadow: none; box-shadow: none; } +.metamapsIs { + +} +.metamapsIs .swapWord { + display: block; +} + +#homeMapImage { + margin:5px auto; +} + #homeMap { - margin-left:23px; + width:738px; + margin: 0 auto; + height:265px; + position:relative; + overflow:hidden; +} +#homeFigure { + height: 265px; + width:1290px; + margin:0; +} +#homeFigure figure { + float:left; + margin:10px !important; + overflow:hidden; +} + +#homeMap .mapPerm { +height: 40px; +background-repeat: no-repeat; +background-position: 7px center; +background-size: 27px 27px; +position: relative; +padding-left:40px; +line-height:40px; +} +#homeMap .mapPerm.co { +background-image: url(MMCCicon_commons.png); +} +#homeMap .mapPerm.pu { +background-image: url(MMCCicon_public.png); +} +#homeMap .mapPerm.pr { +background-image: url(MMCCicon_private.png); +} + +.mapContains { + position:absolute; + height:40px; + line-height:40px; + bottom:0; + width:100%; +} +.mapContains span { + display:inline-block; + text-align:left; + padding-left: 27px; +} + +.mapContains .topicCount { + background-image: url(MMCCicon_topic.png); + background-size: 20px 20px; + background-repeat: no-repeat; +background-position: 5px center; +line-height: 40px; +width:72px; +} +.mapContains .synapseCount { + background-image: url(MMCCicon_synapse_black.png); + background-size: 20px 20px; + background-repeat: no-repeat; +background-position: 5px center; +line-height: 40px; +width:95px; +} + + +#homeFigure figure .littleOverlay { +position: absolute; +top: 100%; +width: 100%; +z-index: 2; +background: rgba(255, 255, 255, 0); +transition: .6s; +border-radius:5px; +} + +#homeFigure figure:hover .littleOverlay { + top: 0; + background: rgba(255,255,255, 0.9); + bottom: 0; +} + + +#homeMap .map, #homeMap .mapCard { + height:226px; } .contact { diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4758631b..6bc75d8a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -35,7 +35,7 @@ <%= csrf_meta_tags %> -" > +" > <% if notice %>

<%= notice %>

diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index 96d670d6..a4fb7e26 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -10,26 +10,68 @@
-Metamaps is a platform for visioning, magic making, productive conversation, understanding something, innovation, free style weaving and all night brainstorming. +
Welcome to Metamaps
+ +
+ a home on the web for +
    +
  • building shared knowledge
  • +
  • learning
  • +
  • visioning
  • +
  • conversing
  • +
  • collaborating
  • +
  • sensemaking
  • +
  • innovating
  • +
  • designing
  • +
  • playing
  • +
  • exploring
  • +
+
+

Request Invite + Learn More +
+
+ explore what experienced metamappers are creating

- <% @maps.each do |map| %> - <%= render map %> +
+ <% @maps.each_with_index do |map, index| %> + <% first = index == 0 ? true : false %> + <%= render :partial => 'maps/homemap', :locals => { :map => map, :first => first } %> <% end %> +
-
-

- Welcome! -

+ + + \ No newline at end of file diff --git a/app/views/main/paq.html.erb b/app/views/main/paq.html.erb index 82bf601b..580fce86 100644 --- a/app/views/main/paq.html.erb +++ b/app/views/main/paq.html.erb @@ -35,7 +35,6 @@
How can I participate, or support the project?

We welcome contributions in many forms. One of the easiest and best things you can do is to keep on mapping your ideas into the commons on the platform! If you're a developer interested in advancing the technology, contact us and take a look around our Github. Designers and others with professional skills can get in touch about opportunities for freelance collaboration through our innovative Open Value Network organizational structure for business development opportunities. Financial contributions are greatly appreciated in support of our work, and can be made by supporting us on Flattr or donating BitCoin. All financial contributions are transparently recorded in our value accounting.

-

BTC Address: 14GontNS1FKoiTQDEB5WBCUDZaFTiyxkzN

Are you making money from it? Do you plan to?

To date, the Metamaps.cc project has been supported by volunteers and small grants or donations. We intend to establish an open collaborative environment to pursue revenue opportunities in an agile and equitable fashion by configuring products and services based on the open source Metamaps technology. Stay tuned for further info via our blog and social media, or get in touch if you'd like to join the team!

diff --git a/app/views/maps/_homemap.html.erb b/app/views/maps/_homemap.html.erb new file mode 100644 index 00000000..3f6c0ebd --- /dev/null +++ b/app/views/maps/_homemap.html.erb @@ -0,0 +1,31 @@ +<%# + # @file + # Shows a map as a card. + # Any list of maps uses this rendering. + #%> +
"> + +
"> + +
+
help build this map
+ + <%= best_in_place map, :name, :type => :input, :classes => 'best_in_place_name' %> + +
+ <%= pluralize(map.topics.count, 'topic') %> + <%= pluralize(map.synapses.count, 'synapse') %> +
+
+
+
+ <%= best_in_place map, :desc, :type => :textarea, :nil => "Click to add description.", :classes => 'best_in_place_desc' %> +
+
+ <%= pluralize(map.contributors.count, 'contributor') %>Last edit <%= time_ago_in_words( map.last_edited ) %> ago +
+
+ +
+
+
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 183e9128..bd436df1 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -10,7 +10,7 @@ Devise.setup do |config| # config.mailer = "Devise::Mailer" if Rails.env.production? - #config.secret_key = 'd91ba0da95749174ee2b8922034783cbde4945409ed28b13383e18e72844beb74467f8199e9e216f0687cd2290c6e46bf74da24486d14bba3671d76c5b10c753' + config.secret_key = 'd91ba0da95749174ee2b8922034783cbde4945409ed28b13383e18e72844beb74467f8199e9e216f0687cd2290c6e46bf74da24486d14bba3671d76c5b10c753' end # ==> ORM configuration diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb index 3acdbeae..85937713 100644 --- a/config/initializers/redis.rb +++ b/config/initializers/redis.rb @@ -1,6 +1,6 @@ -#if Rails.env.development? +if Rails.env.development? $redis = Redis.new(:host => 'localhost', :port=> 6379) -#elsif Rails.env.production? -# uri = URI.parse(ENV["REDISTOGO_URL"]) -# $redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password) -#end \ No newline at end of file +elsif Rails.env.production? + uri = URI.parse(ENV["REDISTOGO_URL"]) + $redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password) +end \ No newline at end of file diff --git a/public/assets/Fonts/Lato-Lig-webfont-1435188a694a7d5e29cf4a3288ff3e36.eot b/public/assets/Fonts/Lato-Lig-webfont-1435188a694a7d5e29cf4a3288ff3e36.eot deleted file mode 100644 index 42265967..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont-1435188a694a7d5e29cf4a3288ff3e36.eot and /dev/null differ diff --git a/public/assets/Fonts/Lato-Lig-webfont-47c2912f319ae759c3b1cd558b080c33.woff b/public/assets/Fonts/Lato-Lig-webfont-47c2912f319ae759c3b1cd558b080c33.woff deleted file mode 100644 index 0c337a6a..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont-47c2912f319ae759c3b1cd558b080c33.woff and /dev/null differ diff --git a/public/assets/Fonts/Lato-Lig-webfont-496f32fb28e2be2d6a4b41f1c7e37cc1.svg b/public/assets/Fonts/Lato-Lig-webfont-496f32fb28e2be2d6a4b41f1c7e37cc1.svg deleted file mode 100644 index e89a231a..00000000 --- a/public/assets/Fonts/Lato-Lig-webfont-496f32fb28e2be2d6a4b41f1c7e37cc1.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/assets/Fonts/Lato-Lig-webfont-4b8f0d5ac83e783eb84848ff3254685c.ttf b/public/assets/Fonts/Lato-Lig-webfont-4b8f0d5ac83e783eb84848ff3254685c.ttf deleted file mode 100644 index 86b4e957..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont-4b8f0d5ac83e783eb84848ff3254685c.ttf and /dev/null differ diff --git a/public/assets/Fonts/Lato-Lig-webfont.eot b/public/assets/Fonts/Lato-Lig-webfont.eot deleted file mode 100644 index 42265967..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont.eot and /dev/null differ diff --git a/public/assets/Fonts/Lato-Lig-webfont.svg b/public/assets/Fonts/Lato-Lig-webfont.svg deleted file mode 100644 index e89a231a..00000000 --- a/public/assets/Fonts/Lato-Lig-webfont.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/assets/Fonts/Lato-Lig-webfont.ttf b/public/assets/Fonts/Lato-Lig-webfont.ttf deleted file mode 100644 index 86b4e957..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont.ttf and /dev/null differ diff --git a/public/assets/Fonts/Lato-Lig-webfont.woff b/public/assets/Fonts/Lato-Lig-webfont.woff deleted file mode 100644 index 0c337a6a..00000000 Binary files a/public/assets/Fonts/Lato-Lig-webfont.woff and /dev/null differ diff --git a/public/assets/MMCCicon_add-e907e5cd1adb7cee2cacd99aabf8ed5d.png b/public/assets/MMCCicon_add-e907e5cd1adb7cee2cacd99aabf8ed5d.png deleted file mode 100644 index fdb4045f..00000000 Binary files a/public/assets/MMCCicon_add-e907e5cd1adb7cee2cacd99aabf8ed5d.png and /dev/null differ diff --git a/public/assets/MMCCicon_add.png b/public/assets/MMCCicon_add.png deleted file mode 100644 index fdb4045f..00000000 Binary files a/public/assets/MMCCicon_add.png and /dev/null differ diff --git a/public/assets/MMCCicon_add_map-b6c2f61965518fcf1a48cd22d18783b5.png b/public/assets/MMCCicon_add_map-b6c2f61965518fcf1a48cd22d18783b5.png deleted file mode 100644 index af4832b7..00000000 Binary files a/public/assets/MMCCicon_add_map-b6c2f61965518fcf1a48cd22d18783b5.png and /dev/null differ diff --git a/public/assets/MMCCicon_add_map.png b/public/assets/MMCCicon_add_map.png deleted file mode 100644 index af4832b7..00000000 Binary files a/public/assets/MMCCicon_add_map.png and /dev/null differ diff --git a/public/assets/MMCCicon_commons-51c9d948f0f791cf52aca4e294e48975.png b/public/assets/MMCCicon_commons-51c9d948f0f791cf52aca4e294e48975.png deleted file mode 100644 index 1eed3c5b..00000000 Binary files a/public/assets/MMCCicon_commons-51c9d948f0f791cf52aca4e294e48975.png and /dev/null differ diff --git a/public/assets/MMCCicon_commons.png b/public/assets/MMCCicon_commons.png deleted file mode 100644 index 1eed3c5b..00000000 Binary files a/public/assets/MMCCicon_commons.png and /dev/null differ diff --git a/public/assets/MMCCicon_commons_black-0838a93739999edccd2536ac78ca40aa.png b/public/assets/MMCCicon_commons_black-0838a93739999edccd2536ac78ca40aa.png deleted file mode 100644 index 4f06fed8..00000000 Binary files a/public/assets/MMCCicon_commons_black-0838a93739999edccd2536ac78ca40aa.png and /dev/null differ diff --git a/public/assets/MMCCicon_commons_black.png b/public/assets/MMCCicon_commons_black.png deleted file mode 100644 index 4f06fed8..00000000 Binary files a/public/assets/MMCCicon_commons_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_delete_black-12da9e8e5ebba4f4bdbcf0c51b7edc86.png b/public/assets/MMCCicon_delete_black-12da9e8e5ebba4f4bdbcf0c51b7edc86.png deleted file mode 100644 index 017a1adf..00000000 Binary files a/public/assets/MMCCicon_delete_black-12da9e8e5ebba4f4bdbcf0c51b7edc86.png and /dev/null differ diff --git a/public/assets/MMCCicon_delete_black.png b/public/assets/MMCCicon_delete_black.png deleted file mode 100644 index 017a1adf..00000000 Binary files a/public/assets/MMCCicon_delete_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_delete_grey-139563eb178ac12911430f31c487eff6.png b/public/assets/MMCCicon_delete_grey-139563eb178ac12911430f31c487eff6.png deleted file mode 100644 index 4ba2b136..00000000 Binary files a/public/assets/MMCCicon_delete_grey-139563eb178ac12911430f31c487eff6.png and /dev/null differ diff --git a/public/assets/MMCCicon_delete_grey.png b/public/assets/MMCCicon_delete_grey.png deleted file mode 100644 index 4ba2b136..00000000 Binary files a/public/assets/MMCCicon_delete_grey.png and /dev/null differ diff --git a/public/assets/MMCCicon_filter-8dd344476ca9fb88261938acb66d2c79.png b/public/assets/MMCCicon_filter-8dd344476ca9fb88261938acb66d2c79.png deleted file mode 100644 index afb23324..00000000 Binary files a/public/assets/MMCCicon_filter-8dd344476ca9fb88261938acb66d2c79.png and /dev/null differ diff --git a/public/assets/MMCCicon_filter.png b/public/assets/MMCCicon_filter.png deleted file mode 100644 index afb23324..00000000 Binary files a/public/assets/MMCCicon_filter.png and /dev/null differ diff --git a/public/assets/MMCCicon_filter2-2ce402ad9cc218a3a6ac5e86ae0f0a03.png b/public/assets/MMCCicon_filter2-2ce402ad9cc218a3a6ac5e86ae0f0a03.png deleted file mode 100644 index 5b50ffdd..00000000 Binary files a/public/assets/MMCCicon_filter2-2ce402ad9cc218a3a6ac5e86ae0f0a03.png and /dev/null differ diff --git a/public/assets/MMCCicon_filter2.png b/public/assets/MMCCicon_filter2.png deleted file mode 100644 index 5b50ffdd..00000000 Binary files a/public/assets/MMCCicon_filter2.png and /dev/null differ diff --git a/public/assets/MMCCicon_go-aae580938b3ea29afbe3de759feee359.png b/public/assets/MMCCicon_go-aae580938b3ea29afbe3de759feee359.png deleted file mode 100644 index e35a0f87..00000000 Binary files a/public/assets/MMCCicon_go-aae580938b3ea29afbe3de759feee359.png and /dev/null differ diff --git a/public/assets/MMCCicon_go.png b/public/assets/MMCCicon_go.png deleted file mode 100644 index e35a0f87..00000000 Binary files a/public/assets/MMCCicon_go.png and /dev/null differ diff --git a/public/assets/MMCCicon_help-dfde3a342abc809a6508695a75ea9b87.png b/public/assets/MMCCicon_help-dfde3a342abc809a6508695a75ea9b87.png deleted file mode 100644 index 16cd1894..00000000 Binary files a/public/assets/MMCCicon_help-dfde3a342abc809a6508695a75ea9b87.png and /dev/null differ diff --git a/public/assets/MMCCicon_help.png b/public/assets/MMCCicon_help.png deleted file mode 100644 index 16cd1894..00000000 Binary files a/public/assets/MMCCicon_help.png and /dev/null differ diff --git a/public/assets/MMCCicon_hide-e2fcfe3fcaeef87d07322aeea2b2af37.png b/public/assets/MMCCicon_hide-e2fcfe3fcaeef87d07322aeea2b2af37.png deleted file mode 100644 index 80ea7276..00000000 Binary files a/public/assets/MMCCicon_hide-e2fcfe3fcaeef87d07322aeea2b2af37.png and /dev/null differ diff --git a/public/assets/MMCCicon_hide.png b/public/assets/MMCCicon_hide.png deleted file mode 100644 index 80ea7276..00000000 Binary files a/public/assets/MMCCicon_hide.png and /dev/null differ diff --git a/public/assets/MMCCicon_info-76fbf35e20e1bb6facb3e14254543c9c.png b/public/assets/MMCCicon_info-76fbf35e20e1bb6facb3e14254543c9c.png deleted file mode 100644 index 4594cba0..00000000 Binary files a/public/assets/MMCCicon_info-76fbf35e20e1bb6facb3e14254543c9c.png and /dev/null differ diff --git a/public/assets/MMCCicon_info.png b/public/assets/MMCCicon_info.png deleted file mode 100644 index 4594cba0..00000000 Binary files a/public/assets/MMCCicon_info.png and /dev/null differ diff --git a/public/assets/MMCCicon_invite-33ce02d3a0500b602c15e9192c3c4f66.png b/public/assets/MMCCicon_invite-33ce02d3a0500b602c15e9192c3c4f66.png deleted file mode 100644 index 347ddc02..00000000 Binary files a/public/assets/MMCCicon_invite-33ce02d3a0500b602c15e9192c3c4f66.png and /dev/null differ diff --git a/public/assets/MMCCicon_invite.png b/public/assets/MMCCicon_invite.png deleted file mode 100644 index 347ddc02..00000000 Binary files a/public/assets/MMCCicon_invite.png and /dev/null differ diff --git a/public/assets/MMCCicon_link-32bc019e1ba44c73c8898de7ca0de1fa.png b/public/assets/MMCCicon_link-32bc019e1ba44c73c8898de7ca0de1fa.png deleted file mode 100644 index 8bd1ee24..00000000 Binary files a/public/assets/MMCCicon_link-32bc019e1ba44c73c8898de7ca0de1fa.png and /dev/null differ diff --git a/public/assets/MMCCicon_link.png b/public/assets/MMCCicon_link.png deleted file mode 100644 index 8bd1ee24..00000000 Binary files a/public/assets/MMCCicon_link.png and /dev/null differ diff --git a/public/assets/MMCCicon_logout-2b7d4dfff8cdc4d38089c082ac0c6929.png b/public/assets/MMCCicon_logout-2b7d4dfff8cdc4d38089c082ac0c6929.png deleted file mode 100644 index 5f22796f..00000000 Binary files a/public/assets/MMCCicon_logout-2b7d4dfff8cdc4d38089c082ac0c6929.png and /dev/null differ diff --git a/public/assets/MMCCicon_logout.png b/public/assets/MMCCicon_logout.png deleted file mode 100644 index 5f22796f..00000000 Binary files a/public/assets/MMCCicon_logout.png and /dev/null differ diff --git a/public/assets/MMCCicon_map-77c3768601370ee04d15f7da448fee91.png b/public/assets/MMCCicon_map-77c3768601370ee04d15f7da448fee91.png deleted file mode 100644 index e1a61d89..00000000 Binary files a/public/assets/MMCCicon_map-77c3768601370ee04d15f7da448fee91.png and /dev/null differ diff --git a/public/assets/MMCCicon_map.png b/public/assets/MMCCicon_map.png deleted file mode 100644 index e1a61d89..00000000 Binary files a/public/assets/MMCCicon_map.png and /dev/null differ diff --git a/public/assets/MMCCicon_map_black-f07d554e21d2f064d72d94f33efec39f.png b/public/assets/MMCCicon_map_black-f07d554e21d2f064d72d94f33efec39f.png deleted file mode 100644 index abefa2a1..00000000 Binary files a/public/assets/MMCCicon_map_black-f07d554e21d2f064d72d94f33efec39f.png and /dev/null differ diff --git a/public/assets/MMCCicon_map_black.png b/public/assets/MMCCicon_map_black.png deleted file mode 100644 index abefa2a1..00000000 Binary files a/public/assets/MMCCicon_map_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_mapper-3d7a6f42563271141b72483efa7701d2.png b/public/assets/MMCCicon_mapper-3d7a6f42563271141b72483efa7701d2.png deleted file mode 100644 index 0e9c3207..00000000 Binary files a/public/assets/MMCCicon_mapper-3d7a6f42563271141b72483efa7701d2.png and /dev/null differ diff --git a/public/assets/MMCCicon_mapper.png b/public/assets/MMCCicon_mapper.png deleted file mode 100644 index 0e9c3207..00000000 Binary files a/public/assets/MMCCicon_mapper.png and /dev/null differ diff --git a/public/assets/MMCCicon_mapper_black-8e5daace6edd134213588252f1426e10.png b/public/assets/MMCCicon_mapper_black-8e5daace6edd134213588252f1426e10.png deleted file mode 100644 index a324b3a9..00000000 Binary files a/public/assets/MMCCicon_mapper_black-8e5daace6edd134213588252f1426e10.png and /dev/null differ diff --git a/public/assets/MMCCicon_mapper_black.png b/public/assets/MMCCicon_mapper_black.png deleted file mode 100644 index a324b3a9..00000000 Binary files a/public/assets/MMCCicon_mapper_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_maximize_arrow-d529ebb50a2254187a1d42e7ec496eaa.png b/public/assets/MMCCicon_maximize_arrow-d529ebb50a2254187a1d42e7ec496eaa.png deleted file mode 100644 index 1fe42d26..00000000 Binary files a/public/assets/MMCCicon_maximize_arrow-d529ebb50a2254187a1d42e7ec496eaa.png and /dev/null differ diff --git a/public/assets/MMCCicon_maximize_arrow.png b/public/assets/MMCCicon_maximize_arrow.png deleted file mode 100644 index 1fe42d26..00000000 Binary files a/public/assets/MMCCicon_maximize_arrow.png and /dev/null differ diff --git a/public/assets/MMCCicon_maximize_arrow_black-e74d6a248225791c761025c94dd6cc67.png b/public/assets/MMCCicon_maximize_arrow_black-e74d6a248225791c761025c94dd6cc67.png deleted file mode 100644 index 5196c38e..00000000 Binary files a/public/assets/MMCCicon_maximize_arrow_black-e74d6a248225791c761025c94dd6cc67.png and /dev/null differ diff --git a/public/assets/MMCCicon_maximize_arrow_black.png b/public/assets/MMCCicon_maximize_arrow_black.png deleted file mode 100644 index 5196c38e..00000000 Binary files a/public/assets/MMCCicon_maximize_arrow_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_metacode_set-f4e1e0a7c9e66f8d61ded339704f9ef6.png b/public/assets/MMCCicon_metacode_set-f4e1e0a7c9e66f8d61ded339704f9ef6.png deleted file mode 100644 index 98aea34a..00000000 Binary files a/public/assets/MMCCicon_metacode_set-f4e1e0a7c9e66f8d61ded339704f9ef6.png and /dev/null differ diff --git a/public/assets/MMCCicon_metacode_set.png b/public/assets/MMCCicon_metacode_set.png deleted file mode 100644 index 98aea34a..00000000 Binary files a/public/assets/MMCCicon_metacode_set.png and /dev/null differ diff --git a/public/assets/MMCCicon_minimize_arrow-8923745a55d45e84fcd5ce8c0b90d042.png b/public/assets/MMCCicon_minimize_arrow-8923745a55d45e84fcd5ce8c0b90d042.png deleted file mode 100644 index 2aad516c..00000000 Binary files a/public/assets/MMCCicon_minimize_arrow-8923745a55d45e84fcd5ce8c0b90d042.png and /dev/null differ diff --git a/public/assets/MMCCicon_minimize_arrow.png b/public/assets/MMCCicon_minimize_arrow.png deleted file mode 100644 index 2aad516c..00000000 Binary files a/public/assets/MMCCicon_minimize_arrow.png and /dev/null differ diff --git a/public/assets/MMCCicon_minimize_arrow_black-7fcdd44ae9658aafab1afe8b845a67e4.png b/public/assets/MMCCicon_minimize_arrow_black-7fcdd44ae9658aafab1afe8b845a67e4.png deleted file mode 100644 index cb1a83b7..00000000 Binary files a/public/assets/MMCCicon_minimize_arrow_black-7fcdd44ae9658aafab1afe8b845a67e4.png and /dev/null differ diff --git a/public/assets/MMCCicon_minimize_arrow_black.png b/public/assets/MMCCicon_minimize_arrow_black.png deleted file mode 100644 index cb1a83b7..00000000 Binary files a/public/assets/MMCCicon_minimize_arrow_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_pop-out-f929f9f904f0dde84210a68980110e9b.png b/public/assets/MMCCicon_pop-out-f929f9f904f0dde84210a68980110e9b.png deleted file mode 100644 index ca3ecd45..00000000 Binary files a/public/assets/MMCCicon_pop-out-f929f9f904f0dde84210a68980110e9b.png and /dev/null differ diff --git a/public/assets/MMCCicon_pop-out.png b/public/assets/MMCCicon_pop-out.png deleted file mode 100644 index ca3ecd45..00000000 Binary files a/public/assets/MMCCicon_pop-out.png and /dev/null differ diff --git a/public/assets/MMCCicon_pop-out_black-a0fe60f38328f60a42e4e59472c669a2.png b/public/assets/MMCCicon_pop-out_black-a0fe60f38328f60a42e4e59472c669a2.png deleted file mode 100644 index 7db39126..00000000 Binary files a/public/assets/MMCCicon_pop-out_black-a0fe60f38328f60a42e4e59472c669a2.png and /dev/null differ diff --git a/public/assets/MMCCicon_pop-out_black.png b/public/assets/MMCCicon_pop-out_black.png deleted file mode 100644 index 7db39126..00000000 Binary files a/public/assets/MMCCicon_pop-out_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_private-9de86555fbdb4a6acafb0082678c07bd.png b/public/assets/MMCCicon_private-9de86555fbdb4a6acafb0082678c07bd.png deleted file mode 100644 index 50e98e18..00000000 Binary files a/public/assets/MMCCicon_private-9de86555fbdb4a6acafb0082678c07bd.png and /dev/null differ diff --git a/public/assets/MMCCicon_private.png b/public/assets/MMCCicon_private.png deleted file mode 100644 index 50e98e18..00000000 Binary files a/public/assets/MMCCicon_private.png and /dev/null differ diff --git a/public/assets/MMCCicon_private_black-0270d490f6ac12e81fa60182b604b8ce.png b/public/assets/MMCCicon_private_black-0270d490f6ac12e81fa60182b604b8ce.png deleted file mode 100644 index 076205f6..00000000 Binary files a/public/assets/MMCCicon_private_black-0270d490f6ac12e81fa60182b604b8ce.png and /dev/null differ diff --git a/public/assets/MMCCicon_private_black.png b/public/assets/MMCCicon_private_black.png deleted file mode 100644 index 076205f6..00000000 Binary files a/public/assets/MMCCicon_private_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_public-488184590f4ad9d8ded7bb45cfb3e2d2.png b/public/assets/MMCCicon_public-488184590f4ad9d8ded7bb45cfb3e2d2.png deleted file mode 100644 index e8b51410..00000000 Binary files a/public/assets/MMCCicon_public-488184590f4ad9d8ded7bb45cfb3e2d2.png and /dev/null differ diff --git a/public/assets/MMCCicon_public.png b/public/assets/MMCCicon_public.png deleted file mode 100644 index e8b51410..00000000 Binary files a/public/assets/MMCCicon_public.png and /dev/null differ diff --git a/public/assets/MMCCicon_public_black-3dfabdcce6d4dddafdbed8d45d1d51ae.png b/public/assets/MMCCicon_public_black-3dfabdcce6d4dddafdbed8d45d1d51ae.png deleted file mode 100644 index 950c49e4..00000000 Binary files a/public/assets/MMCCicon_public_black-3dfabdcce6d4dddafdbed8d45d1d51ae.png and /dev/null differ diff --git a/public/assets/MMCCicon_public_black.png b/public/assets/MMCCicon_public_black.png deleted file mode 100644 index 950c49e4..00000000 Binary files a/public/assets/MMCCicon_public_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png b/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png deleted file mode 100644 index e821e243..00000000 Binary files a/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png and /dev/null differ diff --git a/public/assets/MMCCicon_realtime_blue.png b/public/assets/MMCCicon_realtime_blue.png deleted file mode 100644 index e821e243..00000000 Binary files a/public/assets/MMCCicon_realtime_blue.png and /dev/null differ diff --git a/public/assets/MMCCicon_realtime_junto-9264f28a0d186ea4b0b66140bcd8ec15.png b/public/assets/MMCCicon_realtime_junto-9264f28a0d186ea4b0b66140bcd8ec15.png deleted file mode 100644 index 4f687b4d..00000000 Binary files a/public/assets/MMCCicon_realtime_junto-9264f28a0d186ea4b0b66140bcd8ec15.png and /dev/null differ diff --git a/public/assets/MMCCicon_realtime_junto.png b/public/assets/MMCCicon_realtime_junto.png deleted file mode 100644 index 4f687b4d..00000000 Binary files a/public/assets/MMCCicon_realtime_junto.png and /dev/null differ diff --git a/public/assets/MMCCicon_remove_from_map_black-b4afbba1fce0be2535c05de7a9efde1c.png b/public/assets/MMCCicon_remove_from_map_black-b4afbba1fce0be2535c05de7a9efde1c.png deleted file mode 100644 index 9ddc204f..00000000 Binary files a/public/assets/MMCCicon_remove_from_map_black-b4afbba1fce0be2535c05de7a9efde1c.png and /dev/null differ diff --git a/public/assets/MMCCicon_remove_from_map_black.png b/public/assets/MMCCicon_remove_from_map_black.png deleted file mode 100644 index 9ddc204f..00000000 Binary files a/public/assets/MMCCicon_remove_from_map_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_remove_from_map_grey-5219f9314ed14579f8cd553d9e09db87.png b/public/assets/MMCCicon_remove_from_map_grey-5219f9314ed14579f8cd553d9e09db87.png deleted file mode 100644 index 0e863158..00000000 Binary files a/public/assets/MMCCicon_remove_from_map_grey-5219f9314ed14579f8cd553d9e09db87.png and /dev/null differ diff --git a/public/assets/MMCCicon_remove_from_map_grey.png b/public/assets/MMCCicon_remove_from_map_grey.png deleted file mode 100644 index 0e863158..00000000 Binary files a/public/assets/MMCCicon_remove_from_map_grey.png and /dev/null differ diff --git a/public/assets/MMCCicon_save_layout-c04a236e34eb85fced16fd4f3e05ed86.png b/public/assets/MMCCicon_save_layout-c04a236e34eb85fced16fd4f3e05ed86.png deleted file mode 100644 index d163dfb5..00000000 Binary files a/public/assets/MMCCicon_save_layout-c04a236e34eb85fced16fd4f3e05ed86.png and /dev/null differ diff --git a/public/assets/MMCCicon_save_layout.png b/public/assets/MMCCicon_save_layout.png deleted file mode 100644 index d163dfb5..00000000 Binary files a/public/assets/MMCCicon_save_layout.png and /dev/null differ diff --git a/public/assets/MMCCicon_save_new_map-bacfc82d1c0dc4b5799c3e1fcbc71a61.png b/public/assets/MMCCicon_save_new_map-bacfc82d1c0dc4b5799c3e1fcbc71a61.png deleted file mode 100644 index 9138e632..00000000 Binary files a/public/assets/MMCCicon_save_new_map-bacfc82d1c0dc4b5799c3e1fcbc71a61.png and /dev/null differ diff --git a/public/assets/MMCCicon_save_new_map.png b/public/assets/MMCCicon_save_new_map.png deleted file mode 100644 index 9138e632..00000000 Binary files a/public/assets/MMCCicon_save_new_map.png and /dev/null differ diff --git a/public/assets/MMCCicon_settings-b80201e3f081378771338f2a37afc64b.png b/public/assets/MMCCicon_settings-b80201e3f081378771338f2a37afc64b.png deleted file mode 100644 index ae56c5a9..00000000 Binary files a/public/assets/MMCCicon_settings-b80201e3f081378771338f2a37afc64b.png and /dev/null differ diff --git a/public/assets/MMCCicon_settings.png b/public/assets/MMCCicon_settings.png deleted file mode 100644 index ae56c5a9..00000000 Binary files a/public/assets/MMCCicon_settings.png and /dev/null differ diff --git a/public/assets/MMCCicon_synapse-ddb1ae0d586aa9b787244b3648bde538.png b/public/assets/MMCCicon_synapse-ddb1ae0d586aa9b787244b3648bde538.png deleted file mode 100644 index 9fea87f0..00000000 Binary files a/public/assets/MMCCicon_synapse-ddb1ae0d586aa9b787244b3648bde538.png and /dev/null differ diff --git a/public/assets/MMCCicon_synapse.png b/public/assets/MMCCicon_synapse.png deleted file mode 100644 index 9fea87f0..00000000 Binary files a/public/assets/MMCCicon_synapse.png and /dev/null differ diff --git a/public/assets/MMCCicon_synapse_black-e1435858238dd7fa7d47ab313beb5e19.png b/public/assets/MMCCicon_synapse_black-e1435858238dd7fa7d47ab313beb5e19.png deleted file mode 100644 index 1f96a7e9..00000000 Binary files a/public/assets/MMCCicon_synapse_black-e1435858238dd7fa7d47ab313beb5e19.png and /dev/null differ diff --git a/public/assets/MMCCicon_synapse_black.png b/public/assets/MMCCicon_synapse_black.png deleted file mode 100644 index 1f96a7e9..00000000 Binary files a/public/assets/MMCCicon_synapse_black.png and /dev/null differ diff --git a/public/assets/MMCCicon_topic-f3343e0b8ed9c74cd084e65a9a2ae9a8.png b/public/assets/MMCCicon_topic-f3343e0b8ed9c74cd084e65a9a2ae9a8.png deleted file mode 100644 index 90457c0b..00000000 Binary files a/public/assets/MMCCicon_topic-f3343e0b8ed9c74cd084e65a9a2ae9a8.png and /dev/null differ diff --git a/public/assets/MMCCicon_topic.png b/public/assets/MMCCicon_topic.png deleted file mode 100644 index 90457c0b..00000000 Binary files a/public/assets/MMCCicon_topic.png and /dev/null differ diff --git a/public/assets/MMCCicon_wand-2881f819fcbe04f787bf5d781f302cbc.png b/public/assets/MMCCicon_wand-2881f819fcbe04f787bf5d781f302cbc.png deleted file mode 100644 index 409d1948..00000000 Binary files a/public/assets/MMCCicon_wand-2881f819fcbe04f787bf5d781f302cbc.png and /dev/null differ diff --git a/public/assets/MMCCicon_wand.png b/public/assets/MMCCicon_wand.png deleted file mode 100644 index 409d1948..00000000 Binary files a/public/assets/MMCCicon_wand.png and /dev/null differ diff --git a/public/assets/WebSocketMain-0de980edb45e36785bf9d862baa032bb.swf b/public/assets/WebSocketMain-0de980edb45e36785bf9d862baa032bb.swf deleted file mode 100644 index 20a451f5..00000000 Binary files a/public/assets/WebSocketMain-0de980edb45e36785bf9d862baa032bb.swf and /dev/null differ diff --git a/public/assets/WebSocketMain.swf b/public/assets/WebSocketMain.swf deleted file mode 100644 index 20a451f5..00000000 Binary files a/public/assets/WebSocketMain.swf and /dev/null differ diff --git a/public/assets/WebSocketMainInsecure-c4377647e57e58cacc692c8a51afc9f8.swf b/public/assets/WebSocketMainInsecure-c4377647e57e58cacc692c8a51afc9f8.swf deleted file mode 100644 index 5949ff3d..00000000 Binary files a/public/assets/WebSocketMainInsecure-c4377647e57e58cacc692c8a51afc9f8.swf and /dev/null differ diff --git a/public/assets/WebSocketMainInsecure.swf b/public/assets/WebSocketMainInsecure.swf deleted file mode 100644 index 5949ff3d..00000000 Binary files a/public/assets/WebSocketMainInsecure.swf and /dev/null differ diff --git a/public/assets/action-abd8f2e892ebe608b9112249167fb64e.png b/public/assets/action-abd8f2e892ebe608b9112249167fb64e.png deleted file mode 100644 index 1903ba8d..00000000 Binary files a/public/assets/action-abd8f2e892ebe608b9112249167fb64e.png and /dev/null differ diff --git a/public/assets/action.png b/public/assets/action.png deleted file mode 100644 index 1903ba8d..00000000 Binary files a/public/assets/action.png and /dev/null differ diff --git a/public/assets/activity-d115f352e27307a6f15b34bde2c23a5e.png b/public/assets/activity-d115f352e27307a6f15b34bde2c23a5e.png deleted file mode 100644 index a76c3b3e..00000000 Binary files a/public/assets/activity-d115f352e27307a6f15b34bde2c23a5e.png and /dev/null differ diff --git a/public/assets/activity.png b/public/assets/activity.png deleted file mode 100644 index a76c3b3e..00000000 Binary files a/public/assets/activity.png and /dev/null differ diff --git a/public/assets/application-1e86b001d3bcaabff0c76f1492b0dc1e.js b/public/assets/application-1e86b001d3bcaabff0c76f1492b0dc1e.js deleted file mode 100644 index 83f19673..00000000 --- a/public/assets/application-1e86b001d3bcaabff0c76f1492b0dc1e.js +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * 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(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 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
  • ',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(),hideSelectedEdges(),hideSelectedNodes()}),$(".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()})}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 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}},iterations:200,levelDistance:200};return t&&(n.Edge.type="customEdgeEmbed"),e=="centered"&&(n.background={CanvasStyles:{strokeStyle:"#333",lineWidth:1.5}},n.levelDistance=400,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);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}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");r.className="permission canEdit",r.innerHTML=n,t.appendChild(r)}else{var r=document.createElement("div");r.className="permission cannotEdit",r.innerHTML=n,t.appendChild(r)}var i=!1;$(".showcard .metacodeImage").mouseenter(function(){$(".showcard .icon").css("z-index","4"),$(".showcard .metacodeTitle").show()}),$(".showcard .linkItem.icon").mouseleave(function(){i||($(".showcard .metacodeTitle").hide(),$(".showcard .icon").css("z-index","1"))}),$(".showcard .metacodeTitle").click(function(){i?(i=!1,$(this).removeClass("minimize"),$(".metacodeSelect").hide()):(i=!0,$(this).addClass("minimize"),$(".metacodeSelect").show(),$(".metacodeSelect ul").hasClass("mCustomScrollbar")||($(".metacodeSelect ul").mCustomScrollbar(),$(".metacodeSelect li").click(function(){i=!1;var t=$(this).find(".mSelectName").text();updateMetacode(e,t)})))}),$(t).find(".best_in_place_name").bind("ajax:success",function(){var t=$(this).html();e.name=t}),$(t).find(".best_in_place_desc").bind("ajax:success",function(){this.innerHTML=this.innerHTML.replace(/\r/g,""),$(t).find(".scroll").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)}),$(t).find(".permActivator").bind("mouseover",function(){clearTimeout(MetamapsModel.topicPermTimer2),that=this,MetamapsModel.topicPermTimer1=setTimeout(function(){MetamapsModel.topicPermSliding||(MetamapsModel.topicPermSliding=!0,$(that).animate({width:"203px",height:"37px"},300,function(){MetamapsModel.topicPermSliding=!1}))},300)}),$(t).find(".permActivator").bind("mouseout",function(){clearTimeout(MetamapsModel.topicPermTimer1),that=this,MetamapsModel.topicPermTimer2=setTimeout(function(){MetamapsModel.topicPermSliding||(MetamapsModel.topicPermSliding=!0,$(that).animate({height:"16px",width:"16px"},300,function(){MetamapsModel.topicPermSliding=!1}))},800)}),$(t).find(".best_in_place_permission").bind("ajax:success",function(){var t=$(this).html(),n=$(this).parents(".cardSettings").find(".mapPerm");n.attr("title",t),t=="commons"?n.html("co"):t=="public"?n.html("pu"):t=="private"&&n.html("pr"),e.setData("permission",t)}),$(".showcard").find(".scroll").mCustomScrollbar()}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){if(authorizeToEdit(e)){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"),i.className="permission canEdit",$(".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}else!authorizeToEdit(e)&&userid&&alert("You don't have the permissions to edit this synapse.")}function populateEditEdgeForm(e){add_perms_form(e),add_direction_form(e),add_name_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","input"),$("#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_perms_form(e){$("#edit_synapse").append('
    '),$("#edit_synapse .mapPerm").html(mk_permission(e)),userid==e.getData("userid")&&($("#edit_synapse").append('
    '),$("#edit_synapse .permActivator").append('
    '),$("#edit_synapse .editSettings").append("Permissions:"),$("#edit_synapse .editSettings").append(''),$("#edit_synapse .click-to-edit").attr("title","Click to Edit"),$("#edit_synapse .click-to-edit").append(best_in_place_perms(e)),$("#edit_synapse .editSettings").append('
    '),$("#edit_synapse").find(".best_in_place_permission").bind("ajax:success",function(){var e=$(this).html();switch(e){case"commons":$("#edit_synapse .mapPerm").html("co");break;case"public":$("#edit_synapse .mapPerm").html("pu");break;case"private":$("#edit_synapse .mapPerm").html("pr")}}),$("#edit_synapse .permActivator").bind("mouseover",function(){clearTimeout(MetamapsModel.edgePermTimer2),that=this,MetamapsModel.edgePermTimer1=setTimeout(function(){MetamapsModel.edgePermSliding||(MetamapsModel.edgePermSliding=!0,$(that).animate({width:"203px",height:"37px"},300,function(){MetamapsModel.edgePermSliding=!1}))},300)}),$("#edit_synapse .permActivator").bind("mouseout",function(){clearTimeout(MetamapsModel.edgePermTimer1),that=this,MetamapsModel.edgePermTimer2=setTimeout(function(){MetamapsModel.edgePermSliding||(MetamapsModel.edgePermSliding=!0,$(that).animate({height:"16px",width:"16px"},300,function(){MetamapsModel.edgePermSliding=!1}))},800)}))}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(){$(".wandSaveLayout").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,$(".wandSaveLayout").html("Saved!"),setTimeout(function(){$(".wandSaveLayout").html("Save Layout")},1500)}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 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"),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(;i0})}(),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),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(),a=t.getSize(),f=parseInt((n.x+r.x-s.length*5)/2),l=parseInt((n.y+r.y)/2);u.font="bold 14px arial",u.fillStyle="#FFF";var c=5,h=14+c,p=h/2,d=u.measureText(s).width+2*c-2*p,v=f-c+p,m=l-h+c;u.fillRect(v,m,d,h),u.beginPath(),u.arc(v,m+p,p,0,2*Math.PI,!1),u.arc(v+d,m+p,p,0,2*Math.PI,!1),u.fill(),u.fillStyle="#000",u.fillText(s,f,l)}},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,e.Edge.epsilon)}}},edgeSettingsEmbed={customEdgeEmbed:{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(),a=t.getSize(),f=parseInt((n.x+r.x-s.length*5)/2),l=parseInt((n.y+r.y)/2);u.font="bold 14px arial",u.fillStyle="#999";var c=5,h=14+c,p=h/2,d=u.measureText(s).width+2*c-2*p,v=f-c+p,m=l-h+c;u.fillRect(v,m,d,h),u.beginPath(),u.arc(v,m+p,p,0,2*Math.PI,!1),u.arc(v+d,m+p,p,0,2*Math.PI,!1),u.fill(),u.fillStyle="#000",u.fillText(s,f,l)}},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,e.Edge.epsilon)}}};(function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s>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;e.event.stop(e.event.get(t,n));var i=this.config.zooming/1e3,s=1+r*i;this.canvas.scale(s,s)},onMouseDown:function(e,t,n){if(!this.config.panning)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;this.pressed=!0,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;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,u.x/2),l=a.add(f),c=a.$add(f.$scale(-1));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){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.fillStyle=r.strokeStyle=t.getLabelData("color"),r.textBaseline=t.getLabelData("textBaseline"),this.renderLabel(e,t,n)},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y+t.getData("height")/2)},hideLabel:e.empty,hideLabels:e.empty}),d.Label.DOM=new t({labelsHidden:!1,labelContainer:!1,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(e){return e in this.labels&&this.labels[e]!=null?this.labels[e]:this.labels[e]=document.getElementById(e)},hideLabels:function(e){var t=this.getLabelContainer();e?t.style.display="none":t.style.display="",this.labelsHidden=e},clearLabels:function(e){for(var t in this.labels)if(e||!this.viz.graph.hasNode(t))this.disposeLabel(t),delete this.labels[t]},disposeLabel:function(e){var t=this.getLabel(e);t&&t.parentNode&&t.parentNode.removeChild(t)},hideLabel:function(t,n){t=e.splat(t);var r=n?"":"none",i,s=this;e.each(t,function(e){var t=s.getLabel(e.id);t&&(t.style.display=r)})},fitsInCanvas:function(e,t){var n=t.getSize();return e.x>=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=u0?n[0]:null,i(n)}var r=this;this.graph.eachNode(function(e){e.selected=!1});for(var s=0,o=[t.id].concat(n);s=t._depth)});for(var i=0;i0&&e.drawn?(e.drawn=!1,c[l.id].push(e)):(!h||!p)&&e.drawn&&(e.drawn=!1,c[l.id].push(e))}),l.drawn=!0}a.length>0&&i.fx.plot();for(f in c)e.each(c[f],function(e){e.drawn=!0});for(f=0;fi?r:i)+this.config.subtreeOffset)},getEdge:function(e,t,n){var r=function(t,n){return function(){return e.pos.add(new h(t,n))}},i=this.node,s=e.getData("width"),o=e.getData("height");if(t=="begin"){if(i.align=="center")return this.dispatch(n,r(0,o/2),r(-s/2,0),r(0,-o/2),r(s/2,0));if(i.align=="left")return this.dispatch(n,r(0,o),r(0,0),r(0,0),r(s,0));if(i.align=="right")return this.dispatch(n,r(0,0),r(-s,0),r(0,-o),r(0,0));throw"align: not implemented"}if(t=="end"){if(i.align=="center")return this.dispatch(n,r(0,-o/2),r(s/2,0),r(0,o/2),r(-s/2,0));if(i.align=="left")return this.dispatch(n,r(0,0),r(s,0),r(0,o),r(0,0));if(i.align=="right")return this.dispatch(n,r(0,-o),r(0,0),r(0,0),r(-s,0));throw"align: not implemented"}},getScaledTreePosition:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=this.config.multitree&&"$orn"in e.data&&e.data.$orn||this.config.orientation,o=function(n,r){return function(){return e.pos.add(new h(n,r)).$scale(1-t)}};if(n.align=="left")return this.dispatch(s,o(0,i),o(0,0),o(0,0),o(r,0));if(n.align=="center")return this.dispatch(s,o(0,i/2),o(-r/2,0),o(0,-i/2),o(r/2,0));if(n.align=="right")return this.dispatch(s,o(0,0),o(-r,0),o(0,-i),o(0,0));throw"align: not implemented"},treeFitsInCanvas:function(e,t,n){var r=t.getSize(),i=this.config.multitree&&"$orn"in e.data&&e.data.$orn||this.config.orientation,s=this.dispatch(i,r.width,r.height),o=this.getTreeBaseSize(e,n,function(e,t){return e===0||!t.anySubnode()});return o=0){t.drawn=!1;var a=o.getCtx(),f=s.geom.getScaledTreePosition(t,r);a.translate(f.x,f.y),a.scale(r,r)}this.plotTree(t,e.merge(n,{withLabels:!0,hideLabels:!!r,plotSubtree:function(e,n){var r=u.multitree&&!("$orn"in t.data),i=r&&t.getData("orns");return!r||i.indexOf(elem.getData("orn"))>-1}}),i),r>=0&&(t.drawn=!0)},getAlignedPos:function(e,t,n){var r=this.node,i,s;if(r.align=="center")i={x:e.x-t/2,y:e.y-n/2};else if(r.align=="left")s=this.config.orientation,s=="bottom"||s=="top"?i={x:e.x-t/2,y:e.y}:i={x:e.x,y:e.y-n/2};else{if(r.align!="right")throw"align: not implemented";s=this.config.orientation,s=="bottom"||s=="top"?i={x:e.x-t/2,y:e.y-n}:i={x:e.x-t,y:e.y-n/2}}return i},getOrientation:function(e){var t=this.config,n=t.orientation;if(t.multitree){var r=e.nodeFrom,i=e.nodeTo;n="$orn"in r.data&&r.data.$orn||"$orn"in i.data&&i.data.$orn}return n}}),$jit.ST.Label={},$jit.ST.Label.Native=new t({Implements:d.Label.Native,renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y)}}),$jit.ST.Label.DOM=new t({Implements:d.Label.DOM,placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.config,s=i.Node,o=this.viz.canvas,u=t.getData("width"),a=t.getData("height"),f=o.getSize(),l,c,h=o.translateOffsetX,p=o.translateOffsetY,d=o.scaleOffsetX,v=o.scaleOffsetY,m=r.x*d+h,g=r.y*v+p;if(s.align=="center")l={x:Math.round(m-u/2+f.width/2),y:Math.round(g-a/2+f.height/2)};else if(s.align=="left")c=i.orientation,c=="bottom"||c=="top"?l={x:Math.round(m-u/2+f.width/2),y:Math.round(g+f.height/2)}:l={x:Math.round(m+f.width/2),y:Math.round(g-a/2+f.height/2)};else{if(s.align!="right")throw"align: not implemented";c=i.orientation,c=="bottom"||c=="top"?l={x:Math.round(m-u/2+f.width/2),y:Math.round(g-a+f.height/2)}:l={x:Math.round(m-u+f.width/2),y:Math.round(g-a/2+f.height/2)}}var y=e.style;y.left=l.x+"px",y.top=l.y+"px",y.display=this.fitsInCanvas(l,o)?"":"none",n.onPlaceLabel(e,t)}}),$jit.ST.Label.SVG=new t({Implements:[$jit.ST.Label.DOM,d.Label.SVG],initialize:function(e){this.viz=e}}),$jit.ST.Label.HTML=new t({Implements:[$jit.ST.Label.DOM,d.Label.HTML],initialize:function(e){this.viz=e}}),$jit.ST.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.circle.render("fill",{x:r.x+i,y:r.y+i},i,t)},contains:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.circle.contains({x:r.x+i,y:r.y+i},i)}},square:{render:function(e,t){var n=e.getData("dim"),r=n/2,i=this.getAlignedPos(e.pos.getc(!0),n,n);this.nodeHelper.square.render("fill",{x:i.x+r,y:i.y+r},r,t)},contains:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.square.contains({x:r.x+i,y:r.y+i},i)}},ellipse:{render:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.ellipse.render("fill",{x:i.x+n/2,y:i.y+r/2},n,r,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.ellipse.contains({x:i.x+n/2,y:i.y+r/2},n,r,canvas)}},rectangle:{render:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.rectangle.render("fill",{x:i.x+n/2,y:i.y+r/2},n,r,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.rectangle.contains({x:i.x+n/2,y:i.y+r/2},n,r,canvas)}}}),$jit.ST.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=this.getOrientation(e),r=e.nodeFrom,i=e.nodeTo,s=r._depth1&&a[0]!=r.id;this.edgeHelper.arrow.render(o,u,s,f,t)},contains:function(e,t){var n=this.getOrientation(e),r=e.nodeFrom,i=e.nodeTo,s=r._depth0||l[T][1]>0)){var A=C+l[T][0],O=k+l[T][1],M=Math.atan((O-A)/i),_=55,D=S.createLinearGradient(u+i/2,a-(A+O)/2,u+i/2+_*Math.sin(M),a-(A+O)/2+_*Math.cos(M)),P=e.rgbToHex(e.map(e.hexToRgb(d[T%v].slice(1)),function(e){return e*.85>>0}));D.addColorStop(0,d[T%v]),D.addColorStop(1,P),S.fillStyle=D}S.beginPath(),S.moveTo(u,a-C),S.lineTo(u+i,a-k),S.lineTo(u+i,a-k-l[T][1]),S.lineTo(u,a-C-l[T][0]),S.lineTo(u,a-C),S.fill(),S.restore();if(x){var H=x.name==f[T],B=H?.7:.8,P=e.rgbToHex(e.map(e.hexToRgb(d[T%v].slice(1)),function(e){return e*B>>0}));S.strokeStyle=P,S.lineWidth=H?4:1,S.save(),S.beginPath(),x.index===0?(S.moveTo(u,a-C),S.lineTo(u,a-C-l[T][0])):(S.moveTo(u+i,a-k),S.lineTo(u+i,a-k-l[T][1])),S.stroke(),S.restore()}C+=l[T][0]||0,k+=l[T][1]||0,l[T][0]>0&&(L+=c[T][0]||0)}E&&w.type=="Native"&&(S.save(),S.beginPath(),S.fillStyle=S.strokeStyle=w.color,S.font=w.style+" "+w.size+"px "+w.family,S.textAlign="center",S.textBaseline="middle",b(t.name,h,p,t)&&S.fillText(L,u,a-C-m.labelOffset-w.size/2,i),y(t.name,h,p,t)&&S.fillText(t.name,u,a+w.size/2+m.labelOffset),S.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=t.x-o;if(t.xo+r||t.y>u||t.y=v){var m=+(f>r/2);return{name:e.getData("stringArray")[l],color:e.getData("colorArray")[l],value:e.getData("valueArray")[l][m],index:m}}}return!1}}}),$jit.AreaChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","AreaChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i={},s=new $jit.ST({injectInto:t.injectInto,orientation:"bottom",levelDistance:0,siblingOffset:0,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"areachart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,r,i){if(!t.filterOnClick&&!t.Events.enable)return;var s=r.getContains();s&&t.filterOnClick&&n.filter(s.name),t.Events.enable&&t.Events.onClick(s,r,i)},onRightClick:function(e,r,i){if(!t.restoreOnRightClick)return;n.restore()},onMouseMove:function(e,r,i){if(!t.selectOnHover)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var s=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t[0]},0),a=e.reduce(o,function(e,t){return e+t[1]},0);if(r.getData("prev")){var f={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},l=f.wrapper,c=f.label,h=f.aggregate,p=l.style,d=c.style,v=h.style;i[r.id]=f,l.appendChild(c),l.appendChild(h),t.showLabels(r.name,u,a,r)||(c.style.display="none"),t.showAggregates(r.name,u,a,r)||(h.style.display="none"),p.position="relative",p.overflow="visible",p.fontSize=s.size+"px",p.fontFamily=s.family,p.color=s.color,p.textAlign="center",v.position=d.position="absolute",n.style.width=r.getData("width")+"px",n.style.height=r.getData("height")+"px",c.innerHTML=r.name,n.appendChild(l)}},onPlaceLabel:function(n,r){if(!r.getData("prev"))return;var s=i[r.id],o=s.wrapper.style,u=s.label.style,a=s.aggregate.style,f=r.getData("width"),l=r.getData("height"),c=r.getData("dimArray"),h=r.getData("valueArray"),p=e.reduce(h,function(e,t){return e+t[0]},0),d=e.reduce(h,function(e,t){return e+t[1]},0),v=parseInt(o.fontSize,10),m=n.style;if(c&&h){t.showLabels(r.name,p,d,r)?u.display="":u.display="none",t.showAggregates(r.name,p,d,r)?a.display="":a.display="none",o.width=a.width=u.width=n.style.width=f+"px",a.left=u.left=-f/2+"px";for(var g=0,y=h.length,b=0,w=0;g0&&(b+=h[g][0],w+=c[g][0]);a.top=-v-t.labelOffset+"px",u.top=t.labelOffset+w+"px",n.style.top=parseInt(n.style.top,10)-w+"px",n.style.height=o.height=w+"px",s.aggregate.innerHTML=b}}}),o=s.canvas.getSize(),u=t.Margin;s.config.offsetY=-o.height/2+u.bottom+(t.showLabels&&t.labelOffset+t.Label.size),s.config.offsetX=(u.right-u.left)/2,this.st=s,this.canvas=this.st.canvas},loadJSON:function(t){var n=e.time(),r=[],i=this.st,s=e.splat(t.label),o=e.splat(t.color||this.colors),u=this.config,a=!!u.type.split(":")[1],f=u.animate;for(var l=0,c=t.values,h=c.length;l-1?n:[0,0]}),"end")}),this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){r.busy=!1}})},restore:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1),this.normalizeDims();var e=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){e.busy=!1}})},select:function(e,t,n){if(!this.config.selectOnHover)return;var r=this.selected;if(r.id!=e||r.name!=t||r.index!=n){r.id=e,r.name=t,r.index=n,this.st.graph.eachNode(function(e){e.setData("border",!1)});if(e){var i=this.st.graph.getNode(e);i.setData("border",r);var s=n===0?"prev":"next";s=i.getData(s),s&&(i=this.st.graph.getByName(s),i&&i.setData("border",{name:t,index:1-n}))}this.st.plot()}},getLegend:function(){var t={},n;this.st.graph.getNode(this.st.root).eachAdjacency(function(e){n=e.nodeTo});var r=n.getData("colorArray"),i=r.length;return e.each(n.getData("stringArray"),function(e,n){t[e]=r[n%i]}),t},getMaxValue:function(){var t=0;return this.st.graph.eachNode(function(n){var r=n.getData("valueArray"),i=0,s=0;e.each(r,function(e){i+=+e[0],s+=+e[1]});var o=s>i?s:i;t=t>o?t:o}),t},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=s.labelOffset+s.Label.size,a=(i.width-(o.left+o.right))/n,f=s.animate,l=i.height-(o.top+o.bottom)-(s.showAggregates&&u)-(s.showLabels&&u);this.st.graph.eachNode(function(t){var n=0,i=0,s=[];e.each(t.getData("valueArray"),function(e){n+=+e[0],i+=+e[1],s.push([0,0])});var o=i>n?i:n;t.setData("width",a);if(f){t.setData("height",o*l/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}),"end");var u=t.getData("dimArray");u||t.setData("dimArray",s)}else t.setData("height",o*l/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}))})}}),i.BarChart={$extend:!0,animate:!0,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:!0,showLabels:!0,Tips:{enable:!1,onShow:e.empty,onHide:e.empty},Events:{enable:!1,onClick:e.empty}},$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=t.getData("colorArray"),h=c.length,p=t.getData("stringArray"),d=n.getCtx(),v={},m=t.getData("border"),g=t.getData("gradient"),y=t.getData("config"),b=y.orientation=="horizontal",w=y.showAggregates,E=y.showLabels,S=y.Label;if(c&&f&&p){for(var x=0,T=f.length,N=0,C=0;x>0}));k.addColorStop(0,L),k.addColorStop(.5,c[x%h]),k.addColorStop(1,L),d.fillStyle=k}b?d.fillRect(u+N,a,f[x],s):d.fillRect(u,a-N-f[x],i,f[x]),m&&m.name==p[x]&&(v.acum=N,v.dimValue=f[x]),N+=f[x]||0,C+=l[x]||0}m&&(d.save(),d.lineWidth=2,d.strokeStyle=m.color,b?d.strokeRect(u+v.acum+1,a+1,v.dimValue-2,s-2):d.strokeRect(u+1,a-v.acum-v.dimValue+1,i-2,v.dimValue-2),d.restore()),S.type=="Native"&&(d.save(),d.fillStyle=d.strokeStyle=S.color,d.font=S.style+" "+S.size+"px "+S.family,d.textBaseline="middle",w(t.name,C)&&(b?(d.textAlign="right",d.fillText(C,u+N-y.labelOffset,a+s/2)):(d.textAlign="center",d.fillText(C,u+i/2,a-s-S.size/2-y.labelOffset))),E(t.name,C,t)&&(b?(d.textAlign="center",d.translate(u-y.labelOffset-S.size/2,a+s/2),d.rotate(Math.PI/2),d.fillText(t.name,0,0)):(d.textAlign="center",d.fillText(t.name,u+i/2,a+S.size/2+y.labelOffset))),d.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=e.getData("config"),l=t.x-o,c=f.orientation=="horizontal";if(c){if(t.xo+r||t.y>u+i||t.yo+r||t.y>u||t.y=m)return{name:e.getData("stringArray")[h],color:e.getData("colorArray")[h],value:e.getData("valueArray")[h],label:e.name}}}return!1}},"barchart-grouped":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=l.length,h=t.getData("colorArray"),p=h.length,d=t.getData("stringArray"),v=n.getCtx(),m={},g=t.getData("border"),y=t.getData("gradient"),b=t.getData("config"),w=b.orientation=="horizontal",E=b.showAggregates,S=b.showLabels,x=b.Label,T=(w?s:i)/c;if(h&&f&&d){for(var N=0,C=c,k=0,L=0;N>0}));A.addColorStop(0,O),A.addColorStop(.5,h[N%p]),A.addColorStop(1,O),v.fillStyle=A}w?v.fillRect(u,a+T*N,f[N],T):v.fillRect(u+T*N,a-f[N],T,f[N]),g&&g.name==d[N]&&(m.acum=T*N,m.dimValue=f[N]),k+=f[N]||0,L+=l[N]||0}g&&(v.save(),v.lineWidth=2,v.strokeStyle=g.color,w?v.strokeRect(u+1,a+m.acum+1,m.dimValue-2,T-2):v.strokeRect(u+m.acum+1,a-m.dimValue+1,T-2,m.dimValue-2),v.restore()),x.type=="Native"&&(v.save(),v.fillStyle=v.strokeStyle=x.color,v.font=x.style+" "+x.size+"px "+x.family,v.textBaseline="middle",E(t.name,L)&&(w?(v.textAlign="right",v.fillText(L,u+Math.max.apply(null,f)-b.labelOffset,a+s/2)):(v.textAlign="center",v.fillText(L,u+i/2,a-Math.max.apply(null,f)-x.size/2-b.labelOffset))),S(t.name,L,t)&&(w?(v.textAlign="center",v.translate(u-b.labelOffset-x.size/2,a+s/2),v.rotate(Math.PI/2),v.fillText(t.name,0,0)):(v.textAlign="center",v.fillText(t.name,u+i/2,a+x.size/2+b.labelOffset))),v.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=a.length,l=e.getData("config"),c=t.x-o,h=l.orientation=="horizontal",p=(h?i:r)/f;if(h){if(t.xo+r||t.y>u+i||t.yo+r||t.y>u||t.y=g&&t.y<=g+p)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}else{var g=o+p*d;if(t.x>=g&&t.x<=g+p&&t.y>=u-m)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}}return!1}}}),$jit.BarChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i=t.orientation=="horizontal",s={},o=new $jit.ST({injectInto:t.injectInto,orientation:i?"left":"bottom",levelDistance:0,siblingOffset:t.barsOffset,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"barchart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,n,r){if(!t.Events.enable)return;var i=n.getContains();t.Events.onClick(i,n,r)},onMouseMove:function(e,r,i){if(!t.hoveredColor)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var i=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t},0),a={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},f=a.wrapper,l=a.label,c=a.aggregate,h=f.style,p=l.style,d=c.style;s[r.id]=a,f.appendChild(l),f.appendChild(c),t.showLabels(r.name,u,r)||(p.display="none"),t.showAggregates(r.name,u,r)||(d.display="none"),h.position="relative",h.overflow="visible",h.fontSize=i.size+"px",h.fontFamily=i.family,h.color=i.color,h.textAlign="center",d.position=p.position="absolute",n.style.width=r.getData("width")+"px",n.style.height=r.getData("height")+"px",d.left=p.left="0px",l.innerHTML=r.name,n.appendChild(f)},onPlaceLabel:function(e,n){if(!s[n.id])return;var r=s[n.id],i=r.wrapper.style,o=r.label.style,u=r.aggregate.style,a=t.type.split(":")[0]=="grouped",f=t.orientation=="horizontal",l=n.getData("dimArray"),c=n.getData("valueArray"),h=a&&f?Math.max.apply(null,l):n.getData("width"),p=a&&!f?Math.max.apply(null,l):n.getData("height"),d=parseInt(i.fontSize,10),v=e.style;if(l&&c){i.width=u.width=o.width=e.style.width=h+"px";for(var m=0,g=c.length,y=0;m0&&(y+=c[m]);t.showLabels(n.name,y,n)?o.display="":o.display="none",t.showAggregates(n.name,y,n)?u.display="":u.display="none",t.orientation=="horizontal"?(u.textAlign="right",o.textAlign="left",o.textIndex=u.textIndent=t.labelOffset+"px",u.top=o.top=(p-d)/2+"px",e.style.height=i.height=p+"px"):(u.top=-d-t.labelOffset+"px",o.top=t.labelOffset+p+"px",e.style.top=parseInt(e.style.top,10)-p+"px",e.style.height=i.height=p+"px"),r.aggregate.innerHTML=y}}}),u=o.canvas.getSize(),a=t.Margin;i?(o.config.offsetX=u.width/2-a.left-(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetY=(a.bottom-a.top)/2):(o.config.offsetY=-u.height/2+a.bottom+(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetX=(a.right-a.left)/2),this.st=o,this.canvas=this.st.canvas},loadJSON:function(t){if(this.busy)return;this.busy=!0;var n=e.time(),r=[],i=this.st,s=e.splat(t.label),o=e.splat(t.color||this.colors),u=this.config,a=!!u.type.split(":")[1],f=u.animate,l=u.orientation=="horizontal",c=this;for(var h=0,p=t.values,d=p.length;hs?t:s}),t},setBarType:function(e){this.config.type=e,this.st.config.Node.type="barchart-"+e.split(":")[0]},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=o.left+o.right,a=o.top+o.bottom,f=s.orientation=="horizontal",l=(i[f?"height":"width"]-(f?a:u)-(n-1)*s.barsOffset)/n,c=s.animate,h=i[f?"width":"height"]-(f?u:a)-(!f&&s.showAggregates&&s.Label.size+s.labelOffset)-(s.showLabels&&s.Label.size+s.labelOffset),p=f?"height":"width",d=f?"width":"height";this.st.graph.eachNode(function(t){var n=0,i=[];e.each(t.getData("valueArray"),function(e){n+=+e,i.push(0)}),t.setData(p,l);if(c){t.setData(d,n*h/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}),"end");var s=t.getData("dimArray");s||t.setData("dimArray",i)}else t.setData(d,n*h/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}))})}}),i.PieChart={$extend:!0,animate:!0,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:!1,onClick:e.empty},Tips:{enable:!1,onShow:e.empty,onHide:e.empty},showLabels:!0,resizeLabels:!1,updateHeights:!1},b.Radial=new t({compute:function(t){var n=e.splat(t||["current","start","end"]);w.compute(this.graph,n,this.config),this.graph.computeLevels(this.root,0,"ignore");var r=this.createLevelDistanceFunc();this.computeAngularWidths(n),this.computePositions(n,r)},computePositions:function(e,t){var n=e,r=this.graph,i=r.getNode(this.root),s=this.parent,o=this.config;for(var u=0,a=n.length;uf[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;ld/2&&h.theta<3*d/2,a=v?h.theta+d:h.theta;v?(o-=Math.abs(Math.cos(h.theta)*s.width),u+=Math.sin(h.theta)*s.width):t.id==this.viz.root&&(o-=s.width/2)}i.save(),i.translate(o,u),i.rotate(a),i.fillText(t.name,0,0),i.restore()}}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz,s=this.viz.canvas,o=s.getSize(),u={x:Math.round(r.x+o.width/2),y:Math.round(r.y+o.height/2)};e.setAttribute("x",u.x),e.setAttribute("y",u.y);var a=e.getBBox();if(a){var f=e.getAttribute("x"),l=e.getAttribute("y"),c=t.pos.getp(!0),h=Math.PI,p=c.theta>h/2&&c.theta<3*h/2;p?(e.setAttribute("x",f-a.width),e.setAttribute("y",l-a.height)):t.id==i.root&&e.setAttribute("x",f-a.width/2);var d=p?c.theta+h:c.theta;t._depth&&e.setAttribute("transform","rotate("+d*360/(2*h)+" "+f+" "+l+")")}n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.clone(),i=this.viz.canvas,s=t.getData("height"),o=(s||t._depth==0?s:this.viz.config.levelDistance)/2,u=i.getSize();r.rho+=o,r=r.getc(!0);var a={x:Math.round(r.x+u.width/2),y:Math.round(r.y+u.height/2)},f=e.style;f.left=a.x+"px",f.top=a.y+"px",f.display=this.fitsInCanvas(a,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1),anglecontains:function(e,t){var n=e.getData("span")/2,r=e.pos.theta,i=r-n,s=r+n;i<0&&(i+=Math.PI*2);var o=Math.atan2(t.y,t.x);return o<0&&(o+=Math.PI*2),i>s?o>i&&o<=Math.PI*2||oi&&o=s*o&&n<=s*o+i}return!1}},"gradient-multipie":{render:function(t,n){var r=n.getCtx(),i=t.getData("height"),s=i?i:this.config.levelDistance,o=r.createRadialGradient(0,0,t.getPos().rho,0,0,t.getPos().rho+s),u=e.hexToRgb(t.getData("color")),a=[];e.each(u,function(e){a.push(parseInt(e*.5,10))});var f=e.rgbToHex(a);o.addColorStop(0,f),o.addColorStop(1,t.getData("color")),r.fillStyle=o,this.nodeTypes.multipie.render.call(this,t,n)},contains:function(e,t){return this.nodeTypes.multipie.contains.call(this,e,t)}},"gradient-pie":{render:function(t,n){var r=n.getCtx(),i=r.createRadialGradient(0,0,0,0,0,t.getPos().rho),s=e.hexToRgb(t.getData("color")),o=[];e.each(s,function(e){o.push(parseInt(e*.5,10))});var u=e.rgbToHex(o);i.addColorStop(1,u),i.addColorStop(0,t.getData("color")),r.fillStyle=i,this.nodeTypes.pie.render.call(this,t,n)},contains:function(e,t){return this.nodeTypes.pie.contains.call(this,e,t)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);this.edgeHelper.line.render(n,r,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.getData("dim"),s=e.data.$direction,o=s&&s.length>1&&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)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=Math.max(n.norm(),r.norm());this.edgeHelper.hyperline.render(n.$scale(1/i),r.$scale(1/i),i,t)},contains:e.lambda(!1)}})}($jit.Sunburst),$jit.Sunburst.Plot.NodeTypes.implement({"piechart-stacked":{render:function(t,n){var r=t.pos.getp(!0),i=t.getData("dimArray"),s=t.getData("valueArray"),o=t.getData("colorArray"),u=o.length,a=t.getData("stringArray"),f=t.getData("span")/2,c=t.pos.theta,h=c-f,p=c+f,d=new l,v=n.getCtx(),m={},g=t.getData("gradient"),y=t.getData("border"),b=t.getData("config"),w=b.showLabels,E=b.resizeLabels,S=b.Label,x=b.sliceOffset*Math.cos((h+p)/2),T=b.sliceOffset*Math.sin((h+p)/2);if(o&&i&&a){for(var N=0,C=i.length,k=0,L=0;N>0}),P=e.rgbToHex(D);M.addColorStop(0,O),M.addColorStop(.5,O),M.addColorStop(1,P),v.fillStyle=M}d.rho=k+b.sliceOffset,d.theta=h;var H=d.getc(!0);d.theta=p;var B=d.getc(!0);d.rho+=A;var j=d.getc(!0);d.theta=h;var F=d.getc(!0);v.beginPath(),v.arc(x,T,k+.01,h,p,!1),v.arc(x,T,k+A+.01,p,h,!0),v.fill(),y&&y.name==a[N]&&(m.acum=k,m.dimValue=i[N],m.begin=h,m.end=p),k+=A||0,L+=s[N]||0}if(y){v.save(),v.globalCompositeOperation="source-over",v.lineWidth=2,v.strokeStyle=y.color;var I=h>0;R=R<+E?+E:R,v.font=S.style+" "+R+"px "+S.family,v.textBaseline="middle",v.textAlign="center",d.rho=k+b.labelOffset+b.sliceOffset,d.theta=t.pos.theta;var U=d.getc(!0);v.fillText(t.name,U.x,U.y),v.restore()}}},contains:function(e,t){if(this.nodeTypes.none.anglecontains.call(this,e,t)){var n=Math.sqrt(t.x*t.x+t.y*t.y),r=this.config.levelDistance,i=e._depth,s=e.getData("config");if(n<=r*i+s.sliceOffset){var o=e.getData("dimArray");for(var u=0,a=o.length,f=s.sliceOffset;u=f&&n<=f+l)return{name:e.getData("stringArray")[u],color:e.getData("colorArray")[u],value:e.getData("valueArray")[u],label:e.name};f+=l}}return!1}return!1}}}),$jit.PieChart=new t({sb:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","PieChart","Label"),{Label:{type:"Native"}},t),this.initializeViz()},initializeViz:function(){var e=this.config,t=this,n=e.type.split(":")[0],r=new $jit.Sunburst({injectInto:e.injectInto,useCanvas:e.useCanvas,withLabels:e.Label.type!="Native",Label:{type:e.Label.type},Node:{overridable:!0,type:"piechart-"+n,width:1,height:1},Edge:{type:"none"},Tips:{enable:e.Tips.enable,type:"Native",force:!0,onShow:function(t,n,r){var i=r;e.Tips.onShow(t,i,n)}},Events:{enable:!0,type:"Native",onClick:function(t,n,r){if(!e.Events.enable)return;var i=n.getContains();e.Events.onClick(i,n,r)},onMouseMove:function(n,r,i){if(!e.hoveredColor)return;if(n){var s=r.getContains();t.select(n.id,s.name,s.index)}else t.select(!1,!1,!1)}},onCreateLabel:function(t,n){var r=e.Label;if(e.showLabels){var i=t.style;i.fontSize=r.size+"px",i.fontFamily=r.family,i.color=r.color,i.textAlign="center",t.innerHTML=n.name}},onPlaceLabel:function(n,r){if(!e.showLabels)return;var i=r.pos.getp(!0),s=r.getData("dimArray"),o=r.getData("span")/2,u=r.pos.theta,a=u-o,f=u+o,c=new l,h=e.showLabels,p=e.resizeLabels,d=e.Label;if(s){for(var v=0,m=s.length,g=0;v>0;b=b<+p?+p:b,n.style.fontSize=b+"px",c.rho=g+e.labelOffset+e.sliceOffset,c.theta=(a+f)/2;var i=c.getc(!0),w=t.canvas.getSize(),E={x:Math.round(i.x+w.width/2),y:Math.round(i.y+w.height/2)};n.style.left=E.x+"px",n.style.top=E.y+"px"}}}),i=r.canvas.getSize(),s=Math.min;r.config.levelDistance=s(i.width,i.height)/2-e.offset-e.sliceOffset,this.sb=r,this.canvas=this.sb.canvas,this.canvas.getCtx().globalCompositeOperation="lighter"},loadJSON:function(t){var n=e.time(),r=[],i=this.sb,s=e.splat(t.label),o=s.length,u=e.splat(t.color||this.colors),a=u.length,f=this.config,l=!!f.type.split(":")[1],c=f.animate,h=o==1;for(var p=0,d=t.values,v=d.length;pi?t:i}),t},normalizeDims:function(){var t=this.sb.graph.getNode(this.sb.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.config,s=i.animate,o=this.sb.config.levelDistance;this.sb.graph.eachNode(function(t){var n=0,u=[];e.each(t.getData("valueArray"),function(e){n+=+e,u.push(1)});var a=u.length==1&&!i.updateHeights;if(s){t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return a?o:e*o/r}),"end");var f=t.getData("dimArray");f||t.setData("dimArray",u)}else t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return a?o:e*o/r}));t.setData("normalizedDim",n/r)})}}),b.TM={},b.TM.SliceAndDice=new t({compute:function(e){var t=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(t);var n=this.canvas.getSize(),r=this.config,i=n.width,s=n.height;this.graph.computeLevels(this.root,0,"ignore"),t.getPos(e).setc(-i/2,-s/2),t.setData("width",i,e),t.setData("height",s+r.titleHeight,e),this.computePositions(t,t,this.layout.orientation,e),this.controller.onAfterCompute(t)},computePositions:function(e,t,n,r){var i=0;e.eachSubnode(function(e){i+=e.getData("area",r)});var s=this.config,o=s.offset,u=e.getData("width",r),a=e.getData("height",r)-s.titleHeight,f=e==t?1:t.getData("area",r)/i,l,c,h,p,d,v,m,g=n=="h";g?(n="v",l=a,c=u*f,h="height",p="y",d="x",v=s.titleHeight,m=0):(n="h",l=a*f,c=u,h="width",p="x",d="y",v=0,m=s.titleHeight);var y=t.getPos(r);t.setData("width",c,r),t.setData("height",l,r);var b=0,w=this;t.eachSubnode(function(e){var i=e.getPos(r);i[p]=b+y[p]+v,i[d]=y[d]+m,w.computePositions(t,e,n,r),b+=e.getData(h,r)})}}),b.TM.Area={compute:function(e){e=e||"current";var t=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(t);var n=this.config,r=this.canvas.getSize(),i=r.width,s=r.height,o=n.offset,u=i-o,a=s-o;this.graph.computeLevels(this.root,0,"ignore"),t.getPos(e).setc(-i/2,-s/2),t.setData("width",i,e),t.setData("height",s,e);var f={top:-s/2+n.titleHeight,left:-i/2,width:u,height:a-n.titleHeight};this.computePositions(t,f,e),this.controller.onAfterCompute(t)},computeDim:function(e,t,n,r,i,s){if(e.length+t.length==1){var o=e.length==1?e:t;this.layoutLast(o,n,r,s);return}e.length>=2&&t.length==0&&(t=[e.shift()]);if(e.length==0){t.length>0&&this.layoutRow(t,n,r,s);return}var u=e[0];if(i(t,n)>=i([u].concat(t),n))this.computeDim(e.slice(1),t.concat([u]),n,r,i,s);else{var a=this.layoutRow(t,n,r,s);this.computeDim(e,[],a.dim,a,i,s)}},worstAspectRatio:function(e,t){if(!e||e.length==0)return Number.MAX_VALUE;var n=0,r=0,i=Number.MAX_VALUE;for(var s=0,o=e.length;su?r:u}var a=t*t,f=n*n;return Math.max(a*r/f,f/(a*i))},avgAspectRatio:function(e,t){if(!e||e.length==0)return Number.MAX_VALUE;var n=0;for(var r=0,i=e.length;ro?t/o:o/t}return n/i},layoutLast:function(e,t,n,r){var i=e[0];i.getPos(r).setc(n.left,n.top),i.setData("width",n.width,r),i.setData("height",n.height,r)}},b.TM.Squarified=new t({Implements:b.TM.Area,computePositions:function(e,t,n){var r=this.config;t.width>=t.height?this.layout.orientation="h":this.layout.orientation="v";var i=e.getSubnodes([1,1],"ignore");if(i.length>0){this.processChildrenLayout(e,i,t,n);for(var s=0,o=i.length;s0){this.processChildrenLayout(e,r,t,n);for(var s=0,o=r.length;sa&&(a=t)});var f=this.graph.getNode(this.clickedNode&&this.clickedNode.id||t.id),l=Math.min(a,u-1),c=f._depth;this.layout.horizontal()?this.computeSubtree(f,-i/2,-s/2,i/(l+1),s,c,l,e):this.computeSubtree(f,-i/2,-s/2,i,s/(l+1),c,l,e)},computeSubtree:function(t,n,r,i,s,o,u,a){t.getPos(a).setc(n,r),t.setData("width",i,a),t.setData("height",s,a);var f,l=0,c=0,h=d.Util.getSubnodes(t,[1,1]);if(!h.length)return;e.each(h,function(e){c+=e.getData("dim")});for(var p=0,v=h.length;p>0}));d.addColorStop(0,p),d.addColorStop(1,v),h.fillStyle=d}a&&(h.strokeStyle=a,h.lineWidth=3),h.fillRect(l,c,Math.max(0,o-s),Math.max(0,u-s)),a&&h.strokeRect(f.x,f.y,o,u)},contains:function(e,t){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(e,this.viz.clickedNode.id))return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+i/2},t,r,i)}}}),$jit.Icicle.Plot.EdgeTypes=new t({none:e.empty}),b.ForceDirected=new t({getOptions:function(e){var t=this.canvas.getSize(),n=t.width,r=t.height,i=0;this.graph.eachNode(function(e){i++});var s=n*r/i,o=Math.sqrt(s),u=this.config.levelDistance;return{width:n,height:r,tstart:n*.1,nodef:function(e){return s/(e||1)},edgef:function(e){return o*(e-u)}}},compute:function(t,n){var r=e.splat(t||["current","start","end"]),i=this.getOptions();w.compute(this.graph,r,this.config),this.graph.computeLevels(this.root,0,"ignore"),this.graph.eachNode(function(t){e.each(r,function(n){var s=t.getPos(n);s.equals(h.KER)&&(s.x=i.width/5*(Math.random()-.5),s.y=i.height/5*(Math.random()-.5)),t.disp={},e.each(r,function(e){t.disp[e]=p(0,0)})})}),this.computePositions(r,i,n)},computePositions:function(e,t,n){var r=this.config.iterations,i=0,s=this;if(n)(function o(){for(var u=n.iter,a=0;a=r){n.onComplete();return}}n.onStep(Math.round(i/(r-1)*100)),setTimeout(o,1)})();else for(;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.ForceDirected),$jit.TM={};var E=$jit.TM;$jit.TM.$extend=!0,E.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(t){var n={orientation:"h",titleHeight:13,offset:2,levelsToShow:0,constrained:!1,animate:!1,Node:{type:"rectangle",overridable:!0,width:3,height:3,color:"#444"},Label:{textAlign:"center",textBaseline:"top"},Edge:{type:"none"},duration:700,fps:45};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),n,t),this.layout.orientation=this.config.orientation;var r=this.config;r.useCanvas?(this.canvas=r.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(r.background&&(r.background=e.merge({type:"Circles"},r.background)),this.canvas=new f(this,r),this.config.labelContainer=(typeof r.injectInto=="string"?r.injectInto:r.injectInto.id)+"-label"),this.graphOptions={complex:!0,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new E.Label[r.Label.type](this),this.fx=new E.Plot(this),this.op=new E.Op(this),this.group=new E.Group(this),this.geom=new E.Geom(this),this.clickedNode=null,this.busy=!1,this.initializeExtras()},refresh:function(){if(this.busy)return;this.busy=!0;var t=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(e.merge(this.config,{modes:["linear","node-property:width:height"],onComplete:function(){t.busy=!1}}));else{var n=this.config.Label.type;if(n!="Native"){var t=this;this.graph.eachNode(function(e){t.labels.hideLabel(e,!1)})}this.busy=!1,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(e){return e.getSubnodes([1,1],"ignore").length==0},enter:function(e){if(this.busy)return;this.busy=!0;var t=this,n=this.config,r=this.graph,i=e,s=this.clickedNode,o={onComplete:function(){n.levelsToShow>0&&t.geom.setRightLevelToShow(e),(n.levelsToShow>0||n.request)&&t.compute(),n.animate?(r.nodeList.setData("alpha",0,"end"),e.eachSubgraph(function(e){e.setData("alpha",1,"end")},"ignore"),t.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){t.clickedNode=i,t.compute("end"),t.clickedNode=s,t.fx.animate({modes:["linear","node-property:width:height"],duration:1e3,onComplete:function(){t.busy=!1,t.clickedNode=i}})}})):(t.busy=!1,t.clickedNode=e,t.refresh())}};n.request?this.requestNodes(i,o):o.onComplete()},out:function(){if(this.busy)return;this.busy=!0,this.events.hoveredNode=!1;var e=this,t=this.config,n=this.graph,r=n.getNode(this.clickedNode&&this.clickedNode.id||this.root).getParents(),i=r[0],s=i,o=this.clickedNode;if(!i){this.busy=!1;return}callback={onComplete:function(){e.clickedNode=i,t.request?e.requestNodes(i,{onComplete:function(){e.compute(),e.plot(),e.busy=!1}}):(e.compute(),e.plot(),e.busy=!1)}},t.levelsToShow>0&&this.geom.setRightLevelToShow(i),t.animate?(this.clickedNode=s,this.compute("end"),this.clickedNode=o,this.fx.animate({modes:["linear","node-property:width:height"],duration:1e3,onComplete:function(){e.clickedNode=s,n.eachNode(function(e){e.setDataset(["current","end"],{alpha:[0,1]})},"ignore"),o.eachSubgraph(function(e){e.setData("alpha",1)},"ignore"),e.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})):callback.onComplete()},requestNodes:function(t,n){var r=e.merge(this.controller,n),i=this.config.levelsToShow;if(r.request){var s=[],o=t._depth;t.eachLevel(0,i,function(e){var t=i-(e._depth-o);e.drawn&&!e.anySubnode()&&t>0&&(s.push(e),e._level=t)}),this.group.requestNodes(s,r)}else r.onComplete()}},E.Op=new t({Implements:d.Op,initialize:function(e){this.viz=e}}),E.Geom=new t({Implements:d.Geom,getRightLevelToShow:function(){return this.viz.config.levelsToShow},setRightLevelToShow:function(e){var t=this.getRightLevelToShow(),n=this.viz.labels;e.eachLevel(0,t+1,function(r){var i=r._depth-e._depth;i>t?(r.drawn=!1,r.exist=!1,r.ignore=!0,n.hideLabel(r,!1)):(r.drawn=!0,r.exist=!0,delete r.ignore)}),e.drawn=!0,delete e.ignore}}),E.Group=new t({initialize:function(e){this.viz=e,this.canvas=e.canvas,this.config=e.config},requestNodes:function(e,t){var n=0,r=e.length,i={},s=function(){t.onComplete()},o=this.viz;r==0&&s();for(var u=0;u>0}));v.addColorStop(0,m),v.addColorStop(1,g),h.fillStyle=v}h.fillRect(p,d,f-o,l-o),c&&(h.save(),h.strokeStyle=c,h.strokeRect(p,d,f-o,l-o),h.restore())}else u>0&&(h.fillRect(a.x+o/2,a.y+o/2,f-o,u-o),c&&(h.save(),h.strokeStyle=c,h.strokeRect(a.x+o/2,a.y+o/2,f-o,l-o),h.restore()))},contains:function(e,t){if(this.viz.clickedNode&&!e.isDescendantOf(this.viz.clickedNode.id)||e.ignore)return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=this.viz.leaf(e),s=i?e.getData("height"):this.config.titleHeight;return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+s/2},t,r,s)}}}),E.Plot.EdgeTypes=new t({none:e.empty}),E.SliceAndDice=new t({Implements:[y,a,E.Base,b.TM.SliceAndDice]}),E.Squarified=new t({Implements:[y,a,E.Base,b.TM.Squarified]}),E.Strip=new t({Implements:[y,a,E.Base,b.TM.Strip]}),$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=2)return i(s-.01)}return i(.75)},getRadius:function(){var e=this.config.radius;if(e!=="auto")return e;var t=this.canvas.getSize();return Math.min(t.width,t.height)/2},refresh:function(e){e?(this.reposition(),this.graph.eachNode(function(e){e.startPos.rho=e.pos.rho=e.endPos.rho,e.startPos.theta=e.pos.theta=e.endPos.theta})):this.compute(),this.plot()},reposition:function(){this.compute("end");var e=this.graph.getNode(this.root).pos.getc().scale(-1);d.Util.moebiusTransformation(this.graph,[e],["end"],"end","ignore"),this.graph.eachNode(function(e){e.ignore&&(e.endPos.rho=e.pos.rho,e.endPos.theta=e.pos.theta)})},plot:function(){this.fx.plot()},onClick:function(e,t){var n=this.graph.getNode(e).pos.getc(!0);this.move(n,t)},move:function(t,n){var r=p(t.x,t.y);if(this.busy===!1&&r.norm()<1){this.busy=!0;var i=this.graph.getClosestNodeToPos(r),s=this;this.graph.computeLevels(i.id,0),this.controller.onBeforeCompute(i),n=e.merge({onComplete:e.empty},n||{}),this.fx.animate(e.merge({modes:["moebius"],hideLabels:!0},n,{onComplete:function(){s.busy=!1,n.onComplete()}}),r)}}}),$jit.Hypertree.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native,initialize:function(e){this.viz=e},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0),s=this.viz.getRadius();r.fillText(t.name,i.x*s,i.y*s)}}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l=this.viz.getRadius(),c={x:Math.round(r.x*u*l+s+f.width/2),y:Math.round(r.y*a*l+o+f.height/2)};e.setAttribute("x",c.x),e.setAttribute("y",c.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l=this.viz.getRadius(),c={x:Math.round(r.x*u*l+s+f.width/2),y:Math.round(r.y*a*l+o+f.height/2)},h=e.style;h.left=c.x+"px",h.top=c.y+"px",h.display=this.fitsInCanvas(c,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.circle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(r,t,n)}},ellipse:{render -:function(e,t){var n=e.pos.getc().$scale(e.scale),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(i,t,n,r)}},square:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.square.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(r,t,n)}},rectangle:{render:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=e.pos.getc();r=n.transform?r*(1-s.squaredNorm()):r,i=n.transform?i*(1-s.squaredNorm()):i,s.$scale(e.scale),r>.2&&i>.2&&this.nodeHelper.rectangle.render("fill",s,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(i,t,n,r)}},triangle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.triangle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.triangle.contains(r,t,n)}},star:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.star.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.star.contains(r,t,n)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale,s=e.getData("dim"),o=e.data.$direction,u=o&&o.length>1&&o[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},s,u,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.arrow.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=this.viz.getRadius();this.edgeHelper.hyperline.render(n,r,i,t)},contains:e.lambda(!1)}})}($jit.Hypertree)})(),function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s>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, 0.8)",r.strokeStyle="rgba(24,32,46, 1)";var u=25*o.length,a,f=[];for(a=0;at){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),o=s(t.name,30).split("\n"),u;for(u=0;u=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){function r(){return"ontouchstart"in window?1:0}var n={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:550,scrollEasing:"easeOutCirc",mouseWheel:"auto",autoDraggerLength:!0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:20,scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1},callbacks:{onScroll:function(){},onTotalScroll:function(){},onTotalScrollOffset:0}},t=e.extend(!0,n,t);return e(document).data("mCS-is-touch-device",!1),r()&&e(document).data("mCS-is-touch-device",!0),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 i=parseInt(e(document).data("mCustomScrollbar-index"));e(document).data("mCustomScrollbar-index",i+1)}n.wrapInner("
      ").addClass("mCustomScrollbar _mCS_"+e(document).data("mCustomScrollbar-index"));var s=n.children(".mCustomScrollBox");if(t.horizontalScroll){s.addClass("mCSB_horizontal").wrapInner("
      ");var o=s.children(".mCSB_h_wrapper");o.wrapInner("
      ").children(".mCSB_container").css({width:o.children().outerWidth(),position:"relative"}).unwrap()}else s.wrapInner("
      ");var u=s.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device")){u.after("
      ");var a=s.children(".mCSB_scrollTools"),f=a.children(".mCSB_draggerContainer"),l=f.children(".mCSB_dragger");t.horizontalScroll?l.data("minDraggerWidth",l.width()):l.data("minDraggerHeight",l.height()),t.scrollButtons.enable&&(t.horizontalScroll?a.prepend("").append(""):a.prepend("").append("")),s.bind("scroll",function(){s.scrollTop(0).scrollLeft(0)}),n.data({horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:t.scrollEasing,mouseWheel:t.mouseWheel,autoDraggerLength:t.autoDraggerLength,"scrollButtons-enable":t.scrollButtons.enable,"scrollButtons-scrollType":t.scrollButtons.scrollType,"scrollButtons-scrollSpeed":t.scrollButtons.scrollSpeed,"scrollButtons-scrollAmount":t.scrollButtons.scrollAmount,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,"onScroll-Callback":t.callbacks.onScroll,"onTotalScroll-Callback":t.callbacks.onTotalScroll,"onTotalScroll-Offset":t.callbacks.onTotalScrollOffset}).mCustomScrollbar("update");if(t.advanced.updateOnBrowserResize){var h;e(window).resize(function(){h&&clearTimeout(h),h=setTimeout(function(){n.mCustomScrollbar("update")},150)})}}else{var p=navigator.userAgent;if(p.indexOf("Android")!=-1){var v=parseFloat(p.slice(p.indexOf("Android")+8));v<3?m("mCSB_"+e(document).data("mCustomScrollbar-index")):s.css({overflow:"auto","-webkit-overflow-scrolling":"touch"})}else s.css({overflow:"auto","-webkit-overflow-scrolling":"touch"});u.addClass("mCS_no_scrollbar mCS_touch"),n.data({horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:t.scrollEasing,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,"onScroll-Callback":t.callbacks.onScroll,"onTotalScroll-Callback":t.callbacks.onTotalScroll,"onTotalScroll-Offset":t.callbacks.onTotalScrollOffset}),s.scroll(function(){n.mCustomScrollbar("callbacks",s,u)});function m(e){var t=document.getElementById(e),n=0,r=0;document.getElementById(e).addEventListener("touchstart",function(e){n=this.scrollTop+e.touches[0].pageY,r=this.scrollLeft+e.touches[0].pageX},!1),document.getElementById(e).addEventListener("touchmove",function(e){(this.scrollTopn+5)&&e.preventDefault(),(this.scrollLeftr+5)&&e.preventDefault(),this.scrollTop=n-e.touches[0].pageY,this.scrollLeft=r-e.touches[0].pageX},!1)}}if(t.advanced.updateOnContentResize){var g;if(t.horizontalScroll){var y=u.outerWidth();r()&&s.css({"-webkit-overflow-scrolling":"auto"})}else var y=u.outerHeight();g=setInterval(function(){if(t.horizontalScroll){t.advanced.autoExpandHorizontalScroll&&u.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:u.outerWidth(),position:"relative"}).unwrap();var e=u.outerWidth()}else var e=u.outerHeight();e!=y&&(n.mCustomScrollbar("update"),y=e)},300)}})},update:function(){var t=e(this),n=t.children(".mCustomScrollBox"),r=n.children(".mCSB_container");e(document).data("mCS-is-touch-device")||r.removeClass("mCS_no_scrollbar");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 c=i.children(".mCSB_buttonUp"),h=i.children(".mCSB_buttonDown"),p=n.height(),d=r.outerHeight();if(d>p&&!t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){i.css("display","block");var v=s.height();if(t.data("autoDraggerLength")){var m=Math.round(p/d*v),g=o.data("minDraggerHeight");if(m<=g)o.css({height:g});else if(m>=v-10){var y=v-10;o.css({height:y})}else o.css({height:m});o.children(".mCSB_dragger_bar").css({"line-height":o.height()+"px"})}var w=o.height(),E=(d-p)/(v-w);t.data("scrollAmount",E),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().top));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else if(l>f&&t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){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),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().left));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else n.unbind("mousewheel"),n.unbind("focusin"),t.data("horizontalScroll")?o.add(r).css("left",0):o.add(r).css("top",0),i.css("display","none"),r.addClass("mCS_no_scrollbar")},scrolling:function(t,n,r,i,s,o,u,a){var f=e(this);if(!i.hasClass("ui-draggable")){if(f.data("horizontalScroll"))var l="x";else var l="y";i.draggable({axis:l,containment:"parent",drag:function(e,t){f.mCustomScrollbar("scroll"),i.addClass("mCSB_dragger_onDrag")},stop:function(e,t){i.removeClass("mCSB_dragger_onDrag")}})}r.unbind("click").bind("click",function(e){if(f.data("horizontalScroll")){var t=e.pageX-r.offset().left;if(ti.position().left+i.width()){var n=t;n>=r.width()-i.width()&&(n=r.width()-i.width()),i.css("left",n),f.mCustomScrollbar("scroll")}}else{var t=e.pageY-r.offset().top;if(ti.position().top+i.height()){var n=t;n>=r.height()-i.height()&&(n=r.height()-i.height()),i.css("top",n),f.mCustomScrollbar("scroll")}}});if(f.data("mouseWheel")){var c=f.data("mouseWheel");if(f.data("mouseWheel")==="auto"){c=8;var h=navigator.userAgent;h.indexOf("Mac")!=-1&&h.indexOf("Safari")!=-1&&h.indexOf("AppleWebKit")!=-1&&h.indexOf("Chrome")==-1&&(c=1)}t.unbind("mousewheel").bind("mousewheel",function(e,t){e.preventDefault();var n=Math.abs(t*c);if(f.data("horizontalScroll")){var s=i.position().left-t*n;i.css("left",s),i.position().left<0&&i.css("left",0);var o=r.width(),u=i.width();i.position().left>o-u&&i.css("left",o-u)}else{var a=i.position().top-t*n;i.css("top",a),i.position().top<0&&i.css("top",0);var l=r.height(),h=i.height();i.position().top>l-h&&i.css("top",l-h)}f.mCustomScrollbar("scroll")})}if(f.data("scrollButtons-enable"))if(f.data("scrollButtons-scrollType")==="pixels"){var p;e.browser.msie&&parseInt(e.browser.version)<9&&f.data("scrollInertia",0),f.data("horizontalScroll")?(a.add(u).unbind("click mousedown mouseup mouseout",g,w),a.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)+f.data("scrollButtons-scrollAmount"),f.mCustomScrollbar("scrollTo",p))}),u.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)-f.data("scrollButtons-scrollAmount"),n.position().left>=-f.data("scrollButtons-scrollAmount")&&(p="left"),f.mCustomScrollbar("scrollTo",p))})):(o.add(s).unbind("click mousedown mouseup mouseout",T,C),o.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().top)+f.data("scrollButtons-scrollAmount"),f.mCustomScrollbar("scrollTo",p))}),s.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().top)-f.data("scrollButtons-scrollAmount"),n.position().top>=-f.data("scrollButtons-scrollAmount")&&(p="top"),f.mCustomScrollbar("scrollTo",p))}))}else if(f.data("horizontalScroll")){a.add(u).unbind("click mousedown mouseup mouseout",g,w);var d,v=r.width(),m=i.width();a.bind("mousedown",function(e){e.preventDefault();var t=v-m;d=setInterval(function(){var e=Math.abs(i.position().left-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({left:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var g=function(e){e.preventDefault(),clearInterval(d),i.stop()};a.bind("mouseup mouseout",g);var y;u.bind("mousedown",function(e){e.preventDefault();var t=0;y=setInterval(function(){var e=Math.abs(i.position().left-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({left:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var w=function(e){e.preventDefault(),clearInterval(y),i.stop()};u.bind("mouseup mouseout",w)}else{o.add(s).unbind("click mousedown mouseup mouseout",T,C);var E,S=r.height(),x=i.height();o.bind("mousedown",function(e){e.preventDefault();var t=S-x;E=setInterval(function(){var e=Math.abs(i.position().top-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({top:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var T=function(e){e.preventDefault(),clearInterval(E),i.stop()};o.bind("mouseup mouseout",T);var N;s.bind("mousedown",function(e){e.preventDefault();var t=0;N=setInterval(function(){var e=Math.abs(i.position().top-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({top:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var C=function(e){e.preventDefault(),clearInterval(N),i.stop()};s.bind("mouseup mouseout",C)}t.unbind("focusin").bind("focusin",function(){t.scrollTop(0).scrollLeft(0);var s=e(document.activeElement);if(s.is("input,textarea,select,button,a[tabindex],area,object"))if(f.data("horizontalScroll")){var o=n.position().left,u=s.position().left,a=t.width(),l=s.outerWidth();if(!(o+u>=0&&o+u<=a-l)){var c=u/f.data("scrollAmount");c>=r.width()-i.width()&&(c=r.width()-i.width()),i.css("left",c),f.mCustomScrollbar("scroll")}}else{var h=n.position().top,p=s.position().top,d=t.height(),v=s.outerHeight();if(!(h+p>=0&&h+p<=d-v)){var c=p/f.data("scrollAmount");c>=r.height()-i.height()&&(c=r.height()-i.height()),i.css("top",c),f.mCustomScrollbar("scroll")}}})},scroll:function(t){var n=e(this),r=n.find(".mCSB_dragger"),i=n.find(".mCSB_container"),s=n.find(".mCustomScrollBox");if(n.data("horizontalScroll"))var o=r.position().left,u=-o*n.data("scrollAmount"),a=i.position().left,f=Math.round(a-u);else var l=r.position().top,c=-l*n.data("scrollAmount"),h=i.position().top,p=Math.round(h-c);if(e.browser.webkit)var d=(window.outerWidth-8)/window.innerWidth,v=d<.98||d>1.02;n.data("scrollInertia")===0||v?(n.data("horizontalScroll")?i.css("left",u):i.css("top",c),t||n.mCustomScrollbar("callbacks",s,i)):n.data("horizontalScroll")?i.stop().animate({left:"-="+f},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)}):i.stop().animate({top:"-="+p},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)})},scrollTo:function(t,n){var r={moveDragger:!1,callback:!0},n=e.extend(r,n),i=e(this),s,o=i.find(".mCustomScrollBox"),u=o.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device"))var a=i.find(".mCSB_draggerContainer"),f=a.children(".mCSB_dragger");var l;if(t){if(typeof t=="number")n.moveDragger?s=t:(l=t,s=Math.round(l/i.data("scrollAmount")));else if(typeof t=="string"){var c;t==="top"?c=0:t==="bottom"&&!i.data("horizontalScroll")?c=u.outerHeight()-o.height():t==="left"?c=0:t==="right"&&i.data("horizontalScroll")?c=u.outerWidth()-o.width():t==="first"?c=i.find(".mCSB_container").find(":first"):t==="last"?c=i.find(".mCSB_container").find(":last"):c=i.find(t),c.length===1?(i.data("horizontalScroll")?l=c.position().left:l=c.position().top,e(document).data("mCS-is-touch-device")?s=l:s=Math.ceil(l/i.data("scrollAmount"))):s=c}e(document).data("mCS-is-touch-device")?i.data("horizontalScroll")?o.stop().animate({scrollLeft:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):o.stop().animate({scrollTop:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):(i.data("horizontalScroll")?(s>=a.width()-f.width()&&(s=a.width()-f.width()),f.css("left",s)):(s>=a.height()-f.height()&&(s=a.height()-f.height()),f.css("top",s)),n.callback?i.mCustomScrollbar("scroll"):i.mCustomScrollbar("scroll",!0))}},callbacks:function(t,n){var r=e(this);if(!e(document).data("mCS-is-touch-device"))if(r.data("horizontalScroll")){var i=Math.round(n.position().left);i<0&&i<=t.width()-n.outerWidth()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var s=Math.round(n.position().top);s<0&&s<=t.height()-n.outerHeight()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else if(r.data("horizontalScroll")){var o=Math.round(t.scrollLeft());o>0&&o>=n.outerWidth()-r.width()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var u=Math.round(t.scrollTop());u>0&&u>=n.outerHeight()-r.height()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}}};e.fn.mCustomScrollbar=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init.apply(this,arguments);e.error("Method "+n+" does not exist")}}(jQuery),function(e){function t(t){var n=t||window.event,r=[].slice.call(arguments,1),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('':""),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),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(),a=t.getSize(),f=parseInt((n.x+r.x-s.length*5)/2),l=parseInt((n.y+r.y)/2);u.font="bold 14px arial",u.fillStyle="#FFF";var c=5,h=14+c,p=h/2,d=u.measureText(s).width+2*c-2*p,v=f-c+p,m=l-h+c;u.fillRect(v,m,d,h),u.beginPath(),u.arc(v,m+p,p,0,2*Math.PI,!1),u.arc(v+d,m+p,p,0,2*Math.PI,!1),u.fill(),u.fillStyle="#000",u.fillText(s,f,l)}},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,e.Edge.epsilon)}}},edgeSettingsEmbed={customEdgeEmbed:{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(),a=t.getSize(),f=parseInt((n.x+r.x-s.length*5)/2),l=parseInt((n.y+r.y)/2);u.font="bold 14px arial",u.fillStyle="#999";var c=5,h=14+c,p=h/2,d=u.measureText(s).width+2*c-2*p,v=f-c+p,m=l-h+c;u.fillRect(v,m,d,h),u.beginPath(),u.arc(v,m+p,p,0,2*Math.PI,!1),u.arc(v+d,m+p,p,0,2*Math.PI,!1),u.fill(),u.fillStyle="#000",u.fillText(s,f,l)}},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,e.Edge.epsilon)}}};(function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s>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;e.event.stop(e.event.get(t,n));var i=this.config.zooming/1e3,s=1+r*i;this.canvas.scale(s,s)},onMouseDown:function(e,t,n){if(!this.config.panning)return;if(this.config.panning=="avoid nodes"&&n.getNode())return;this.pressed=!0,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;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,u.x/2),l=a.add(f),c=a.$add(f.$scale(-1));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){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.fillStyle=r.strokeStyle=t.getLabelData("color"),r.textBaseline=t.getLabelData("textBaseline"),this.renderLabel(e,t,n)},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y+t.getData("height")/2)},hideLabel:e.empty,hideLabels:e.empty}),d.Label.DOM=new t({labelsHidden:!1,labelContainer:!1,labels:{},getLabelContainer:function(){return this.labelContainer?this.labelContainer:this.labelContainer=document.getElementById(this.viz.config.labelContainer)},getLabel:function(e){return e in this.labels&&this.labels[e]!=null?this.labels[e]:this.labels[e]=document.getElementById(e)},hideLabels:function(e){var t=this.getLabelContainer();e?t.style.display="none":t.style.display="",this.labelsHidden=e},clearLabels:function(e){for(var t in this.labels)if(e||!this.viz.graph.hasNode(t))this.disposeLabel(t),delete this.labels[t]},disposeLabel:function(e){var t=this.getLabel(e);t&&t.parentNode&&t.parentNode.removeChild(t)},hideLabel:function(t,n){t=e.splat(t);var r=n?"":"none",i,s=this;e.each(t,function(e){var t=s.getLabel(e.id);t&&(t.style.display=r)})},fitsInCanvas:function(e,t){var n=t.getSize();return e.x>=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=u0?n[0]:null,i(n)}var r=this;this.graph.eachNode(function(e){e.selected=!1});for(var s=0,o=[t.id].concat(n);s=t._depth)});for(var i=0;i0&&e.drawn?(e.drawn=!1,c[l.id].push(e)):(!h||!p)&&e.drawn&&(e.drawn=!1,c[l.id].push(e))}),l.drawn=!0}a.length>0&&i.fx.plot();for(f in c)e.each(c[f],function(e){e.drawn=!0});for(f=0;fi?r:i)+this.config.subtreeOffset)},getEdge:function(e,t,n){var r=function(t,n){return function(){return e.pos.add(new h(t,n))}},i=this.node,s=e.getData("width"),o=e.getData("height");if(t=="begin"){if(i.align=="center")return this.dispatch(n,r(0,o/2),r(-s/2,0),r(0,-o/2),r(s/2,0));if(i.align=="left")return this.dispatch(n,r(0,o),r(0,0),r(0,0),r(s,0));if(i.align=="right")return this.dispatch(n,r(0,0),r(-s,0),r(0,-o),r(0,0));throw"align: not implemented"}if(t=="end"){if(i.align=="center")return this.dispatch(n,r(0,-o/2),r(s/2,0),r(0,o/2),r(-s/2,0));if(i.align=="left")return this.dispatch(n,r(0,0),r(s,0),r(0,o),r(0,0));if(i.align=="right")return this.dispatch(n,r(0,-o),r(0,0),r(0,0),r(-s,0));throw"align: not implemented"}},getScaledTreePosition:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=this.config.multitree&&"$orn"in e.data&&e.data.$orn||this.config.orientation,o=function(n,r){return function(){return e.pos.add(new h(n,r)).$scale(1-t)}};if(n.align=="left")return this.dispatch(s,o(0,i),o(0,0),o(0,0),o(r,0));if(n.align=="center")return this.dispatch(s,o(0,i/2),o(-r/2,0),o(0,-i/2),o(r/2,0));if(n.align=="right")return this.dispatch(s,o(0,0),o(-r,0),o(0,-i),o(0,0));throw"align: not implemented"},treeFitsInCanvas:function(e,t,n){var r=t.getSize(),i=this.config.multitree&&"$orn"in e.data&&e.data.$orn||this.config.orientation,s=this.dispatch(i,r.width,r.height),o=this.getTreeBaseSize(e,n,function(e,t){return e===0||!t.anySubnode()});return o=0){t.drawn=!1;var a=o.getCtx(),f=s.geom.getScaledTreePosition(t,r);a.translate(f.x,f.y),a.scale(r,r)}this.plotTree(t,e.merge(n,{withLabels:!0,hideLabels:!!r,plotSubtree:function(e,n){var r=u.multitree&&!("$orn"in t.data),i=r&&t.getData("orns");return!r||i.indexOf(elem.getData("orn"))>-1}}),i),r>=0&&(t.drawn=!0)},getAlignedPos:function(e,t,n){var r=this.node,i,s;if(r.align=="center")i={x:e.x-t/2,y:e.y-n/2};else if(r.align=="left")s=this.config.orientation,s=="bottom"||s=="top"?i={x:e.x-t/2,y:e.y}:i={x:e.x,y:e.y-n/2};else{if(r.align!="right")throw"align: not implemented";s=this.config.orientation,s=="bottom"||s=="top"?i={x:e.x-t/2,y:e.y-n}:i={x:e.x-t,y:e.y-n/2}}return i},getOrientation:function(e){var t=this.config,n=t.orientation;if(t.multitree){var r=e.nodeFrom,i=e.nodeTo;n="$orn"in r.data&&r.data.$orn||"$orn"in i.data&&i.data.$orn}return n}}),$jit.ST.Label={},$jit.ST.Label.Native=new t({Implements:d.Label.Native,renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0);r.fillText(t.name,i.x,i.y)}}),$jit.ST.Label.DOM=new t({Implements:d.Label.DOM,placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.config,s=i.Node,o=this.viz.canvas,u=t.getData("width"),a=t.getData("height"),f=o.getSize(),l,c,h=o.translateOffsetX,p=o.translateOffsetY,d=o.scaleOffsetX,v=o.scaleOffsetY,m=r.x*d+h,g=r.y*v+p;if(s.align=="center")l={x:Math.round(m-u/2+f.width/2),y:Math.round(g-a/2+f.height/2)};else if(s.align=="left")c=i.orientation,c=="bottom"||c=="top"?l={x:Math.round(m-u/2+f.width/2),y:Math.round(g+f.height/2)}:l={x:Math.round(m+f.width/2),y:Math.round(g-a/2+f.height/2)};else{if(s.align!="right")throw"align: not implemented";c=i.orientation,c=="bottom"||c=="top"?l={x:Math.round(m-u/2+f.width/2),y:Math.round(g-a+f.height/2)}:l={x:Math.round(m-u+f.width/2),y:Math.round(g-a/2+f.height/2)}}var y=e.style;y.left=l.x+"px",y.top=l.y+"px",y.display=this.fitsInCanvas(l,o)?"":"none",n.onPlaceLabel(e,t)}}),$jit.ST.Label.SVG=new t({Implements:[$jit.ST.Label.DOM,d.Label.SVG],initialize:function(e){this.viz=e}}),$jit.ST.Label.HTML=new t({Implements:[$jit.ST.Label.DOM,d.Label.HTML],initialize:function(e){this.viz=e}}),$jit.ST.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.circle.render("fill",{x:r.x+i,y:r.y+i},i,t)},contains:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.circle.contains({x:r.x+i,y:r.y+i},i)}},square:{render:function(e,t){var n=e.getData("dim"),r=n/2,i=this.getAlignedPos(e.pos.getc(!0),n,n);this.nodeHelper.square.render("fill",{x:i.x+r,y:i.y+r},r,t)},contains:function(e,t){var n=e.getData("dim"),r=this.getAlignedPos(e.pos.getc(!0),n,n),i=n/2;this.nodeHelper.square.contains({x:r.x+i,y:r.y+i},i)}},ellipse:{render:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.ellipse.render("fill",{x:i.x+n/2,y:i.y+r/2},n,r,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.ellipse.contains({x:i.x+n/2,y:i.y+r/2},n,r,canvas)}},rectangle:{render:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.rectangle.render("fill",{x:i.x+n/2,y:i.y+r/2},n,r,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=this.getAlignedPos(e.pos.getc(!0),n,r);this.nodeHelper.rectangle.contains({x:i.x+n/2,y:i.y+r/2},n,r,canvas)}}}),$jit.ST.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=this.getOrientation(e),r=e.nodeFrom,i=e.nodeTo,s=r._depth1&&a[0]!=r.id;this.edgeHelper.arrow.render(o,u,s,f,t)},contains:function(e,t){var n=this.getOrientation(e),r=e.nodeFrom,i=e.nodeTo,s=r._depth0||l[T][1]>0)){var A=C+l[T][0],O=k+l[T][1],M=Math.atan((O-A)/i),_=55,D=S.createLinearGradient(u+i/2,a-(A+O)/2,u+i/2+_*Math.sin(M),a-(A+O)/2+_*Math.cos(M)),P=e.rgbToHex(e.map(e.hexToRgb(d[T%v].slice(1)),function(e){return e*.85>>0}));D.addColorStop(0,d[T%v]),D.addColorStop(1,P),S.fillStyle=D}S.beginPath(),S.moveTo(u,a-C),S.lineTo(u+i,a-k),S.lineTo(u+i,a-k-l[T][1]),S.lineTo(u,a-C-l[T][0]),S.lineTo(u,a-C),S.fill(),S.restore();if(x){var H=x.name==f[T],B=H?.7:.8,P=e.rgbToHex(e.map(e.hexToRgb(d[T%v].slice(1)),function(e){return e*B>>0}));S.strokeStyle=P,S.lineWidth=H?4:1,S.save(),S.beginPath(),x.index===0?(S.moveTo(u,a-C),S.lineTo(u,a-C-l[T][0])):(S.moveTo(u+i,a-k),S.lineTo(u+i,a-k-l[T][1])),S.stroke(),S.restore()}C+=l[T][0]||0,k+=l[T][1]||0,l[T][0]>0&&(L+=c[T][0]||0)}E&&w.type=="Native"&&(S.save(),S.beginPath(),S.fillStyle=S.strokeStyle=w.color,S.font=w.style+" "+w.size+"px "+w.family,S.textAlign="center",S.textBaseline="middle",b(t.name,h,p,t)&&S.fillText(L,u,a-C-m.labelOffset-w.size/2,i),y(t.name,h,p,t)&&S.fillText(t.name,u,a+w.size/2+m.labelOffset),S.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=t.x-o;if(t.xo+r||t.y>u||t.y=v){var m=+(f>r/2);return{name:e.getData("stringArray")[l],color:e.getData("colorArray")[l],value:e.getData("valueArray")[l][m],index:m}}}return!1}}}),$jit.AreaChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","AreaChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i={},s=new $jit.ST({injectInto:t.injectInto,orientation:"bottom",levelDistance:0,siblingOffset:0,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"areachart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,r,i){if(!t.filterOnClick&&!t.Events.enable)return;var s=r.getContains();s&&t.filterOnClick&&n.filter(s.name),t.Events.enable&&t.Events.onClick(s,r,i)},onRightClick:function(e,r,i){if(!t.restoreOnRightClick)return;n.restore()},onMouseMove:function(e,r,i){if(!t.selectOnHover)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var s=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t[0]},0),a=e.reduce(o,function(e,t){return e+t[1]},0);if(r.getData("prev")){var f={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},l=f.wrapper,c=f.label,h=f.aggregate,p=l.style,d=c.style,v=h.style;i[r.id]=f,l.appendChild(c),l.appendChild(h),t.showLabels(r.name,u,a,r)||(c.style.display="none"),t.showAggregates(r.name,u,a,r)||(h.style.display="none"),p.position="relative",p.overflow="visible",p.fontSize=s.size+"px",p.fontFamily=s.family,p.color=s.color,p.textAlign="center",v.position=d.position="absolute",n.style.width=r.getData("width")+"px",n.style.height=r.getData("height")+"px",c.innerHTML=r.name,n.appendChild(l)}},onPlaceLabel:function(n,r){if(!r.getData("prev"))return;var s=i[r.id],o=s.wrapper.style,u=s.label.style,a=s.aggregate.style,f=r.getData("width"),l=r.getData("height"),c=r.getData("dimArray"),h=r.getData("valueArray"),p=e.reduce(h,function(e,t){return e+t[0]},0),d=e.reduce(h,function(e,t){return e+t[1]},0),v=parseInt(o.fontSize,10),m=n.style;if(c&&h){t.showLabels(r.name,p,d,r)?u.display="":u.display="none",t.showAggregates(r.name,p,d,r)?a.display="":a.display="none",o.width=a.width=u.width=n.style.width=f+"px",a.left=u.left=-f/2+"px";for(var g=0,y=h.length,b=0,w=0;g0&&(b+=h[g][0],w+=c[g][0]);a.top=-v-t.labelOffset+"px",u.top=t.labelOffset+w+"px",n.style.top=parseInt(n.style.top,10)-w+"px",n.style.height=o.height=w+"px",s.aggregate.innerHTML=b}}}),o=s.canvas.getSize(),u=t.Margin;s.config.offsetY=-o.height/2+u.bottom+(t.showLabels&&t.labelOffset+t.Label.size),s.config.offsetX=(u.right-u.left)/2,this.st=s,this.canvas=this.st.canvas},loadJSON:function(t){var n=e.time(),r=[],i=this.st,s=e.splat(t.label),o=e.splat(t.color||this.colors),u=this.config,a=!!u.type.split(":")[1],f=u.animate;for(var l=0,c=t.values,h=c.length;l-1?n:[0,0]}),"end")}),this.st.fx.animate({modes:["node-property:dimArray"],duration:1500,onComplete:function(){r.busy=!1}})},restore:function(){if(this.busy)return;this.busy=!0,this.config.Tips.enable&&this.st.tips.hide(),this.select(!1,!1,!1),this.normalizeDims();var e=this;this.st.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){e.busy=!1}})},select:function(e,t,n){if(!this.config.selectOnHover)return;var r=this.selected;if(r.id!=e||r.name!=t||r.index!=n){r.id=e,r.name=t,r.index=n,this.st.graph.eachNode(function(e){e.setData("border",!1)});if(e){var i=this.st.graph.getNode(e);i.setData("border",r);var s=n===0?"prev":"next";s=i.getData(s),s&&(i=this.st.graph.getByName(s),i&&i.setData("border",{name:t,index:1-n}))}this.st.plot()}},getLegend:function(){var t={},n;this.st.graph.getNode(this.st.root).eachAdjacency(function(e){n=e.nodeTo});var r=n.getData("colorArray"),i=r.length;return e.each(n.getData("stringArray"),function(e,n){t[e]=r[n%i]}),t},getMaxValue:function(){var t=0;return this.st.graph.eachNode(function(n){var r=n.getData("valueArray"),i=0,s=0;e.each(r,function(e){i+=+e[0],s+=+e[1]});var o=s>i?s:i;t=t>o?t:o}),t},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=s.labelOffset+s.Label.size,a=(i.width-(o.left+o.right))/n,f=s.animate,l=i.height-(o.top+o.bottom)-(s.showAggregates&&u)-(s.showLabels&&u);this.st.graph.eachNode(function(t){var n=0,i=0,s=[];e.each(t.getData("valueArray"),function(e){n+=+e[0],i+=+e[1],s.push([0,0])});var o=i>n?i:n;t.setData("width",a);if(f){t.setData("height",o*l/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}),"end");var u=t.getData("dimArray");u||t.setData("dimArray",s)}else t.setData("height",o*l/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return[e[0]*l/r,e[1]*l/r]}))})}}),i.BarChart={$extend:!0,animate:!0,type:"stacked",labelOffset:3,barsOffset:0,hoveredColor:"#9fd4ff",orientation:"horizontal",showAggregates:!0,showLabels:!0,Tips:{enable:!1,onShow:e.empty,onHide:e.empty},Events:{enable:!1,onClick:e.empty}},$jit.ST.Plot.NodeTypes.implement({"barchart-stacked":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=t.getData("colorArray"),h=c.length,p=t.getData("stringArray"),d=n.getCtx(),v={},m=t.getData("border"),g=t.getData("gradient"),y=t.getData("config"),b=y.orientation=="horizontal",w=y.showAggregates,E=y.showLabels,S=y.Label;if(c&&f&&p){for(var x=0,T=f.length,N=0,C=0;x>0}));k.addColorStop(0,L),k.addColorStop(.5,c[x%h]),k.addColorStop(1,L),d.fillStyle=k}b?d.fillRect(u+N,a,f[x],s):d.fillRect(u,a-N-f[x],i,f[x]),m&&m.name==p[x]&&(v.acum=N,v.dimValue=f[x]),N+=f[x]||0,C+=l[x]||0}m&&(d.save(),d.lineWidth=2,d.strokeStyle=m.color,b?d.strokeRect(u+v.acum+1,a+1,v.dimValue-2,s-2):d.strokeRect(u+1,a-v.acum-v.dimValue+1,i-2,v.dimValue-2),d.restore()),S.type=="Native"&&(d.save(),d.fillStyle=d.strokeStyle=S.color,d.font=S.style+" "+S.size+"px "+S.family,d.textBaseline="middle",w(t.name,C)&&(b?(d.textAlign="right",d.fillText(C,u+N-y.labelOffset,a+s/2)):(d.textAlign="center",d.fillText(C,u+i/2,a-s-S.size/2-y.labelOffset))),E(t.name,C,t)&&(b?(d.textAlign="center",d.translate(u-y.labelOffset-S.size/2,a+s/2),d.rotate(Math.PI/2),d.fillText(t.name,0,0)):(d.textAlign="center",d.fillText(t.name,u+i/2,a+S.size/2+y.labelOffset))),d.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=e.getData("config"),l=t.x-o,c=f.orientation=="horizontal";if(c){if(t.xo+r||t.y>u+i||t.yo+r||t.y>u||t.y=m)return{name:e.getData("stringArray")[h],color:e.getData("colorArray")[h],value:e.getData("valueArray")[h],label:e.name}}}return!1}},"barchart-grouped":{render:function(t,n){var r=t.pos.getc(!0),i=t.getData("width"),s=t.getData("height"),o=this.getAlignedPos(r,i,s),u=o.x,a=o.y,f=t.getData("dimArray"),l=t.getData("valueArray"),c=l.length,h=t.getData("colorArray"),p=h.length,d=t.getData("stringArray"),v=n.getCtx(),m={},g=t.getData("border"),y=t.getData("gradient"),b=t.getData("config"),w=b.orientation=="horizontal",E=b.showAggregates,S=b.showLabels,x=b.Label,T=(w?s:i)/c;if(h&&f&&d){for(var N=0,C=c,k=0,L=0;N>0}));A.addColorStop(0,O),A.addColorStop(.5,h[N%p]),A.addColorStop(1,O),v.fillStyle=A}w?v.fillRect(u,a+T*N,f[N],T):v.fillRect(u+T*N,a-f[N],T,f[N]),g&&g.name==d[N]&&(m.acum=T*N,m.dimValue=f[N]),k+=f[N]||0,L+=l[N]||0}g&&(v.save(),v.lineWidth=2,v.strokeStyle=g.color,w?v.strokeRect(u+1,a+m.acum+1,m.dimValue-2,T-2):v.strokeRect(u+m.acum+1,a-m.dimValue+1,T-2,m.dimValue-2),v.restore()),x.type=="Native"&&(v.save(),v.fillStyle=v.strokeStyle=x.color,v.font=x.style+" "+x.size+"px "+x.family,v.textBaseline="middle",E(t.name,L)&&(w?(v.textAlign="right",v.fillText(L,u+Math.max.apply(null,f)-b.labelOffset,a+s/2)):(v.textAlign="center",v.fillText(L,u+i/2,a-Math.max.apply(null,f)-x.size/2-b.labelOffset))),S(t.name,L,t)&&(w?(v.textAlign="center",v.translate(u-b.labelOffset-x.size/2,a+s/2),v.rotate(Math.PI/2),v.fillText(t.name,0,0)):(v.textAlign="center",v.fillText(t.name,u+i/2,a+x.size/2+b.labelOffset))),v.restore())}},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height"),s=this.getAlignedPos(n,r,i),o=s.x,u=s.y,a=e.getData("dimArray"),f=a.length,l=e.getData("config"),c=t.x-o,h=l.orientation=="horizontal",p=(h?i:r)/f;if(h){if(t.xo+r||t.y>u+i||t.yo+r||t.y>u||t.y=g&&t.y<=g+p)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}else{var g=o+p*d;if(t.x>=g&&t.x<=g+p&&t.y>=u-m)return{name:e.getData("stringArray")[d],color:e.getData("colorArray")[d],value:e.getData("valueArray")[d],label:e.name}}}return!1}}}),$jit.BarChart=new t({st:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","Margin","Label","BarChart"),{Label:{type:"Native"}},t);var n=this.config.showLabels,r=e.type(n),s=this.config.showAggregates,o=e.type(s);this.config.showLabels=r=="function"?n:e.lambda(n),this.config.showAggregates=o=="function"?s:e.lambda(s),this.initializeViz()},initializeViz:function(){var t=this.config,n=this,r=t.type.split(":")[0],i=t.orientation=="horizontal",s={},o=new $jit.ST({injectInto:t.injectInto,orientation:i?"left":"bottom",levelDistance:0,siblingOffset:t.barsOffset,subtreeOffset:0,withLabels:t.Label.type!="Native",useCanvas:t.useCanvas,Label:{type:t.Label.type},Node:{overridable:!0,type:"barchart-"+r,align:"left",width:1,height:1},Edge:{type:"none"},Tips:{enable:t.Tips.enable,type:"Native",force:!0,onShow:function(e,n,r){var i=r;t.Tips.onShow(e,i,n)}},Events:{enable:!0,type:"Native",onClick:function(e,n,r){if(!t.Events.enable)return;var i=n.getContains();t.Events.onClick(i,n,r)},onMouseMove:function(e,r,i){if(!t.hoveredColor)return;if(e){var s=r.getContains();n.select(e.id,s.name,s.index)}else n.select(!1,!1,!1)}},onCreateLabel:function(n,r){var i=t.Label,o=r.getData("valueArray"),u=e.reduce(o,function(e,t){return e+t},0),a={wrapper:document.createElement("div"),aggregate:document.createElement("div"),label:document.createElement("div")},f=a.wrapper,l=a.label,c=a.aggregate,h=f.style,p=l.style,d=c.style;s[r.id]=a,f.appendChild(l),f.appendChild(c),t.showLabels(r.name,u,r)||(p.display="none"),t.showAggregates(r.name,u,r)||(d.display="none"),h.position="relative",h.overflow="visible",h.fontSize=i.size+"px",h.fontFamily=i.family,h.color=i.color,h.textAlign="center",d.position=p.position="absolute",n.style.width=r.getData("width")+"px",n.style.height=r.getData("height")+"px",d.left=p.left="0px",l.innerHTML=r.name,n.appendChild(f)},onPlaceLabel:function(e,n){if(!s[n.id])return;var r=s[n.id],i=r.wrapper.style,o=r.label.style,u=r.aggregate.style,a=t.type.split(":")[0]=="grouped",f=t.orientation=="horizontal",l=n.getData("dimArray"),c=n.getData("valueArray"),h=a&&f?Math.max.apply(null,l):n.getData("width"),p=a&&!f?Math.max.apply(null,l):n.getData("height"),d=parseInt(i.fontSize,10),v=e.style;if(l&&c){i.width=u.width=o.width=e.style.width=h+"px";for(var m=0,g=c.length,y=0;m0&&(y+=c[m]);t.showLabels(n.name,y,n)?o.display="":o.display="none",t.showAggregates(n.name,y,n)?u.display="":u.display="none",t.orientation=="horizontal"?(u.textAlign="right",o.textAlign="left",o.textIndex=u.textIndent=t.labelOffset+"px",u.top=o.top=(p-d)/2+"px",e.style.height=i.height=p+"px"):(u.top=-d-t.labelOffset+"px",o.top=t.labelOffset+p+"px",e.style.top=parseInt(e.style.top,10)-p+"px",e.style.height=i.height=p+"px"),r.aggregate.innerHTML=y}}}),u=o.canvas.getSize(),a=t.Margin;i?(o.config.offsetX=u.width/2-a.left-(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetY=(a.bottom-a.top)/2):(o.config.offsetY=-u.height/2+a.bottom+(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetX=(a.right-a.left)/2),this.st=o,this.canvas=this.st.canvas},loadJSON:function(t){if(this.busy)return;this.busy=!0;var n=e.time(),r=[],i=this.st,s=e.splat(t.label),o=e.splat(t.color||this.colors),u=this.config,a=!!u.type.split(":")[1],f=u.animate,l=u.orientation=="horizontal",c=this;for(var h=0,p=t.values,d=p.length;hs?t:s}),t},setBarType:function(e){this.config.type=e,this.st.config.Node.type="barchart-"+e.split(":")[0]},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=o.left+o.right,a=o.top+o.bottom,f=s.orientation=="horizontal",l=(i[f?"height":"width"]-(f?a:u)-(n-1)*s.barsOffset)/n,c=s.animate,h=i[f?"width":"height"]-(f?u:a)-(!f&&s.showAggregates&&s.Label.size+s.labelOffset)-(s.showLabels&&s.Label.size+s.labelOffset),p=f?"height":"width",d=f?"width":"height";this.st.graph.eachNode(function(t){var n=0,i=[];e.each(t.getData("valueArray"),function(e){n+=+e,i.push(0)}),t.setData(p,l);if(c){t.setData(d,n*h/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}),"end");var s=t.getData("dimArray");s||t.setData("dimArray",i)}else t.setData(d,n*h/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}))})}}),i.PieChart={$extend:!0,animate:!0,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:!1,onClick:e.empty},Tips:{enable:!1,onShow:e.empty,onHide:e.empty},showLabels:!0,resizeLabels:!1,updateHeights:!1},b.Radial=new t({compute:function(t){var n=e.splat(t||["current","start","end"]);w.compute(this.graph,n,this.config),this.graph.computeLevels(this.root,0,"ignore");var r=this.createLevelDistanceFunc();this.computeAngularWidths(n),this.computePositions(n,r)},computePositions:function(e,t){var n=e,r=this.graph,i=r.getNode(this.root),s=this.parent,o=this.config;for(var u=0,a=n.length;uf[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;ld/2&&h.theta<3*d/2,a=v?h.theta+d:h.theta;v?(o-=Math.abs(Math.cos(h.theta)*s.width),u+=Math.sin(h.theta)*s.width):t.id==this.viz.root&&(o-=s.width/2)}i.save(),i.translate(o,u),i.rotate(a),i.fillText(t.name,0,0),i.restore()}}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz,s=this.viz.canvas,o=s.getSize(),u={x:Math.round(r.x+o.width/2),y:Math.round(r.y+o.height/2)};e.setAttribute("x",u.x),e.setAttribute("y",u.y);var a=e.getBBox();if(a){var f=e.getAttribute("x"),l=e.getAttribute("y"),c=t.pos.getp(!0),h=Math.PI,p=c.theta>h/2&&c.theta<3*h/2;p?(e.setAttribute("x",f-a.width),e.setAttribute("y",l-a.height)):t.id==i.root&&e.setAttribute("x",f-a.width/2);var d=p?c.theta+h:c.theta;t._depth&&e.setAttribute("transform","rotate("+d*360/(2*h)+" "+f+" "+l+")")}n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.clone(),i=this.viz.canvas,s=t.getData("height"),o=(s||t._depth==0?s:this.viz.config.levelDistance)/2,u=i.getSize();r.rho+=o,r=r.getc(!0);var a={x:Math.round(r.x+u.width/2),y:Math.round(r.y+u.height/2)},f=e.style;f.left=a.x+"px",f.top=a.y+"px",f.display=this.fitsInCanvas(a,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1),anglecontains:function(e,t){var n=e.getData("span")/2,r=e.pos.theta,i=r-n,s=r+n;i<0&&(i+=Math.PI*2);var o=Math.atan2(t.y,t.x);return o<0&&(o+=Math.PI*2),i>s?o>i&&o<=Math.PI*2||oi&&o=s*o&&n<=s*o+i}return!1}},"gradient-multipie":{render:function(t,n){var r=n.getCtx(),i=t.getData("height"),s=i?i:this.config.levelDistance,o=r.createRadialGradient(0,0,t.getPos().rho,0,0,t.getPos().rho+s),u=e.hexToRgb(t.getData("color")),a=[];e.each(u,function(e){a.push(parseInt(e*.5,10))});var f=e.rgbToHex(a);o.addColorStop(0,f),o.addColorStop(1,t.getData("color")),r.fillStyle=o,this.nodeTypes.multipie.render.call(this,t,n)},contains:function(e,t){return this.nodeTypes.multipie.contains.call(this,e,t)}},"gradient-pie":{render:function(t,n){var r=n.getCtx(),i=r.createRadialGradient(0,0,0,0,0,t.getPos().rho),s=e.hexToRgb(t.getData("color")),o=[];e.each(s,function(e){o.push(parseInt(e*.5,10))});var u=e.rgbToHex(o);i.addColorStop(1,u),i.addColorStop(0,t.getData("color")),r.fillStyle=i,this.nodeTypes.pie.render.call(this,t,n)},contains:function(e,t){return this.nodeTypes.pie.contains.call(this,e,t)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);this.edgeHelper.line.render(n,r,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0);return this.edgeHelper.line.contains(n,r,t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.getData("dim"),s=e.data.$direction,o=s&&s.length>1&&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)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=Math.max(n.norm(),r.norm());this.edgeHelper.hyperline.render(n.$scale(1/i),r.$scale(1/i),i,t)},contains:e.lambda(!1)}})}($jit.Sunburst),$jit.Sunburst.Plot.NodeTypes.implement({"piechart-stacked":{render:function(t,n){var r=t.pos.getp(!0),i=t.getData("dimArray"),s=t.getData("valueArray"),o=t.getData("colorArray"),u=o.length,a=t.getData("stringArray"),f=t.getData("span")/2,c=t.pos.theta,h=c-f,p=c+f,d=new l,v=n.getCtx(),m={},g=t.getData("gradient"),y=t.getData("border"),b=t.getData("config"),w=b.showLabels,E=b.resizeLabels,S=b.Label,x=b.sliceOffset*Math.cos((h+p)/2),T=b.sliceOffset*Math.sin((h+p)/2);if(o&&i&&a){for(var N=0,C=i.length,k=0,L=0;N>0}),P=e.rgbToHex(D);M.addColorStop(0,O),M.addColorStop(.5,O),M.addColorStop(1,P),v.fillStyle=M}d.rho=k+b.sliceOffset,d.theta=h;var H=d.getc(!0);d.theta=p;var B=d.getc(!0);d.rho+=A;var j=d.getc(!0);d.theta=h;var F=d.getc(!0);v.beginPath(),v.arc(x,T,k+.01,h,p,!1),v.arc(x,T,k+A+.01,p,h,!0),v.fill(),y&&y.name==a[N]&&(m.acum=k,m.dimValue=i[N],m.begin=h,m.end=p),k+=A||0,L+=s[N]||0}if(y){v.save(),v.globalCompositeOperation="source-over",v.lineWidth=2,v.strokeStyle=y.color;var I=h>0;R=R<+E?+E:R,v.font=S.style+" "+R+"px "+S.family,v.textBaseline="middle",v.textAlign="center",d.rho=k+b.labelOffset+b.sliceOffset,d.theta=t.pos.theta;var U=d.getc(!0);v.fillText(t.name,U.x,U.y),v.restore()}}},contains:function(e,t){if(this.nodeTypes.none.anglecontains.call(this,e,t)){var n=Math.sqrt(t.x*t.x+t.y*t.y),r=this.config.levelDistance,i=e._depth,s=e.getData("config");if(n<=r*i+s.sliceOffset){var o=e.getData("dimArray");for(var u=0,a=o.length,f=s.sliceOffset;u=f&&n<=f+l)return{name:e.getData("stringArray")[u],color:e.getData("colorArray")[u],value:e.getData("valueArray")[u],label:e.name};f+=l}}return!1}return!1}}}),$jit.PieChart=new t({sb:null,colors:["#416D9C","#70A35E","#EBB056","#C74243","#83548B","#909291","#557EAA"],selected:{},busy:!1,initialize:function(t){this.controller=this.config=e.merge(i("Canvas","PieChart","Label"),{Label:{type:"Native"}},t),this.initializeViz()},initializeViz:function(){var e=this.config,t=this,n=e.type.split(":")[0],r=new $jit.Sunburst({injectInto:e.injectInto,useCanvas:e.useCanvas,withLabels:e.Label.type!="Native",Label:{type:e.Label.type},Node:{overridable:!0,type:"piechart-"+n,width:1,height:1},Edge:{type:"none"},Tips:{enable:e.Tips.enable,type:"Native",force:!0,onShow:function(t,n,r){var i=r;e.Tips.onShow(t,i,n)}},Events:{enable:!0,type:"Native",onClick:function(t,n,r){if(!e.Events.enable)return;var i=n.getContains();e.Events.onClick(i,n,r)},onMouseMove:function(n,r,i){if(!e.hoveredColor)return;if(n){var s=r.getContains();t.select(n.id,s.name,s.index)}else t.select(!1,!1,!1)}},onCreateLabel:function(t,n){var r=e.Label;if(e.showLabels){var i=t.style;i.fontSize=r.size+"px",i.fontFamily=r.family,i.color=r.color,i.textAlign="center",t.innerHTML=n.name}},onPlaceLabel:function(n,r){if(!e.showLabels)return;var i=r.pos.getp(!0),s=r.getData("dimArray"),o=r.getData("span")/2,u=r.pos.theta,a=u-o,f=u+o,c=new l,h=e.showLabels,p=e.resizeLabels,d=e.Label;if(s){for(var v=0,m=s.length,g=0;v>0;b=b<+p?+p:b,n.style.fontSize=b+"px",c.rho=g+e.labelOffset+e.sliceOffset,c.theta=(a+f)/2;var i=c.getc(!0),w=t.canvas.getSize(),E={x:Math.round(i.x+w.width/2),y:Math.round(i.y+w.height/2)};n.style.left=E.x+"px",n.style.top=E.y+"px"}}}),i=r.canvas.getSize(),s=Math.min;r.config.levelDistance=s(i.width,i.height)/2-e.offset-e.sliceOffset,this.sb=r,this.canvas=this.sb.canvas,this.canvas.getCtx().globalCompositeOperation="lighter"},loadJSON:function(t){var n=e.time(),r=[],i=this.sb,s=e.splat(t.label),o=s.length,u=e.splat(t.color||this.colors),a=u.length,f=this.config,l=!!f.type.split(":")[1],c=f.animate,h=o==1;for(var p=0,d=t.values,v=d.length;pi?t:i}),t},normalizeDims:function(){var t=this.sb.graph.getNode(this.sb.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.config,s=i.animate,o=this.sb.config.levelDistance;this.sb.graph.eachNode(function(t){var n=0,u=[];e.each(t.getData("valueArray"),function(e){n+=+e,u.push(1)});var a=u.length==1&&!i.updateHeights;if(s){t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return a?o:e*o/r}),"end");var f=t.getData("dimArray");f||t.setData("dimArray",u)}else t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return a?o:e*o/r}));t.setData("normalizedDim",n/r)})}}),b.TM={},b.TM.SliceAndDice=new t({compute:function(e){var t=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(t);var n=this.canvas.getSize(),r=this.config,i=n.width,s=n.height;this.graph.computeLevels(this.root,0,"ignore"),t.getPos(e).setc(-i/2,-s/2),t.setData("width",i,e),t.setData("height",s+r.titleHeight,e),this.computePositions(t,t,this.layout.orientation,e),this.controller.onAfterCompute(t)},computePositions:function(e,t,n,r){var i=0;e.eachSubnode(function(e){i+=e.getData("area",r)});var s=this.config,o=s.offset,u=e.getData("width",r),a=e.getData("height",r)-s.titleHeight,f=e==t?1:t.getData("area",r)/i,l,c,h,p,d,v,m,g=n=="h";g?(n="v",l=a,c=u*f,h="height",p="y",d="x",v=s.titleHeight,m=0):(n="h",l=a*f,c=u,h="width",p="x",d="y",v=0,m=s.titleHeight);var y=t.getPos(r);t.setData("width",c,r),t.setData("height",l,r);var b=0,w=this;t.eachSubnode(function(e){var i=e.getPos(r);i[p]=b+y[p]+v,i[d]=y[d]+m,w.computePositions(t,e,n,r),b+=e.getData(h,r)})}}),b.TM.Area={compute:function(e){e=e||"current";var t=this.graph.getNode(this.clickedNode&&this.clickedNode.id||this.root);this.controller.onBeforeCompute(t);var n=this.config,r=this.canvas.getSize(),i=r.width,s=r.height,o=n.offset,u=i-o,a=s-o;this.graph.computeLevels(this.root,0,"ignore"),t.getPos(e).setc(-i/2,-s/2),t.setData("width",i,e),t.setData("height",s,e);var f={top:-s/2+n.titleHeight,left:-i/2,width:u,height:a-n.titleHeight};this.computePositions(t,f,e),this.controller.onAfterCompute(t)},computeDim:function(e,t,n,r,i,s){if(e.length+t.length==1){var o=e.length==1?e:t;this.layoutLast(o,n,r,s);return}e.length>=2&&t.length==0&&(t=[e.shift()]);if(e.length==0){t.length>0&&this.layoutRow(t,n,r,s);return}var u=e[0];if(i(t,n)>=i([u].concat(t),n))this.computeDim(e.slice(1),t.concat([u]),n,r,i,s);else{var a=this.layoutRow(t,n,r,s);this.computeDim(e,[],a.dim,a,i,s)}},worstAspectRatio:function(e,t){if(!e||e.length==0)return Number.MAX_VALUE;var n=0,r=0,i=Number.MAX_VALUE;for(var s=0,o=e.length;su?r:u}var a=t*t,f=n*n;return Math.max(a*r/f,f/(a*i))},avgAspectRatio:function(e,t){if(!e||e.length==0)return Number.MAX_VALUE;var n=0;for(var r=0,i=e.length;ro?t/o:o/t}return n/i},layoutLast:function(e,t,n,r){var i=e[0];i.getPos(r).setc(n.left,n.top),i.setData("width",n.width,r),i.setData("height",n.height,r)}},b.TM.Squarified=new t({Implements:b.TM.Area,computePositions:function(e,t,n){var r=this.config;t.width>=t.height?this.layout.orientation="h":this.layout.orientation="v";var i=e.getSubnodes([1,1],"ignore");if(i.length>0){this.processChildrenLayout(e,i,t,n);for(var s=0,o=i.length;s0){this.processChildrenLayout(e,r,t,n);for(var s=0,o=r.length;sa&&(a=t)});var f=this.graph.getNode(this.clickedNode&&this.clickedNode.id||t.id),l=Math.min(a,u-1),c=f._depth;this.layout.horizontal()?this.computeSubtree(f,-i/2,-s/2,i/(l+1),s,c,l,e):this.computeSubtree(f,-i/2,-s/2,i,s/(l+1),c,l,e)},computeSubtree:function(t,n,r,i,s,o,u,a){t.getPos(a).setc(n,r),t.setData("width",i,a),t.setData("height",s,a);var f,l=0,c=0,h=d.Util.getSubnodes(t,[1,1]);if(!h.length)return;e.each(h,function(e){c+=e.getData("dim")});for(var p=0,v=h.length;p>0}));d.addColorStop(0,p),d.addColorStop(1,v),h.fillStyle=d}a&&(h.strokeStyle=a,h.lineWidth=3),h.fillRect(l,c,Math.max(0,o-s),Math.max(0,u-s)),a&&h.strokeRect(f.x,f.y,o,u)},contains:function(e,t){if(this.viz.clickedNode&&!$jit.Graph.Util.isDescendantOf(e,this.viz.clickedNode.id))return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+i/2},t,r,i)}}}),$jit.Icicle.Plot.EdgeTypes=new t({none:e.empty}),b.ForceDirected=new t({getOptions:function(e){var t=this.canvas.getSize(),n=t.width,r=t.height,i=0;this.graph.eachNode(function(e){i++});var s=n*r/i,o=Math.sqrt(s),u=this.config.levelDistance;return{width:n,height:r,tstart:n*.1,nodef:function(e){return s/(e||1)},edgef:function(e){return o*(e-u)}}},compute:function(t,n){var r=e.splat(t||["current","start","end"]),i=this.getOptions();w.compute(this.graph,r,this.config),this.graph.computeLevels(this.root,0,"ignore"),this.graph.eachNode(function(t){e.each(r,function(n){var s=t.getPos(n);s.equals(h.KER)&&(s.x=i.width/5*(Math.random()-.5),s.y=i.height/5*(Math.random()-.5)),t.disp={},e.each(r,function(e){t.disp[e]=p(0,0)})})}),this.computePositions(r,i,n)},computePositions:function(e,t,n){var r=this.config.iterations,i=0,s=this;if(n)(function o(){for(var u=n.iter,a=0;a=r){n.onComplete();return}}n.onStep(Math.round(i/(r-1)*100)),setTimeout(o,1)})();else for(;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.ForceDirected),$jit.TM={};var E=$jit.TM;$jit.TM.$extend=!0,E.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(t){var n={orientation:"h",titleHeight:13,offset:2,levelsToShow:0,constrained:!1,animate:!1,Node:{type:"rectangle",overridable:!0,width:3,height:3,color:"#444"},Label:{textAlign:"center",textBaseline:"top"},Edge:{type:"none"},duration:700,fps:45};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Controller","Tips","NodeStyles","Events","Navigation","Label"),n,t),this.layout.orientation=this.config.orientation;var r=this.config;r.useCanvas?(this.canvas=r.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(r.background&&(r.background=e.merge({type:"Circles"},r.background)),this.canvas=new f(this,r),this.config.labelContainer=(typeof r.injectInto=="string"?r.injectInto:r.injectInto.id)+"-label"),this.graphOptions={complex:!0,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new E.Label[r.Label.type](this),this.fx=new E.Plot(this),this.op=new E.Op(this),this.group=new E.Group(this),this.geom=new E.Geom(this),this.clickedNode=null,this.busy=!1,this.initializeExtras()},refresh:function(){if(this.busy)return;this.busy=!0;var t=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(e.merge(this.config,{modes:["linear","node-property:width:height"],onComplete:function(){t.busy=!1}}));else{var n=this.config.Label.type;if(n!="Native"){var t=this;this.graph.eachNode(function(e){t.labels.hideLabel(e,!1)})}this.busy=!1,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(e){return e.getSubnodes([1,1],"ignore").length==0},enter:function(e){if(this.busy)return;this.busy=!0;var t=this,n=this.config,r=this.graph,i=e,s=this.clickedNode,o={onComplete:function(){n.levelsToShow>0&&t.geom.setRightLevelToShow(e),(n.levelsToShow>0||n.request)&&t.compute(),n.animate?(r.nodeList.setData("alpha",0,"end"),e.eachSubgraph(function(e){e.setData("alpha",1,"end")},"ignore"),t.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){t.clickedNode=i,t.compute("end"),t.clickedNode=s,t.fx.animate({modes:["linear","node-property:width:height"],duration:1e3,onComplete:function(){t.busy=!1,t.clickedNode=i}})}})):(t.busy=!1,t.clickedNode=e,t.refresh())}};n.request?this.requestNodes(i,o):o.onComplete()},out:function(){if(this.busy)return;this.busy=!0,this.events.hoveredNode=!1;var e=this,t=this.config,n=this.graph,r=n.getNode(this.clickedNode&&this.clickedNode.id||this.root).getParents(),i=r[0],s=i,o=this.clickedNode;if(!i){this.busy=!1;return}callback={onComplete:function(){e.clickedNode=i,t.request?e.requestNodes(i,{onComplete:function(){e.compute(),e.plot(),e.busy=!1}}):(e.compute(),e.plot(),e.busy=!1)}},t.levelsToShow>0&&this.geom.setRightLevelToShow(i),t.animate?(this.clickedNode=s,this.compute("end"),this.clickedNode=o,this.fx.animate({modes:["linear","node-property:width:height"],duration:1e3,onComplete:function(){e.clickedNode=s,n.eachNode(function(e){e.setDataset(["current","end"],{alpha:[0,1]})},"ignore"),o.eachSubgraph(function(e){e.setData("alpha",1)},"ignore"),e.fx.animate({duration:500,modes:["node-property:alpha"],onComplete:function(){callback.onComplete()}})}})):callback.onComplete()},requestNodes:function(t,n){var r=e.merge(this.controller,n),i=this.config.levelsToShow;if(r.request){var s=[],o=t._depth;t.eachLevel(0,i,function(e){var t=i-(e._depth-o);e.drawn&&!e.anySubnode()&&t>0&&(s.push(e),e._level=t)}),this.group.requestNodes(s,r)}else r.onComplete()}},E.Op=new t({Implements:d.Op,initialize:function(e){this.viz=e}}),E.Geom=new t({Implements:d.Geom,getRightLevelToShow:function(){return this.viz.config.levelsToShow},setRightLevelToShow:function(e){var t=this.getRightLevelToShow(),n=this.viz.labels;e.eachLevel(0,t+1,function(r){var i=r._depth-e._depth;i>t?(r.drawn=!1,r.exist=!1,r.ignore=!0,n.hideLabel(r,!1)):(r.drawn=!0,r.exist=!0,delete r.ignore)}),e.drawn=!0,delete e.ignore}}),E.Group=new t({initialize:function(e){this.viz=e,this.canvas=e.canvas,this.config=e.config},requestNodes:function(e,t){var n=0,r=e.length,i={},s=function(){t.onComplete()},o=this.viz;r==0&&s();for(var u=0;u>0}));v.addColorStop(0,m),v.addColorStop(1,g),h.fillStyle=v}h.fillRect(p,d,f-o,l-o),c&&(h.save(),h.strokeStyle=c,h.strokeRect(p,d,f-o,l-o),h.restore())}else u>0&&(h.fillRect(a.x+o/2,a.y+o/2,f-o,u-o),c&&(h.save(),h.strokeStyle=c,h.strokeRect(a.x+o/2,a.y+o/2,f-o,l-o),h.restore()))},contains:function(e,t){if(this.viz.clickedNode&&!e.isDescendantOf(this.viz.clickedNode.id)||e.ignore)return!1;var n=e.pos.getc(!0),r=e.getData("width"),i=this.viz.leaf(e),s=i?e.getData("height"):this.config.titleHeight;return this.nodeHelper.rectangle.contains({x:n.x+r/2,y:n.y+s/2},t,r,s)}}}),E.Plot.EdgeTypes=new t({none:e.empty}),E.SliceAndDice=new t({Implements:[y,a,E.Base,b.TM.SliceAndDice]}),E.Squarified=new t({Implements:[y,a,E.Base,b.TM.Squarified]}),E.Strip=new t({Implements:[y,a,E.Base,b.TM.Strip]}),$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=2)return i(s-.01)}return i(.75)},getRadius:function(){var e=this.config.radius;if(e!=="auto")return e;var t=this.canvas.getSize();return Math.min(t.width,t.height)/2},refresh:function(e){e?(this.reposition(),this.graph.eachNode(function(e){e.startPos.rho=e.pos.rho=e.endPos.rho,e.startPos.theta=e.pos.theta=e.endPos.theta})):this.compute(),this.plot()},reposition:function(){this.compute("end");var e=this.graph.getNode(this.root).pos.getc().scale(-1);d.Util.moebiusTransformation(this.graph,[e],["end"],"end","ignore"),this.graph.eachNode(function(e){e.ignore&&(e.endPos.rho=e.pos.rho,e.endPos.theta=e.pos.theta)})},plot:function(){this.fx.plot()},onClick:function(e,t){var n=this.graph.getNode(e).pos.getc(!0);this.move(n,t)},move:function(t,n){var r=p(t.x,t.y);if(this.busy===!1&&r.norm()<1){this.busy=!0;var i=this.graph.getClosestNodeToPos(r),s=this;this.graph.computeLevels(i.id,0),this.controller.onBeforeCompute(i),n=e.merge({onComplete:e.empty},n||{}),this.fx.animate(e.merge({modes:["moebius"],hideLabels:!0},n,{onComplete:function(){s.busy=!1,n.onComplete()}}),r)}}}),$jit.Hypertree.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native,initialize:function(e){this.viz=e},renderLabel:function(e,t,n){var r=e.getCtx(),i=t.pos.getc(!0),s=this.viz.getRadius();r.fillText(t.name,i.x*s,i.y*s)}}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l=this.viz.getRadius(),c={x:Math.round(r.x*u*l+s+f.width/2),y:Math.round(r.y*a*l+o+f.height/2)};e.setAttribute("x",c.x),e.setAttribute("y",c.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l=this.viz.getRadius(),c={x:Math.round(r.x*u*l+s+f.width/2),y:Math.round(r.y*a*l+o+f.height/2)},h=e.style;h.left=c.x+"px",h.top=c.y+"px",h.display=this.fitsInCanvas(c,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.circle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(r,t,n)}},ellipse:{render -:function(e,t){var n=e.pos.getc().$scale(e.scale),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.circle.contains(i,t,n,r)}},square:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.square.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(r,t,n)}},rectangle:{render:function(e,t){var n=this.node,r=e.getData("width"),i=e.getData("height"),s=e.pos.getc();r=n.transform?r*(1-s.squaredNorm()):r,i=n.transform?i*(1-s.squaredNorm()):i,s.$scale(e.scale),r>.2&&i>.2&&this.nodeHelper.rectangle.render("fill",s,r,i,t)},contains:function(e,t){var n=e.getData("width"),r=e.getData("height"),i=e.pos.getc().$scale(e.scale);return this.nodeHelper.square.contains(i,t,n,r)}},triangle:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.triangle.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.triangle.contains(r,t,n)}},star:{render:function(e,t){var n=this.node,r=e.getData("dim"),i=e.pos.getc();r=n.transform?r*(1-i.squaredNorm()):r,i.$scale(e.scale),r>.2&&this.nodeHelper.star.render("fill",i,r,t)},contains:function(e,t){var n=e.getData("dim"),r=e.pos.getc().$scale(e.scale);return this.nodeHelper.star.contains(r,t,n)}}}),n.Plot.EdgeTypes=new t({none:e.empty,line:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.line.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},arrow:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale,s=e.getData("dim"),o=e.data.$direction,u=o&&o.length>1&&o[0]!=e.nodeFrom.id;this.edgeHelper.arrow.render({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},s,u,t)},contains:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.nodeFrom.scale;this.edgeHelper.arrow.contains({x:n.x*i,y:n.y*i},{x:r.x*i,y:r.y*i},t,this.edge.epsilon)}},hyperline:{render:function(e,t){var n=e.nodeFrom.pos.getc(),r=e.nodeTo.pos.getc(),i=this.viz.getRadius();this.edgeHelper.hyperline.render(n,r,i,t)},contains:e.lambda(!1)}})}($jit.Hypertree)})(),function(){window.$jit=function(e){e=e||window;for(var t in $jit)$jit[t].$extend&&(e[t]=$jit[t])},$jit.version="2.0.0b";var e=function(e){return document.getElementById(e)};e.empty=function(){},e.extend=function(e,t){for(var n in t||{})e[n]=t[n];return e},e.lambda=function(e){return typeof e=="function"?e:function(){return e}},e.time=Date.now||function(){return+(new Date)},e.splat=function(t){var n=e.type(t);return n?n!="array"?[t]:t:[]},e.type=function(t){var n=e.type.s.call(t).match(/^\[object\s(.*)\]$/)[1].toLowerCase();return n!="object"?n:t&&t.$$family?t.$$family:t&&t.nodeName&&t.nodeType==1?"element":n},e.type.s=Object.prototype.toString,e.each=function(t,n){var r=e.type(t);if(r=="object")for(var i in t)n(t[i],i);else for(var s=0,o=t.length;s>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, 0.8)",r.strokeStyle="rgba(24,32,46, 1)";var u=25*o.length,a,f=[];for(a=0;at){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),o=s(t.name,30).split("\n"),u;for(u=0;u=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){function r(){return"ontouchstart"in window?1:0}var n={set_width:!1,set_height:!1,horizontalScroll:!1,scrollInertia:550,scrollEasing:"easeOutCirc",mouseWheel:"auto",autoDraggerLength:!0,scrollButtons:{enable:!1,scrollType:"continuous",scrollSpeed:20,scrollAmount:40},advanced:{updateOnBrowserResize:!0,updateOnContentResize:!1,autoExpandHorizontalScroll:!1},callbacks:{onScroll:function(){},onTotalScroll:function(){},onTotalScrollOffset:0}},t=e.extend(!0,n,t);return e(document).data("mCS-is-touch-device",!1),r()&&e(document).data("mCS-is-touch-device",!0),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 i=parseInt(e(document).data("mCustomScrollbar-index"));e(document).data("mCustomScrollbar-index",i+1)}n.wrapInner("
      ").addClass("mCustomScrollbar _mCS_"+e(document).data("mCustomScrollbar-index"));var s=n.children(".mCustomScrollBox");if(t.horizontalScroll){s.addClass("mCSB_horizontal").wrapInner("
      ");var o=s.children(".mCSB_h_wrapper");o.wrapInner("
      ").children(".mCSB_container").css({width:o.children().outerWidth(),position:"relative"}).unwrap()}else s.wrapInner("
      ");var u=s.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device")){u.after("
      ");var a=s.children(".mCSB_scrollTools"),f=a.children(".mCSB_draggerContainer"),l=f.children(".mCSB_dragger");t.horizontalScroll?l.data("minDraggerWidth",l.width()):l.data("minDraggerHeight",l.height()),t.scrollButtons.enable&&(t.horizontalScroll?a.prepend("").append(""):a.prepend("").append("")),s.bind("scroll",function(){s.scrollTop(0).scrollLeft(0)}),n.data({horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:t.scrollEasing,mouseWheel:t.mouseWheel,autoDraggerLength:t.autoDraggerLength,"scrollButtons-enable":t.scrollButtons.enable,"scrollButtons-scrollType":t.scrollButtons.scrollType,"scrollButtons-scrollSpeed":t.scrollButtons.scrollSpeed,"scrollButtons-scrollAmount":t.scrollButtons.scrollAmount,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,"onScroll-Callback":t.callbacks.onScroll,"onTotalScroll-Callback":t.callbacks.onTotalScroll,"onTotalScroll-Offset":t.callbacks.onTotalScrollOffset}).mCustomScrollbar("update");if(t.advanced.updateOnBrowserResize){var h;e(window).resize(function(){h&&clearTimeout(h),h=setTimeout(function(){n.mCustomScrollbar("update")},150)})}}else{var p=navigator.userAgent;if(p.indexOf("Android")!=-1){var v=parseFloat(p.slice(p.indexOf("Android")+8));v<3?m("mCSB_"+e(document).data("mCustomScrollbar-index")):s.css({overflow:"auto","-webkit-overflow-scrolling":"touch"})}else s.css({overflow:"auto","-webkit-overflow-scrolling":"touch"});u.addClass("mCS_no_scrollbar mCS_touch"),n.data({horizontalScroll:t.horizontalScroll,scrollInertia:t.scrollInertia,scrollEasing:t.scrollEasing,autoExpandHorizontalScroll:t.advanced.autoExpandHorizontalScroll,"onScroll-Callback":t.callbacks.onScroll,"onTotalScroll-Callback":t.callbacks.onTotalScroll,"onTotalScroll-Offset":t.callbacks.onTotalScrollOffset}),s.scroll(function(){n.mCustomScrollbar("callbacks",s,u)});function m(e){var t=document.getElementById(e),n=0,r=0;document.getElementById(e).addEventListener("touchstart",function(e){n=this.scrollTop+e.touches[0].pageY,r=this.scrollLeft+e.touches[0].pageX},!1),document.getElementById(e).addEventListener("touchmove",function(e){(this.scrollTopn+5)&&e.preventDefault(),(this.scrollLeftr+5)&&e.preventDefault(),this.scrollTop=n-e.touches[0].pageY,this.scrollLeft=r-e.touches[0].pageX},!1)}}if(t.advanced.updateOnContentResize){var g;if(t.horizontalScroll){var y=u.outerWidth();r()&&s.css({"-webkit-overflow-scrolling":"auto"})}else var y=u.outerHeight();g=setInterval(function(){if(t.horizontalScroll){t.advanced.autoExpandHorizontalScroll&&u.css({position:"absolute",width:"auto"}).wrap("
      ").css({width:u.outerWidth(),position:"relative"}).unwrap();var e=u.outerWidth()}else var e=u.outerHeight();e!=y&&(n.mCustomScrollbar("update"),y=e)},300)}})},update:function(){var t=e(this),n=t.children(".mCustomScrollBox"),r=n.children(".mCSB_container");e(document).data("mCS-is-touch-device")||r.removeClass("mCS_no_scrollbar");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 c=i.children(".mCSB_buttonUp"),h=i.children(".mCSB_buttonDown"),p=n.height(),d=r.outerHeight();if(d>p&&!t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){i.css("display","block");var v=s.height();if(t.data("autoDraggerLength")){var m=Math.round(p/d*v),g=o.data("minDraggerHeight");if(m<=g)o.css({height:g});else if(m>=v-10){var y=v-10;o.css({height:y})}else o.css({height:m});o.children(".mCSB_dragger_bar").css({"line-height":o.height()+"px"})}var w=o.height(),E=(d-p)/(v-w);t.data("scrollAmount",E),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().top));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else if(l>f&&t.data("horizontalScroll")&&!e(document).data("mCS-is-touch-device")){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),t.mCustomScrollbar("scrolling",n,r,s,o,c,h,u,a);var S=Math.abs(Math.round(r.position().left));t.mCustomScrollbar("scrollTo",S,{callback:!1})}else n.unbind("mousewheel"),n.unbind("focusin"),t.data("horizontalScroll")?o.add(r).css("left",0):o.add(r).css("top",0),i.css("display","none"),r.addClass("mCS_no_scrollbar")},scrolling:function(t,n,r,i,s,o,u,a){var f=e(this);if(!i.hasClass("ui-draggable")){if(f.data("horizontalScroll"))var l="x";else var l="y";i.draggable({axis:l,containment:"parent",drag:function(e,t){f.mCustomScrollbar("scroll"),i.addClass("mCSB_dragger_onDrag")},stop:function(e,t){i.removeClass("mCSB_dragger_onDrag")}})}r.unbind("click").bind("click",function(e){if(f.data("horizontalScroll")){var t=e.pageX-r.offset().left;if(ti.position().left+i.width()){var n=t;n>=r.width()-i.width()&&(n=r.width()-i.width()),i.css("left",n),f.mCustomScrollbar("scroll")}}else{var t=e.pageY-r.offset().top;if(ti.position().top+i.height()){var n=t;n>=r.height()-i.height()&&(n=r.height()-i.height()),i.css("top",n),f.mCustomScrollbar("scroll")}}});if(f.data("mouseWheel")){var c=f.data("mouseWheel");if(f.data("mouseWheel")==="auto"){c=8;var h=navigator.userAgent;h.indexOf("Mac")!=-1&&h.indexOf("Safari")!=-1&&h.indexOf("AppleWebKit")!=-1&&h.indexOf("Chrome")==-1&&(c=1)}t.unbind("mousewheel").bind("mousewheel",function(e,t){e.preventDefault();var n=Math.abs(t*c);if(f.data("horizontalScroll")){var s=i.position().left-t*n;i.css("left",s),i.position().left<0&&i.css("left",0);var o=r.width(),u=i.width();i.position().left>o-u&&i.css("left",o-u)}else{var a=i.position().top-t*n;i.css("top",a),i.position().top<0&&i.css("top",0);var l=r.height(),h=i.height();i.position().top>l-h&&i.css("top",l-h)}f.mCustomScrollbar("scroll")})}if(f.data("scrollButtons-enable"))if(f.data("scrollButtons-scrollType")==="pixels"){var p;e.browser.msie&&parseInt(e.browser.version)<9&&f.data("scrollInertia",0),f.data("horizontalScroll")?(a.add(u).unbind("click mousedown mouseup mouseout",g,w),a.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)+f.data("scrollButtons-scrollAmount"),f.mCustomScrollbar("scrollTo",p))}),u.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().left)-f.data("scrollButtons-scrollAmount"),n.position().left>=-f.data("scrollButtons-scrollAmount")&&(p="left"),f.mCustomScrollbar("scrollTo",p))})):(o.add(s).unbind("click mousedown mouseup mouseout",T,C),o.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().top)+f.data("scrollButtons-scrollAmount"),f.mCustomScrollbar("scrollTo",p))}),s.bind("click",function(e){e.preventDefault(),n.is(":animated")||(p=Math.abs(n.position().top)-f.data("scrollButtons-scrollAmount"),n.position().top>=-f.data("scrollButtons-scrollAmount")&&(p="top"),f.mCustomScrollbar("scrollTo",p))}))}else if(f.data("horizontalScroll")){a.add(u).unbind("click mousedown mouseup mouseout",g,w);var d,v=r.width(),m=i.width();a.bind("mousedown",function(e){e.preventDefault();var t=v-m;d=setInterval(function(){var e=Math.abs(i.position().left-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({left:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var g=function(e){e.preventDefault(),clearInterval(d),i.stop()};a.bind("mouseup mouseout",g);var y;u.bind("mousedown",function(e){e.preventDefault();var t=0;y=setInterval(function(){var e=Math.abs(i.position().left-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({left:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var w=function(e){e.preventDefault(),clearInterval(y),i.stop()};u.bind("mouseup mouseout",w)}else{o.add(s).unbind("click mousedown mouseup mouseout",T,C);var E,S=r.height(),x=i.height();o.bind("mousedown",function(e){e.preventDefault();var t=S-x;E=setInterval(function(){var e=Math.abs(i.position().top-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({top:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var T=function(e){e.preventDefault(),clearInterval(E),i.stop()};o.bind("mouseup mouseout",T);var N;s.bind("mousedown",function(e){e.preventDefault();var t=0;N=setInterval(function(){var e=Math.abs(i.position().top-t)*(100/f.data("scrollButtons-scrollSpeed"));i.stop().animate({top:t},e,"linear"),f.mCustomScrollbar("scroll")},20)});var C=function(e){e.preventDefault(),clearInterval(N),i.stop()};s.bind("mouseup mouseout",C)}t.unbind("focusin").bind("focusin",function(){t.scrollTop(0).scrollLeft(0);var s=e(document.activeElement);if(s.is("input,textarea,select,button,a[tabindex],area,object"))if(f.data("horizontalScroll")){var o=n.position().left,u=s.position().left,a=t.width(),l=s.outerWidth();if(!(o+u>=0&&o+u<=a-l)){var c=u/f.data("scrollAmount");c>=r.width()-i.width()&&(c=r.width()-i.width()),i.css("left",c),f.mCustomScrollbar("scroll")}}else{var h=n.position().top,p=s.position().top,d=t.height(),v=s.outerHeight();if(!(h+p>=0&&h+p<=d-v)){var c=p/f.data("scrollAmount");c>=r.height()-i.height()&&(c=r.height()-i.height()),i.css("top",c),f.mCustomScrollbar("scroll")}}})},scroll:function(t){var n=e(this),r=n.find(".mCSB_dragger"),i=n.find(".mCSB_container"),s=n.find(".mCustomScrollBox");if(n.data("horizontalScroll"))var o=r.position().left,u=-o*n.data("scrollAmount"),a=i.position().left,f=Math.round(a-u);else var l=r.position().top,c=-l*n.data("scrollAmount"),h=i.position().top,p=Math.round(h-c);if(e.browser.webkit)var d=(window.outerWidth-8)/window.innerWidth,v=d<.98||d>1.02;n.data("scrollInertia")===0||v?(n.data("horizontalScroll")?i.css("left",u):i.css("top",c),t||n.mCustomScrollbar("callbacks",s,i)):n.data("horizontalScroll")?i.stop().animate({left:"-="+f},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)}):i.stop().animate({top:"-="+p},n.data("scrollInertia"),n.data("scrollEasing"),function(){t||n.mCustomScrollbar("callbacks",s,i)})},scrollTo:function(t,n){var r={moveDragger:!1,callback:!0},n=e.extend(r,n),i=e(this),s,o=i.find(".mCustomScrollBox"),u=o.children(".mCSB_container");if(!e(document).data("mCS-is-touch-device"))var a=i.find(".mCSB_draggerContainer"),f=a.children(".mCSB_dragger");var l;if(t){if(typeof t=="number")n.moveDragger?s=t:(l=t,s=Math.round(l/i.data("scrollAmount")));else if(typeof t=="string"){var c;t==="top"?c=0:t==="bottom"&&!i.data("horizontalScroll")?c=u.outerHeight()-o.height():t==="left"?c=0:t==="right"&&i.data("horizontalScroll")?c=u.outerWidth()-o.width():t==="first"?c=i.find(".mCSB_container").find(":first"):t==="last"?c=i.find(".mCSB_container").find(":last"):c=i.find(t),c.length===1?(i.data("horizontalScroll")?l=c.position().left:l=c.position().top,e(document).data("mCS-is-touch-device")?s=l:s=Math.ceil(l/i.data("scrollAmount"))):s=c}e(document).data("mCS-is-touch-device")?i.data("horizontalScroll")?o.stop().animate({scrollLeft:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):o.stop().animate({scrollTop:s},i.data("scrollInertia"),i.data("scrollEasing"),function(){n.callback&&i.mCustomScrollbar("callbacks",o,u)}):(i.data("horizontalScroll")?(s>=a.width()-f.width()&&(s=a.width()-f.width()),f.css("left",s)):(s>=a.height()-f.height()&&(s=a.height()-f.height()),f.css("top",s)),n.callback?i.mCustomScrollbar("scroll"):i.mCustomScrollbar("scroll",!0))}},callbacks:function(t,n){var r=e(this);if(!e(document).data("mCS-is-touch-device"))if(r.data("horizontalScroll")){var i=Math.round(n.position().left);i<0&&i<=t.width()-n.outerWidth()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var s=Math.round(n.position().top);s<0&&s<=t.height()-n.outerHeight()+r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else if(r.data("horizontalScroll")){var o=Math.round(t.scrollLeft());o>0&&o>=n.outerWidth()-r.width()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}else{var u=Math.round(t.scrollTop());u>0&&u>=n.outerHeight()-r.height()-r.data("onTotalScroll-Offset")?r.data("onTotalScroll-Callback").call():r.data("onScroll-Callback").call()}}};e.fn.mCustomScrollbar=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init.apply(this,arguments);e.error("Method "+n+" does not exist")}}(jQuery),function(e){function t(t){var n=t||window.event,r=[].slice.call(arguments,1),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('