Merge lp:~widelands-dev/widelands-website/update_jvascript into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 470
Proposed branch: lp:~widelands-dev/widelands-website/update_jvascript
Merge into: lp:widelands-website
Diff against target: 37174 lines (+11398/-25416)
41 files modified
media/fancybox/helpers/jquery.fancybox-buttons.css (+0/-85)
media/fancybox/helpers/jquery.fancybox-buttons.js (+0/-115)
media/fancybox/helpers/jquery.fancybox-media.js (+0/-85)
media/fancybox/helpers/jquery.fancybox-thumbs.css (+0/-54)
media/fancybox/helpers/jquery.fancybox-thumbs.js (+0/-157)
media/fancybox/jquery.fancybox.css (+0/-234)
media/fancybox/jquery.fancybox.js (+0/-1463)
media/fancybox/jquery.fancybox.pack.js (+0/-35)
media/js/disableOnSubmit.js (+2/-2)
media/js/encyclopedia.js (+2/-3)
media/js/highcharts_219/adapters/mootools-adapter.js (+0/-12)
media/js/highcharts_219/adapters/mootools-adapter.src.js (+0/-264)
media/js/highcharts_219/adapters/prototype-adapter.js (+0/-15)
media/js/highcharts_219/adapters/prototype-adapter.src.js (+0/-331)
media/js/highcharts_219/highcharts.js (+0/-176)
media/js/highcharts_219/highcharts.src.js (+0/-11454)
media/js/highcharts_219/modules/exporting.js (+0/-24)
media/js/highcharts_219/modules/exporting.src.js (+0/-758)
media/js/highcharts_219/themes/dark-blue.js (+0/-263)
media/js/highcharts_219/themes/dark-green.js (+0/-263)
media/js/highcharts_219/themes/gray.js (+0/-262)
media/js/highcharts_219/themes/grid.js (+0/-96)
media/js/highcharts_v5/highcharts.js (+803/-0)
media/js/hoverIntent.js (+0/-9)
media/js/jqModal.js (+0/-100)
media/js/jquery-3.2.1.js (+10253/-0)
media/js/jquery.js (+0/-8981)
media/js/jquery.sexy-vote.js (+6/-6)
media/js/superfish.js (+0/-121)
media/lightbox_v2/LICENSE (+21/-0)
media/lightbox_v2/css/custom.css (+11/-0)
media/lightbox_v2/css/lightbox.css (+213/-0)
media/lightbox_v2/lightbox-plus-jquery.min.js (+38/-0)
templates/base.html (+3/-1)
templates/navigation.html (+1/-1)
templates/wlhelp/base.html (+0/-1)
templates/wlhelp/buildings.html (+5/-0)
templates/wlpoll/base.html (+1/-1)
templates/wlpoll/poll_detail.html (+2/-1)
templates/wlscreens/index.html (+25/-37)
wlpoll/templatetags/wlpoll_extras.py (+12/-6)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/update_jvascript
Reviewer Review Type Date Requested Status
SirVer testing Approve
kaputtnik (community) Needs Resubmitting
Review via email: mp+331244@code.launchpad.net

Description of the change

Update jquery from version 1.6.2 to 3.2.1

This needs adjustments to some other javascript files. To find incompatible/deprecated commands jquery-migrate is loaded: It shows warnings in the browsers console. It has to be removed in production.

Because Highcharts (used for polls) didn't work with the new jquery library, it is now updated to version 5, adjusted and i did some small beautification (e.g. labels are not in one row anymore like here for the left label: https://wl.widelands.org/poll/12/).
Highcharts throws an error shown in browsers console, but it works. The description of the error: https://www.highcharts.com/errors/16 Don't know how to fix this...

Deleted some js files which i believe were forgotten to remove in the past.

I am busy today and tomorrow, but next week i have a lot of time.

To post a comment you must log in.
Revision history for this message
kaputtnik (franku) wrote :

I forgot to check wlscreens and fancybox.js

review: Needs Fixing
471. By kaputtnik

updated fancybox to version 3; not terady yet

472. By kaputtnik

removed fancybox instead added lightbox; added forgotten highcharts

473. By kaputtnik

little fine tuning

Revision history for this message
kaputtnik (franku) wrote :

This should work now and i have started alpha for testing. Things you could test:

- Rating a map
- Showing Polls
- Viewing screenshots
- Preview posts

review: Needs Resubmitting
Revision history for this message
SirVer (sirver) wrote :

This is not reviable - too many changed lines.

I clicked around the alphe page and tested all the things you asked for. No issues. I suggest rolling this out and looking what breaks.

Revision history for this message
SirVer (sirver) :
review: Approve (testing)
Revision history for this message
kaputtnik (franku) wrote :

Thanks :-)

I am not fully satisfied with the border if a single screenshot is shown, but this could be changed later on.

Merged and deployed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory 'media/fancybox'
=== removed file 'media/fancybox/blank.gif'
0Binary files media/fancybox/blank.gif 2012-04-24 13:30:24 +0000 and media/fancybox/blank.gif 1970-01-01 00:00:00 +0000 differ0Binary files media/fancybox/blank.gif 2012-04-24 13:30:24 +0000 and media/fancybox/blank.gif 1970-01-01 00:00:00 +0000 differ
=== removed file 'media/fancybox/fancybox_loading.gif'
1Binary files media/fancybox/fancybox_loading.gif 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_loading.gif 1970-01-01 00:00:00 +0000 differ1Binary files media/fancybox/fancybox_loading.gif 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_loading.gif 1970-01-01 00:00:00 +0000 differ
=== removed file 'media/fancybox/fancybox_sprite.png'
2Binary files media/fancybox/fancybox_sprite.png 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_sprite.png 1970-01-01 00:00:00 +0000 differ2Binary files media/fancybox/fancybox_sprite.png 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_sprite.png 1970-01-01 00:00:00 +0000 differ
=== removed directory 'media/fancybox/helpers'
=== removed file 'media/fancybox/helpers/fancybox_buttons.png'
3Binary files media/fancybox/helpers/fancybox_buttons.png 2012-04-24 13:30:24 +0000 and media/fancybox/helpers/fancybox_buttons.png 1970-01-01 00:00:00 +0000 differ3Binary files media/fancybox/helpers/fancybox_buttons.png 2012-04-24 13:30:24 +0000 and media/fancybox/helpers/fancybox_buttons.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'media/fancybox/helpers/jquery.fancybox-buttons.css'
--- media/fancybox/helpers/jquery.fancybox-buttons.css 2012-04-24 13:30:24 +0000
+++ media/fancybox/helpers/jquery.fancybox-buttons.css 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1#fancybox-buttons {
2 position: fixed;
3 left: 0;
4 width: 100%;
5 z-index: 8050;
6}
7
8#fancybox-buttons.top {
9 top: 10px;
10}
11
12#fancybox-buttons.bottom {
13 bottom: 10px;
14}
15
16#fancybox-buttons ul {
17 display: block;
18 width: 170px;
19 height: 30px;
20 margin: 0 auto;
21 padding: 0;
22 list-style: none;
23 background: #111;
24 -webkit-box-shadow: 0 1px 3px #000,0 0 0 1px rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.05);
25 -moz-box-shadow: 0 1px 3px #000,0 0 0 1px rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.05);
26 background: #111 -webkit-gradient(linear,0% 0%,0% 100%,from(rgba(255,255,255,.2)),color-stop(.5,rgba(255,255,255,.15)),color-stop(.5,rgba(255,255,255,.1)),to(rgba(255,255,255,.15)));
27 background: #111 -moz-linear-gradient(top,rgba(255,255,255,.2) 0%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.1) 50%,rgba(255,255,255,.15) 100%);
28 border-radius: 3px;
29}
30
31#fancybox-buttons ul li {
32 float: left;
33 margin: 0;
34 padding: 0;
35}
36
37#fancybox-buttons a {
38 display: block;
39 width: 30px;
40 height: 30px;
41 text-indent: -9999px;
42 background-image: url('fancybox_buttons.png');
43 background-repeat: no-repeat;
44 outline: none;
45}
46
47#fancybox-buttons a.btnPrev {
48 width: 32px;
49 background-position: 6px 0;
50}
51
52#fancybox-buttons a.btnNext {
53 background-position: -33px 0;
54 border-right: 1px solid #3e3e3e;
55}
56
57#fancybox-buttons a.btnPlay {
58 background-position: 0 -30px;
59}
60
61#fancybox-buttons a.btnPlayOn {
62 background-position: -30px -30px;
63}
64
65#fancybox-buttons a.btnToggle {
66 background-position: 3px -60px;
67 border-left: 1px solid #111;
68 border-right: 1px solid #3e3e3e;
69 width: 35px
70}
71
72#fancybox-buttons a.btnToggleOn {
73 background-position: -27px -60px;
74}
75
76#fancybox-buttons a.btnClose {
77 border-left: 1px solid #111;
78 width: 38px;
79 background-position: -57px 0px;
80}
81
82#fancybox-buttons a.btnDisabled {
83 opacity : 0.5;
84 cursor: default;
85}
86\ No newline at end of file0\ No newline at end of file
871
=== removed file 'media/fancybox/helpers/jquery.fancybox-buttons.js'
--- media/fancybox/helpers/jquery.fancybox-buttons.js 2012-04-24 13:30:24 +0000
+++ media/fancybox/helpers/jquery.fancybox-buttons.js 1970-01-01 00:00:00 +0000
@@ -1,115 +0,0 @@
1 /*!
2 * Buttons helper for fancyBox
3 * version: 1.0.2
4 * @requires fancyBox v2.0 or later
5 *
6 * Usage:
7 * $(".fancybox").fancybox({
8 * buttons: {
9 * position : 'top'
10 * }
11 * });
12 *
13 * Options:
14 * tpl - HTML template
15 * position - 'top' or 'bottom'
16 *
17 */
18(function ($) {
19 //Shortcut for fancyBox object
20 var F = $.fancybox;
21
22 //Add helper object
23 F.helpers.buttons = {
24 tpl: '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>',
25 list: null,
26 buttons: {},
27
28 update: function () {
29 var toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
30
31 //Size toggle button
32 if (F.current.canShrink) {
33 toggle.addClass('btnToggleOn');
34
35 } else if (!F.current.canExpand) {
36 toggle.addClass('btnDisabled');
37 }
38 },
39
40 beforeLoad: function (opts) {
41 //Remove self if gallery do not have at least two items
42 if (F.group.length < 2) {
43 F.coming.helpers.buttons = false;
44 F.coming.closeBtn = true;
45
46 return;
47 }
48
49 //Increase top margin to give space for buttons
50 F.coming.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
51 },
52
53 onPlayStart: function () {
54 if (this.list) {
55 this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
56 }
57 },
58
59 onPlayEnd: function () {
60 if (this.list) {
61 this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
62 }
63 },
64
65 afterShow: function (opts) {
66 var buttons;
67
68 if (!this.list) {
69 this.list = $(opts.tpl || this.tpl).addClass(opts.position || 'top').appendTo('body');
70
71 this.buttons = {
72 prev : this.list.find('.btnPrev').click( F.prev ),
73 next : this.list.find('.btnNext').click( F.next ),
74 play : this.list.find('.btnPlay').click( F.play ),
75 toggle : this.list.find('.btnToggle').click( F.toggle )
76 }
77 }
78
79 buttons = this.buttons;
80
81 //Prev
82 if (F.current.index > 0 || F.current.loop) {
83 buttons.prev.removeClass('btnDisabled');
84 } else {
85 buttons.prev.addClass('btnDisabled');
86 }
87
88 //Next / Play
89 if (F.current.loop || F.current.index < F.group.length - 1) {
90 buttons.next.removeClass('btnDisabled');
91 buttons.play.removeClass('btnDisabled');
92
93 } else {
94 buttons.next.addClass('btnDisabled');
95 buttons.play.addClass('btnDisabled');
96 }
97
98 this.update();
99 },
100
101 onUpdate: function () {
102 this.update();
103 },
104
105 beforeClose: function () {
106 if (this.list) {
107 this.list.remove();
108 }
109
110 this.list = null;
111 this.buttons = {};
112 }
113 };
114
115}(jQuery));
116\ No newline at end of file0\ No newline at end of file
1171
=== removed file 'media/fancybox/helpers/jquery.fancybox-media.js'
--- media/fancybox/helpers/jquery.fancybox-media.js 2012-04-24 13:30:24 +0000
+++ media/fancybox/helpers/jquery.fancybox-media.js 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1 /*!
2 * Media helper for fancyBox
3 * version: 1.0.0
4 * @requires fancyBox v2.0 or later
5 *
6 * Usage:
7 * $(".fancybox").fancybox({
8 * media: {}
9 * });
10 *
11 * Supports:
12 * Youtube
13 * http://www.youtube.com/watch?v=opj24KnzrWo
14 * http://youtu.be/opj24KnzrWo
15 * Vimeo
16 * http://vimeo.com/25634903
17 * Metacafe
18 * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
19 * http://www.metacafe.com/watch/7635964/
20 * Dailymotion
21 * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
22 * Twitvid
23 * http://twitvid.com/QY7MD
24 * Twitpic
25 * http://twitpic.com/7p93st
26 * Instagram
27 * http://instagr.am/p/IejkuUGxQn/
28 * http://instagram.com/p/IejkuUGxQn/
29 * Google maps
30 * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
31 * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
32 * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
33 */
34(function ($) {
35 //Shortcut for fancyBox object
36 var F = $.fancybox;
37
38 //Add helper object
39 F.helpers.media = {
40 beforeLoad : function(opts, obj) {
41 var href = obj.href || '',
42 type = false,
43 rez;
44
45 if ((rez = href.match(/(youtube\.com|youtu\.be)\/(v\/|u\/|embed\/|watch\?v=)?([^#\&\?]*).*/i))) {
46 href = '//www.youtube.com/embed/' + rez[3] + '?autoplay=1&autohide=1&fs=1&rel=0&enablejsapi=1';
47 type = 'iframe';
48
49 } else if ((rez = href.match(/vimeo.com\/(\d+)\/?(.*)/))) {
50 href = '//player.vimeo.com/video/' + rez[1] + '?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
51 type = 'iframe';
52
53 } else if ((rez = href.match(/metacafe.com\/watch\/(\d+)\/?(.*)/))) {
54 href = '//www.metacafe.com/fplayer/' + rez[1] + '/.swf?playerVars=autoPlay=yes';
55 type = 'swf';
56
57 } else if ((rez = href.match(/dailymotion.com\/video\/(.*)\/?(.*)/))) {
58 href = '//www.dailymotion.com/swf/video/' + rez[1] + '?additionalInfos=0&autoStart=1';
59 type = 'swf';
60
61 } else if ((rez = href.match(/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i))) {
62 href = '//www.twitvid.com/embed.php?autoplay=0&guid=' + rez[1];
63 type = 'iframe';
64
65 } else if ((rez = href.match(/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i))) {
66 href = '//twitpic.com/show/full/' + rez[1];
67 type = 'image';
68
69 } else if ((rez = href.match(/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i))) {
70 href = '//' + rez[1] + '/p/' + rez[2] + '/media/?size=l';
71 type = 'image';
72
73 } else if ((rez = href.match(/maps\.google\.com\/(\?ll=|maps\/?\?q=)(.*)/i))) {
74 href = '//maps.google.com/' + rez[1] + '' + rez[2] + '&output=' + (rez[2].indexOf('layer=c') ? 'svembed' : 'embed');
75 type = 'iframe';
76 }
77
78 if (type) {
79 obj.href = href;
80 obj.type = type;
81 }
82 }
83 }
84
85}(jQuery));
86\ No newline at end of file0\ No newline at end of file
871
=== removed file 'media/fancybox/helpers/jquery.fancybox-thumbs.css'
--- media/fancybox/helpers/jquery.fancybox-thumbs.css 2012-04-24 13:30:24 +0000
+++ media/fancybox/helpers/jquery.fancybox-thumbs.css 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1#fancybox-thumbs {
2 position: fixed;
3 left: 0;
4 width: 100%;
5 overflow: hidden;
6 z-index: 8050;
7}
8
9#fancybox-thumbs.bottom {
10 bottom: 2px;
11}
12
13#fancybox-thumbs.top {
14 top: 2px;
15}
16
17#fancybox-thumbs ul {
18 position: relative;
19 list-style: none;
20 margin: 0;
21 padding: 0;
22}
23
24#fancybox-thumbs ul li {
25 float: left;
26 padding: 1px;
27 opacity: 0.5;
28}
29
30#fancybox-thumbs ul li.active {
31 opacity: 0.75;
32 padding: 0;
33 border: 1px solid #fff;
34}
35
36#fancybox-thumbs ul li:hover {
37 opacity: 1;
38}
39
40#fancybox-thumbs ul li a {
41 display: block;
42 position: relative;
43 overflow: hidden;
44 border: 1px solid #222;
45 background: #111;
46 outline: none;
47}
48
49#fancybox-thumbs ul li img {
50 display: block;
51 position: relative;
52 border: 0;
53 padding: 0;
54}
55\ No newline at end of file0\ No newline at end of file
561
=== removed file 'media/fancybox/helpers/jquery.fancybox-thumbs.js'
--- media/fancybox/helpers/jquery.fancybox-thumbs.js 2012-04-24 13:30:24 +0000
+++ media/fancybox/helpers/jquery.fancybox-thumbs.js 1970-01-01 00:00:00 +0000
@@ -1,157 +0,0 @@
1 /*!
2 * Thumbnail helper for fancyBox
3 * version: 1.0.4
4 * @requires fancyBox v2.0 or later
5 *
6 * Usage:
7 * $(".fancybox").fancybox({
8 * thumbs: {
9 * width : 50,
10 * height : 50
11 * }
12 * });
13 *
14 * Options:
15 * width - thumbnail width
16 * height - thumbnail height
17 * source - function to obtain the URL of the thumbnail image
18 * position - 'top' or 'bottom'
19 *
20 */
21(function ($) {
22 //Shortcut for fancyBox object
23 var F = $.fancybox;
24
25 //Add helper object
26 F.helpers.thumbs = {
27 wrap: null,
28 list: null,
29 width: 0,
30
31 //Default function to obtain the URL of the thumbnail image
32 source: function (el) {
33 var img;
34
35 if ($.type(el) === 'string') {
36 return el;
37 }
38
39 img = $(el).find('img');
40
41 return img.length ? img.attr('src') : el.href;
42 },
43
44 init: function (opts) {
45 var that = this,
46 list,
47 thumbWidth = opts.width || 50,
48 thumbHeight = opts.height || 50,
49 thumbSource = opts.source || this.source;
50
51 //Build list structure
52 list = '';
53
54 for (var n = 0; n < F.group.length; n++) {
55 list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
56 }
57
58 this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position || 'bottom').appendTo('body');
59 this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
60
61 //Load each thumbnail
62 $.each(F.group, function (i) {
63 $("<img />").load(function () {
64 var width = this.width,
65 height = this.height,
66 widthRatio, heightRatio, parent;
67
68 if (!that.list || !width || !height) {
69 return;
70 }
71
72 //Calculate thumbnail width/height and center it
73 widthRatio = width / thumbWidth;
74 heightRatio = height / thumbHeight;
75 parent = that.list.children().eq(i).find('a');
76
77 if (widthRatio >= 1 && heightRatio >= 1) {
78 if (widthRatio > heightRatio) {
79 width = Math.floor(width / heightRatio);
80 height = thumbHeight;
81
82 } else {
83 width = thumbWidth;
84 height = Math.floor(height / widthRatio);
85 }
86 }
87
88 $(this).css({
89 width: width,
90 height: height,
91 top: Math.floor(thumbHeight / 2 - height / 2),
92 left: Math.floor(thumbWidth / 2 - width / 2)
93 });
94
95 parent.width(thumbWidth).height(thumbHeight);
96
97 $(this).hide().appendTo(parent).fadeIn(300);
98
99 }).attr('src', thumbSource( F.group[ i ] ));
100 });
101
102 //Set initial width
103 this.width = this.list.children().eq(0).outerWidth(true);
104
105 this.list.width(this.width * (F.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5)));
106 },
107
108 //Center list
109 update: function (opts) {
110 if (this.list) {
111 this.list.stop(true).animate({
112 'left': Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5))
113 }, 150);
114 }
115 },
116
117 beforeLoad: function (opts) {
118 //Remove self if gallery do not have at least two items
119 if (F.group.length < 2) {
120 F.coming.helpers.thumbs = false;
121
122 return;
123 }
124
125 //Increase bottom margin to give space for thumbs
126 F.coming.margin[ opts.position === 'top' ? 0 : 2 ] = opts.height + 30;
127 },
128
129 afterShow: function (opts) {
130 //Check if exists and create or update list
131 if (this.list) {
132 this.update(opts);
133
134 } else {
135 this.init(opts);
136 }
137
138 //Set active element
139 this.list.children().removeClass('active').eq(F.current.index).addClass('active');
140 },
141
142 onUpdate: function () {
143 this.update();
144 },
145
146 beforeClose: function () {
147 if (this.wrap) {
148 this.wrap.remove();
149 }
150
151 this.wrap = null;
152 this.list = null;
153 this.width = 0;
154 }
155 }
156
157}(jQuery));
158\ No newline at end of file0\ No newline at end of file
1591
=== removed file 'media/fancybox/jquery.fancybox.css'
--- media/fancybox/jquery.fancybox.css 2012-04-24 13:30:24 +0000
+++ media/fancybox/jquery.fancybox.css 1970-01-01 00:00:00 +0000
@@ -1,234 +0,0 @@
1/*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */
2.fancybox-tmp iframe, .fancybox-tmp object {
3 vertical-align: top;
4 padding: 0;
5 margin: 0;
6}
7
8.fancybox-wrap {
9 position: absolute;
10 top: 0;
11 left: 0;
12 z-index: 8020;
13}
14
15.fancybox-skin {
16 position: relative;
17 padding: 0;
18 margin: 0;
19 background: #f9f9f9;
20 color: #444;
21 text-shadow: none;
22 -webkit-border-radius: 4px;
23 -moz-border-radius: 4px;
24 border-radius: 4px;
25}
26
27.fancybox-opened {
28 z-index: 8030;
29}
30
31.fancybox-opened .fancybox-skin {
32 -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
33 -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
34 box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
35}
36
37.fancybox-outer, .fancybox-inner {
38 padding: 0;
39 margin: 0;
40 position: relative;
41 outline: none;
42}
43
44.fancybox-inner {
45 overflow: hidden;
46}
47
48.fancybox-type-iframe .fancybox-inner {
49 -webkit-overflow-scrolling: touch;
50}
51
52.fancybox-error {
53 color: #444;
54 font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
55 margin: 0;
56 padding: 10px;
57}
58
59.fancybox-image, .fancybox-iframe {
60 display: block;
61 width: 100%;
62 height: 100%;
63 border: 0;
64 padding: 0;
65 margin: 0;
66 vertical-align: top;
67}
68
69.fancybox-image {
70 max-width: 100%;
71 max-height: 100%;
72}
73
74#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
75 background-image: url('fancybox_sprite.png');
76}
77
78#fancybox-loading {
79 position: fixed;
80 top: 50%;
81 left: 50%;
82 margin-top: -22px;
83 margin-left: -22px;
84 background-position: 0 -108px;
85 opacity: 0.8;
86 cursor: pointer;
87 z-index: 8020;
88}
89
90#fancybox-loading div {
91 width: 44px;
92 height: 44px;
93 background: url('fancybox_loading.gif') center center no-repeat;
94}
95
96.fancybox-close {
97 position: absolute;
98 top: -18px;
99 right: -18px;
100 width: 36px;
101 height: 36px;
102 cursor: pointer;
103 z-index: 8040;
104}
105
106.fancybox-nav {
107 position: absolute;
108 top: 0;
109 width: 40%;
110 height: 100%;
111 cursor: pointer;
112 background: transparent url('blank.gif'); /* helps IE */
113 -webkit-tap-highlight-color: rgba(0,0,0,0);
114 z-index: 8040;
115}
116
117.fancybox-prev {
118 left: 0;
119}
120
121.fancybox-next {
122 right: 0;
123}
124
125.fancybox-nav span {
126 position: absolute;
127 top: 50%;
128 width: 36px;
129 height: 34px;
130 margin-top: -18px;
131 cursor: pointer;
132 z-index: 8040;
133 visibility: hidden;
134}
135
136.fancybox-prev span {
137 left: 20px;
138 background-position: 0 -36px;
139}
140
141.fancybox-next span {
142 right: 20px;
143 background-position: 0 -72px;
144}
145
146.fancybox-nav:hover span {
147 visibility: visible;
148}
149
150.fancybox-tmp {
151 position: absolute;
152 top: -9999px;
153 left: -9999px;
154 padding: 0;
155 overflow: visible;
156 visibility: hidden;
157}
158
159/* Overlay helper */
160
161#fancybox-overlay {
162 position: absolute;
163 top: 0;
164 left: 0;
165 overflow: hidden;
166 display: none;
167 z-index: 8010;
168 background: #000;
169}
170
171#fancybox-overlay.overlay-fixed {
172 position: fixed;
173 bottom: 0;
174 right: 0;
175}
176
177/* Title helper */
178
179.fancybox-title {
180 visibility: hidden;
181 font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
182 position: relative;
183 text-shadow: none;
184 z-index: 8050;
185}
186
187.fancybox-opened .fancybox-title {
188 visibility: visible;
189}
190
191.fancybox-title-float-wrap {
192 position: absolute;
193 bottom: 0;
194 right: 50%;
195 margin-bottom: -35px;
196 z-index: 8030;
197 text-align: center;
198}
199
200.fancybox-title-float-wrap .child {
201 display: inline-block;
202 margin-right: -100%;
203 padding: 2px 20px;
204 background: transparent; /* Fallback for web browsers that doesn't support RGBa */
205 background: rgba(0, 0, 0, 0.8);
206 -webkit-border-radius: 15px;
207 -moz-border-radius: 15px;
208 border-radius: 15px;
209 text-shadow: 0 1px 2px #222;
210 color: #FFF;
211 font-weight: bold;
212 line-height: 24px;
213 white-space: nowrap;
214}
215
216.fancybox-title-outside-wrap {
217 position: relative;
218 margin-top: 10px;
219 color: #fff;
220}
221
222.fancybox-title-inside-wrap {
223 margin-top: 10px;
224}
225
226.fancybox-title-over-wrap {
227 position: absolute;
228 bottom: 0;
229 left: 0;
230 color: #fff;
231 padding: 10px;
232 background: #000;
233 background: rgba(0, 0, 0, .8);
234}
235\ No newline at end of file0\ No newline at end of file
2361
=== removed file 'media/fancybox/jquery.fancybox.js'
--- media/fancybox/jquery.fancybox.js 2012-04-24 13:30:24 +0000
+++ media/fancybox/jquery.fancybox.js 1970-01-01 00:00:00 +0000
@@ -1,1463 +0,0 @@
1/*!
2 * fancyBox - jQuery Plugin
3 * version: 2.0.6 (16/04/2012)
4 * @requires jQuery v1.6 or later
5 *
6 * Examples at http://fancyapps.com/fancybox/
7 * License: www.fancyapps.com/fancybox/#license
8 *
9 * Copyright 2012 Janis Skarnelis - janis@fancyapps.com
10 *
11 */
12
13(function (window, document, $, undefined) {
14 "use strict";
15
16 var W = $(window),
17 D = $(document),
18 F = $.fancybox = function () {
19 F.open.apply( this, arguments );
20 },
21 didResize = false,
22 resizeTimer = null,
23 isTouch = document.createTouch !== undefined,
24 isString = function(str) {
25 return $.type(str) === "string";
26 },
27 isPercentage = function(str) {
28 return isString(str) && str.indexOf('%') > 0;
29 },
30 getValue = function(value, dim) {
31 if (dim && isPercentage(value)) {
32 value = F.getViewport()[ dim ] / 100 * parseInt(value, 10);
33 }
34
35 return Math.round(value) + 'px';
36 };
37
38 $.extend(F, {
39 // The current version of fancyBox
40 version: '2.0.5',
41
42 defaults: {
43 padding: 15,
44 margin: 20,
45
46 width: 800,
47 height: 600,
48 minWidth: 100,
49 minHeight: 100,
50 maxWidth: 9999,
51 maxHeight: 9999,
52
53 autoSize: true,
54 autoResize: !isTouch,
55 autoCenter : !isTouch,
56 fitToView: true,
57 aspectRatio: false,
58 topRatio: 0.5,
59
60 fixed: false,
61 scrolling: 'auto', // 'auto', 'yes' or 'no'
62 wrapCSS: '',
63
64 arrows: true,
65 closeBtn: true,
66 closeClick: false,
67 nextClick : false,
68 mouseWheel: true,
69 autoPlay: false,
70 playSpeed: 3000,
71 preload : 3,
72
73 modal: false,
74 loop: true,
75 ajax: { dataType: 'html', headers: { 'X-fancyBox': true } },
76 keys: {
77 next: [13, 32, 34, 39, 40], // enter, space, page down, right arrow, down arrow
78 prev: [8, 33, 37, 38], // backspace, page up, left arrow, up arrow
79 close: [27] // escape key
80 },
81
82 // Override some properties
83 index: 0,
84 type: null,
85 href: null,
86 content: null,
87 title: null,
88
89 // HTML templates
90 tpl: {
91 wrap: '<div class="fancybox-wrap"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
92 image: '<img class="fancybox-image" src="{href}" alt="" />',
93 iframe: '<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0"' + ($.browser.msie ? ' allowtransparency="true"' : '') + '></iframe>',
94 swf: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',
95 error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
96 closeBtn: '<div title="Close" class="fancybox-item fancybox-close"></div>',
97 next: '<a title="Next" class="fancybox-nav fancybox-next"><span></span></a>',
98 prev: '<a title="Previous" class="fancybox-nav fancybox-prev"><span></span></a>'
99 },
100
101 // Properties for each animation type
102 // Opening fancyBox
103 openEffect: 'fade', // 'elastic', 'fade' or 'none'
104 openSpeed: 300,
105 openEasing: 'swing',
106 openOpacity: true,
107 openMethod: 'zoomIn',
108
109 // Closing fancyBox
110 closeEffect: 'fade', // 'elastic', 'fade' or 'none'
111 closeSpeed: 300,
112 closeEasing: 'swing',
113 closeOpacity: true,
114 closeMethod: 'zoomOut',
115
116 // Changing next gallery item
117 nextEffect: 'elastic', // 'elastic', 'fade' or 'none'
118 nextSpeed: 300,
119 nextEasing: 'swing',
120 nextMethod: 'changeIn',
121
122 // Changing previous gallery item
123 prevEffect: 'elastic', // 'elastic', 'fade' or 'none'
124 prevSpeed: 300,
125 prevEasing: 'swing',
126 prevMethod: 'changeOut',
127
128 // Enabled helpers
129 helpers: {
130 overlay: {
131 speedIn: 0,
132 speedOut: 300,
133 opacity: 0.8,
134 css: {
135 cursor: 'pointer'
136 },
137 closeClick: true
138 },
139 title: {
140 type: 'float' // 'float', 'inside', 'outside' or 'over'
141 }
142 },
143
144 // Callbacks
145 onCancel: $.noop, // If canceling
146 beforeLoad: $.noop, // Before loading
147 afterLoad: $.noop, // After loading
148 beforeShow: $.noop, // Before changing in current item
149 afterShow: $.noop, // After opening
150 beforeClose: $.noop, // Before closing
151 afterClose: $.noop // After closing
152 },
153
154 //Current state
155 group: {}, // Selected group
156 opts: {}, // Group options
157 coming: null, // Element being loaded
158 current: null, // Currently loaded element
159 isOpen: false, // Is currently open
160 isOpened: false, // Have been fully opened at least once
161 wrap: null,
162 skin: null,
163 outer: null,
164 inner: null,
165
166 player: {
167 timer: null,
168 isActive: false
169 },
170
171 // Loaders
172 ajaxLoad: null,
173 imgPreload: null,
174
175 // Some collections
176 transitions: {},
177 helpers: {},
178
179 /*
180 * Static methods
181 */
182
183 open: function (group, opts) {
184 //Kill existing instances
185 F.close(true);
186
187 //Normalize group
188 if (group && !$.isArray(group)) {
189 group = group instanceof $ ? $(group).get() : [group];
190 }
191
192 F.isActive = true;
193
194 //Extend the defaults
195 F.opts = $.extend(true, {}, F.defaults, opts);
196
197 //All options are merged recursive except keys
198 if ($.isPlainObject(opts) && opts.keys !== undefined) {
199 F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
200 }
201
202 F.group = group;
203
204 F._start(F.opts.index || 0);
205 },
206
207 cancel: function () {
208 if (F.coming && false === F.trigger('onCancel')) {
209 return;
210 }
211
212 F.coming = null;
213
214 F.hideLoading();
215
216 if (F.ajaxLoad) {
217 F.ajaxLoad.abort();
218 }
219
220 F.ajaxLoad = null;
221
222 if (F.imgPreload) {
223 F.imgPreload.onload = F.imgPreload.onabort = F.imgPreload.onerror = null;
224 }
225 },
226
227 close: function (a) {
228 F.cancel();
229
230 if (!F.current || false === F.trigger('beforeClose')) {
231 return;
232 }
233
234 F.unbindEvents();
235
236 //If forced or is still opening then remove immediately
237 if (!F.isOpen || (a && a[0] === true)) {
238 $('.fancybox-wrap').stop().trigger('onReset').remove();
239
240 F._afterZoomOut();
241
242 } else {
243 F.isOpen = F.isOpened = false;
244
245 $('.fancybox-item, .fancybox-nav').remove();
246
247 F.wrap.stop(true).removeClass('fancybox-opened');
248 F.inner.css('overflow', 'hidden');
249
250 F.transitions[F.current.closeMethod]();
251 }
252 },
253
254 // Start/stop slideshow
255 play: function (a) {
256 var clear = function () {
257 clearTimeout(F.player.timer);
258 },
259 set = function () {
260 clear();
261
262 if (F.current && F.player.isActive) {
263 F.player.timer = setTimeout(F.next, F.current.playSpeed);
264 }
265 },
266 stop = function () {
267 clear();
268
269 $('body').unbind('.player');
270
271 F.player.isActive = false;
272
273 F.trigger('onPlayEnd');
274 },
275 start = function () {
276 if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
277 F.player.isActive = true;
278
279 $('body').bind({
280 'afterShow.player onUpdate.player': set,
281 'onCancel.player beforeClose.player': stop,
282 'beforeLoad.player': clear
283 });
284
285 set();
286
287 F.trigger('onPlayStart');
288 }
289 };
290
291 if (F.player.isActive || (a && a[0] === false)) {
292 stop();
293 } else {
294 start();
295 }
296 },
297
298 next: function () {
299 if (F.current) {
300 F.jumpto(F.current.index + 1);
301 }
302 },
303
304 prev: function () {
305 if (F.current) {
306 F.jumpto(F.current.index - 1);
307 }
308 },
309
310 jumpto: function (index) {
311 if (!F.current) {
312 return;
313 }
314
315 index = parseInt(index, 10);
316
317 if (F.group.length > 1 && F.current.loop) {
318 if (index >= F.group.length) {
319 index = 0;
320
321 } else if (index < 0) {
322 index = F.group.length - 1;
323 }
324 }
325
326 if (F.group[index] !== undefined) {
327 F.cancel();
328
329 F._start(index);
330 }
331 },
332
333 reposition: function (e, onlyAbsolute) {
334 var pos;
335
336 if (F.isOpen) {
337 pos = F._getPosition(onlyAbsolute);
338
339 if (e && e.type === 'scroll') {
340 delete pos.position;
341
342 F.wrap.stop(true, true).animate(pos, 200);
343
344 } else {
345 F.wrap.css(pos);
346 }
347 }
348 },
349
350 update: function (e) {
351 if (!F.isOpen) {
352 return;
353 }
354
355 // Run this code after a delay for better performance
356 if (!didResize) {
357 resizeTimer = setTimeout(function () {
358 var current = F.current, anyway = !e || (e && e.type === 'orientationchange');
359
360 if (didResize) {
361 didResize = false;
362
363 if (!current) {
364 return;
365 }
366
367 if ((!e || e.type !== 'scroll') || anyway) {
368 if (current.autoSize && current.type !== 'iframe') {
369 F.inner.height('auto');
370 current.height = F.inner.height();
371 }
372
373 if (current.autoResize || anyway) {
374 F._setDimension();
375 }
376
377 if (current.canGrow && current.type !== 'iframe') {
378 F.inner.height('auto');
379 }
380 }
381
382 if (current.autoCenter || anyway) {
383 F.reposition(e);
384 }
385
386 F.trigger('onUpdate');
387 }
388 }, 200);
389 }
390
391 didResize = true;
392 },
393
394 toggle: function () {
395 if (F.isOpen) {
396 F.current.fitToView = !F.current.fitToView;
397
398 F.update();
399 }
400 },
401
402 hideLoading: function () {
403 D.unbind('keypress.fb');
404
405 $('#fancybox-loading').remove();
406 },
407
408 showLoading: function () {
409 F.hideLoading();
410
411 //If user will press the escape-button, the request will be canceled
412 D.bind('keypress.fb', function(e) {
413 if (e.keyCode === 27) {
414 e.preventDefault();
415 F.cancel();
416 }
417 });
418
419 $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
420 },
421
422 getViewport: function () {
423 // See http://bugs.jquery.com/ticket/6724
424 return {
425 x: W.scrollLeft(),
426 y: W.scrollTop(),
427 w: isTouch && window.innerWidth ? window.innerWidth : W.width(),
428 h: isTouch && window.innerHeight ? window.innerHeight : W.height()
429 };
430 },
431
432 // Unbind the keyboard / clicking actions
433 unbindEvents: function () {
434 if (F.wrap) {
435 F.wrap.unbind('.fb');
436 }
437
438 D.unbind('.fb');
439 W.unbind('.fb');
440 },
441
442 bindEvents: function () {
443 var current = F.current,
444 keys = current.keys;
445
446 if (!current) {
447 return;
448 }
449
450 W.bind('resize.fb orientationchange.fb' + (current.autoCenter && !current.fixed ? ' scroll.fb' : ''), F.update);
451
452 if (keys) {
453 D.bind('keydown.fb', function (e) {
454 var code, target = e.target || e.srcElement;
455
456 // Ignore key combinations and key events within form elements
457 if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
458 code = e.keyCode;
459
460 if ($.inArray(code, keys.close) > -1) {
461 F.close();
462 e.preventDefault();
463
464 } else if ($.inArray(code, keys.next) > -1) {
465 F.next();
466 e.preventDefault();
467
468 } else if ($.inArray(code, keys.prev) > -1) {
469 F.prev();
470 e.preventDefault();
471 }
472 }
473 });
474 }
475
476 if ($.fn.mousewheel && current.mouseWheel && F.group.length > 1) {
477 F.wrap.bind('mousewheel.fb', function (e, delta) {
478 var target = e.target || null;
479
480 if (delta !== 0 && (!target || target.clientHeight === 0 || (target.scrollHeight === target.clientHeight && target.scrollWidth === target.clientWidth))) {
481 e.preventDefault();
482
483 F[delta > 0 ? 'prev' : 'next']();
484 }
485 });
486 }
487 },
488
489 trigger: function (event, o) {
490 var ret, obj = o || F[ $.inArray(event, ['onCancel', 'beforeLoad', 'afterLoad']) > -1 ? 'coming' : 'current' ];
491
492 if (!obj) {
493 return;
494 }
495
496 if ($.isFunction( obj[event] )) {
497 ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
498 }
499
500 if (ret === false) {
501 return false;
502 }
503
504 if (obj.helpers) {
505 $.each(obj.helpers, function (helper, opts) {
506 if (opts && $.isPlainObject(F.helpers[helper]) && $.isFunction(F.helpers[helper][event])) {
507 F.helpers[helper][event](opts, obj);
508 }
509 });
510 }
511
512 $.event.trigger(event + '.fb');
513 },
514
515 isImage: function (str) {
516 return isString(str) && str.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i);
517 },
518
519 isSWF: function (str) {
520 return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
521 },
522
523 _start: function (index) {
524 var coming = {},
525 element = F.group[index] || null,
526 isDom,
527 href,
528 type,
529 rez,
530 hrefParts;
531
532 if (element && (element.nodeType || element instanceof $)) {
533 isDom = true;
534
535 if ($.metadata) {
536 coming = $(element).metadata();
537 }
538 }
539
540 coming = $.extend(true, {}, F.opts, {index : index, element : element}, ($.isPlainObject(element) ? element : coming));
541
542 // Re-check overridable options
543 $.each(['href', 'title', 'content', 'type'], function(i,v) {
544 coming[v] = F.opts[ v ] || (isDom && $(element).attr( v )) || coming[ v ] || null;
545 });
546
547 // Convert margin property to array - top, right, bottom, left
548 if (typeof coming.margin === 'number') {
549 coming.margin = [coming.margin, coming.margin, coming.margin, coming.margin];
550 }
551
552 // 'modal' propery is just a shortcut
553 if (coming.modal) {
554 $.extend(true, coming, {
555 closeBtn : false,
556 closeClick: false,
557 nextClick : false,
558 arrows : false,
559 mouseWheel : false,
560 keys : null,
561 helpers: {
562 overlay : {
563 css: {
564 cursor : 'auto'
565 },
566 closeClick : false
567 }
568 }
569 });
570 }
571
572 //Give a chance for callback or helpers to update coming item (type, title, etc)
573 F.coming = coming;
574
575 if (false === F.trigger('beforeLoad')) {
576 F.coming = null;
577 return;
578 }
579
580 type = coming.type;
581 href = coming.href || element;
582
583 ///Check if content type is set, if not, try to get
584 if (!type) {
585 if (isDom) {
586 type = $(element).data('fancybox-type');
587
588 if (!type) {
589 rez = element.className.match(/fancybox\.(\w+)/);
590 type = rez ? rez[1] : null;
591 }
592 }
593
594 if (!type && isString(href)) {
595 if (F.isImage(href)) {
596 type = 'image';
597
598 } else if (F.isSWF(href)) {
599 type = 'swf';
600
601 } else if (href.match(/^#/)) {
602 type = 'inline';
603 }
604 }
605
606 // ...if not - display element itself
607 if (!type) {
608 type = isDom ? 'inline' : 'html';
609 }
610
611 coming.type = type;
612 }
613
614 // Check before try to load; 'inline' and 'html' types need content, others - href
615 if (type === 'inline' || type === 'html') {
616 if (!coming.content) {
617 if (type === 'inline') {
618 coming.content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
619
620 } else {
621 coming.content = element;
622 }
623 }
624
625 if (!coming.content || !coming.content.length) {
626 type = null;
627 }
628
629 } else if (!href) {
630 type = null;
631 }
632
633 /*
634 * Add reference to the group, so it`s possible to access from callbacks, example:
635 * afterLoad : function() {
636 * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
637 * }
638 */
639
640 if (type === 'ajax' && isString(href)) {
641 hrefParts = href.split(/\s+/, 2);
642
643 href = hrefParts.shift();
644 coming.selector = hrefParts.shift();
645 }
646
647 coming.href = href;
648 coming.group = F.group;
649 coming.isDom = isDom;
650
651 switch (type) {
652 case 'image':
653 F._loadImage();
654 break;
655
656 case 'ajax':
657 F._loadAjax();
658 break;
659
660 case 'inline':
661 case 'iframe':
662 case 'swf':
663 case 'html':
664 F._afterLoad();
665 break;
666
667 default:
668 F._error( 'type' );
669 }
670 },
671
672 _error: function ( type ) {
673 F.hideLoading();
674
675 $.extend(F.coming, {
676 type : 'html',
677 autoSize : true,
678 minWidth : 0,
679 minHeight : 0,
680 padding : 15,
681 hasError : type,
682 content : F.coming.tpl.error
683 });
684
685 F._afterLoad();
686 },
687
688 _loadImage: function () {
689 // Reset preload image so it is later possible to check "complete" property
690 var img = F.imgPreload = new Image();
691
692 img.onload = function () {
693 this.onload = this.onerror = null;
694
695 F.coming.width = this.width;
696 F.coming.height = this.height;
697
698 F._afterLoad();
699 };
700
701 img.onerror = function () {
702 this.onload = this.onerror = null;
703
704 F._error( 'image' );
705 };
706
707 img.src = F.coming.href;
708
709 if (img.complete === undefined || !img.complete) {
710 F.showLoading();
711 }
712 },
713
714 _loadAjax: function () {
715 F.showLoading();
716
717 F.ajaxLoad = $.ajax($.extend({}, F.coming.ajax, {
718 url: F.coming.href,
719 error: function (jqXHR, textStatus) {
720 if (F.coming && textStatus !== 'abort') {
721 F._error( 'ajax', jqXHR );
722
723 } else {
724 F.hideLoading();
725 }
726 },
727 success: function (data, textStatus) {
728 if (textStatus === 'success') {
729 F.coming.content = data;
730
731 F._afterLoad();
732 }
733 }
734 }));
735 },
736
737 _preloadImages: function() {
738 var group = F.group,
739 current = F.current,
740 len = group.length,
741 item,
742 href,
743 i,
744 cnt = Math.min(current.preload, len - 1);
745
746 if (!current.preload || group.length < 2) {
747 return;
748 }
749
750 for (i = 1; i <= cnt; i += 1) {
751 item = group[ (current.index + i ) % len ];
752 href = item.href || $( item ).attr('href') || item;
753
754 if (item.type === 'image' || F.isImage(href)) {
755 new Image().src = href;
756 }
757 }
758 },
759
760 _afterLoad: function () {
761 F.hideLoading();
762
763 if (!F.coming || false === F.trigger('afterLoad', F.current)) {
764 F.coming = false;
765
766 return;
767 }
768
769 if (F.isOpened) {
770 $('.fancybox-item, .fancybox-nav').remove();
771
772 F.wrap.stop(true).removeClass('fancybox-opened');
773 F.inner.css('overflow', 'hidden');
774
775 F.transitions[F.current.prevMethod]();
776
777 } else {
778 $('.fancybox-wrap').stop().trigger('onReset').remove();
779
780 F.trigger('afterClose');
781 }
782
783 F.unbindEvents();
784
785 F.isOpen = false;
786 F.current = F.coming;
787
788 //Build the neccessary markup
789 F.wrap = $(F.current.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + F.current.type + ' fancybox-tmp ' + F.current.wrapCSS).appendTo('body');
790 F.skin = $('.fancybox-skin', F.wrap).css('padding', getValue(F.current.padding));
791 F.outer = $('.fancybox-outer', F.wrap);
792 F.inner = $('.fancybox-inner', F.wrap);
793
794 F._setContent();
795 },
796
797 _setContent: function () {
798 var current = F.current,
799 content = current.content,
800 type = current.type,
801 minWidth = current.minWidth,
802 minHeight = current.minHeight,
803 maxWidth = current.maxWidth,
804 maxHeight = current.maxHeight,
805 loadingBay;
806
807 switch (type) {
808 case 'inline':
809 case 'ajax':
810 case 'html':
811 if (current.selector) {
812 content = $('<div>').html(content).find(current.selector);
813
814 } else if (content instanceof $) {
815 if (content.parent().hasClass('fancybox-inner')) {
816 content.parents('.fancybox-wrap').unbind('onReset');
817 }
818
819 content = content.show().detach();
820
821 $(F.wrap).bind('onReset', function () {
822 content.appendTo('body').hide();
823 });
824 }
825
826 if (current.autoSize) {
827 loadingBay = $('<div class="fancybox-wrap ' + F.current.wrapCSS + ' fancybox-tmp"></div>')
828 .appendTo('body')
829 .css({
830 minWidth : getValue(minWidth, 'w'),
831 minHeight : getValue(minHeight, 'h'),
832 maxWidth : getValue(maxWidth, 'w'),
833 maxHeight : getValue(maxHeight, 'h')
834 })
835 .append(content);
836
837 current.width = loadingBay.width();
838 current.height = loadingBay.height();
839
840 // Re-check to fix 1px bug in some browsers
841 loadingBay.width( F.current.width );
842
843 if (loadingBay.height() > current.height) {
844 loadingBay.width(current.width + 1);
845
846 current.width = loadingBay.width();
847 current.height = loadingBay.height();
848 }
849
850 content = loadingBay.contents().detach();
851
852 loadingBay.remove();
853 }
854
855 break;
856
857 case 'image':
858 content = current.tpl.image.replace('{href}', current.href);
859
860 current.aspectRatio = true;
861 break;
862
863 case 'swf':
864 content = current.tpl.swf.replace(/\{width\}/g, current.width).replace(/\{height\}/g, current.height).replace(/\{href\}/g, current.href);
865 break;
866
867 case 'iframe':
868 content = $(current.tpl.iframe.replace('{rnd}', new Date().getTime()) )
869 .attr('scrolling', current.scrolling)
870 .attr('src', current.href);
871
872 current.scrolling = isTouch ? 'scroll' : 'auto';
873
874 break;
875 }
876
877 if (type === 'image' || type === 'swf') {
878 current.autoSize = false;
879 current.scrolling = 'visible';
880 }
881
882 if (type === 'iframe' && current.autoSize) {
883 F.showLoading();
884
885 F._setDimension();
886
887 F.inner.css('overflow', current.scrolling);
888
889 content.bind({
890 onCancel : function() {
891 $(this).unbind();
892
893 F._afterZoomOut();
894 },
895 load : function() {
896 F.hideLoading();
897
898 try {
899 if (this.contentWindow.document.location) {
900 F.current.height = $(this).contents().find('body').height();
901 }
902 } catch (e) {
903 F.current.autoSize = false;
904 }
905
906 F[ F.isOpen ? '_afterZoomIn' : '_beforeShow']();
907 }
908 }).appendTo(F.inner);
909
910 } else {
911 F.inner.append(content);
912
913 F._beforeShow();
914 }
915 },
916
917 _beforeShow : function() {
918 F.coming = null;
919
920 //Give a chance for helpers or callbacks to update elements
921 F.trigger('beforeShow');
922
923 //Set initial dimensions and hide
924 F._setDimension();
925 F.wrap.hide().removeClass('fancybox-tmp');
926
927 F.bindEvents();
928
929 F._preloadImages();
930
931 F.transitions[ F.isOpened ? F.current.nextMethod : F.current.openMethod ]();
932 },
933
934 _setDimension: function () {
935 var wrap = F.wrap,
936 inner = F.inner,
937 current = F.current,
938 viewport = F.getViewport(),
939 margin = current.margin,
940 padding2 = current.padding * 2,
941 width = current.width,
942 height = current.height,
943 maxWidth = current.maxWidth + padding2,
944 maxHeight = current.maxHeight + padding2,
945 minWidth = current.minWidth + padding2,
946 minHeight = current.minHeight + padding2,
947 ratio,
948 height_;
949
950 viewport.w -= (margin[1] + margin[3]);
951 viewport.h -= (margin[0] + margin[2]);
952
953 if (isPercentage(width)) {
954 width = (((viewport.w - padding2) * parseFloat(width)) / 100);
955 }
956
957 if (isPercentage(height)) {
958 height = (((viewport.h - padding2) * parseFloat(height)) / 100);
959 }
960
961 ratio = width / height;
962 width += padding2;
963 height += padding2;
964
965 if (current.fitToView) {
966 maxWidth = Math.min(viewport.w, maxWidth);
967 maxHeight = Math.min(viewport.h, maxHeight);
968 }
969
970 if (current.aspectRatio) {
971 if (width > maxWidth) {
972 width = maxWidth;
973 height = ((width - padding2) / ratio) + padding2;
974 }
975
976 if (height > maxHeight) {
977 height = maxHeight;
978 width = ((height - padding2) * ratio) + padding2;
979 }
980
981 if (width < minWidth) {
982 width = minWidth;
983 height = ((width - padding2) / ratio) + padding2;
984 }
985
986 if (height < minHeight) {
987 height = minHeight;
988 width = ((height - padding2) * ratio) + padding2;
989 }
990
991 } else {
992 width = Math.max(minWidth, Math.min(width, maxWidth));
993 height = Math.max(minHeight, Math.min(height, maxHeight));
994 }
995
996 width = Math.round(width);
997 height = Math.round(height);
998
999 //Reset dimensions
1000 $(wrap.add(inner)).width('auto').height('auto');
1001
1002 inner.width(width - padding2).height(height - padding2);
1003 wrap.width(width);
1004
1005 height_ = wrap.height(); // Real wrap height
1006
1007 //Fit wrapper inside
1008 if (width > maxWidth || height_ > maxHeight) {
1009 while ((width > maxWidth || height_ > maxHeight) && width > minWidth && height_ > minHeight) {
1010 height = height - 10;
1011
1012 if (current.aspectRatio) {
1013 width = Math.round(((height - padding2) * ratio) + padding2);
1014
1015 if (width < minWidth) {
1016 width = minWidth;
1017 height = ((width - padding2) / ratio) + padding2;
1018 }
1019
1020 } else {
1021 width = width - 10;
1022 }
1023
1024 inner.width(width - padding2).height(height - padding2);
1025 wrap.width(width);
1026
1027 height_ = wrap.height();
1028 }
1029 }
1030
1031 current.dim = {
1032 width : getValue(width),
1033 height : getValue(height_)
1034 };
1035
1036 current.canGrow = current.autoSize && height > minHeight && height < maxHeight;
1037 current.canShrink = false;
1038 current.canExpand = false;
1039
1040 if ((width - padding2) < current.width || (height - padding2) < current.height) {
1041 current.canExpand = true;
1042
1043 } else if ((width > viewport.w || height_ > viewport.h) && width > minWidth && height > minHeight) {
1044 current.canShrink = true;
1045 }
1046
1047 F.innerSpace = height_ - padding2 - inner.height();
1048 },
1049
1050 _getPosition: function (onlyAbsolute) {
1051 var current = F.current,
1052 viewport = F.getViewport(),
1053 margin = current.margin,
1054 width = F.wrap.width() + margin[1] + margin[3],
1055 height = F.wrap.height() + margin[0] + margin[2],
1056 rez = {
1057 position: 'absolute',
1058 top : margin[0] + viewport.y,
1059 left : margin[3] + viewport.x
1060 };
1061
1062 if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1063 rez = {
1064 position: 'fixed',
1065 top : margin[0],
1066 left : margin[3]
1067 };
1068 }
1069
1070 rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
1071 rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * 0.5)));
1072
1073 return rez;
1074 },
1075
1076 _afterZoomIn: function () {
1077 var current = F.current, scrolling = current ? current.scrolling : 'no';
1078
1079 if (!current) {
1080 return;
1081 }
1082
1083 F.isOpen = F.isOpened = true;
1084
1085 F.wrap.addClass('fancybox-opened');
1086
1087 F.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1088
1089 F.trigger('afterShow');
1090
1091 F.update();
1092
1093 //Assign a click event
1094 if (current.closeClick || current.nextClick) {
1095 F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
1096 if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1097 F[ current.closeClick ? 'close' : 'next' ]();
1098 }
1099 });
1100 }
1101
1102 //Create a close button
1103 if (current.closeBtn) {
1104 $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', F.close);
1105 }
1106
1107 //Create navigation arrows
1108 if (current.arrows && F.group.length > 1) {
1109 if (current.loop || current.index > 0) {
1110 $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
1111 }
1112
1113 if (current.loop || current.index < F.group.length - 1) {
1114 $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
1115 }
1116 }
1117
1118 if (F.opts.autoPlay && !F.player.isActive) {
1119 F.opts.autoPlay = false;
1120
1121 F.play();
1122 }
1123 },
1124
1125 _afterZoomOut: function () {
1126 var current = F.current;
1127
1128 F.wrap.trigger('onReset').remove();
1129
1130 $.extend(F, {
1131 group: {},
1132 opts: {},
1133 current: null,
1134 isActive: false,
1135 isOpened: false,
1136 isOpen: false,
1137 wrap: null,
1138 skin: null,
1139 outer: null,
1140 inner: null
1141 });
1142
1143 F.trigger('afterClose', current);
1144 }
1145 });
1146
1147 /*
1148 * Default transitions
1149 */
1150
1151 F.transitions = {
1152 getOrigPosition: function () {
1153 var current = F.current,
1154 element = current.element,
1155 padding = current.padding,
1156 orig = $(current.orig),
1157 pos = {},
1158 width = 50,
1159 height = 50,
1160 viewport;
1161
1162 if (!orig.length && current.isDom && $(element).is(':visible')) {
1163 orig = $(element).find('img:first');
1164
1165 if (!orig.length) {
1166 orig = $(element);
1167 }
1168 }
1169
1170 if (orig.length) {
1171 pos = orig.offset();
1172
1173 if (orig.is('img')) {
1174 width = orig.outerWidth();
1175 height = orig.outerHeight();
1176 }
1177
1178 } else {
1179 viewport = F.getViewport();
1180
1181 pos.top = viewport.y + (viewport.h - height) * 0.5;
1182 pos.left = viewport.x + (viewport.w - width) * 0.5;
1183 }
1184
1185 pos = {
1186 top : getValue(pos.top - padding),
1187 left : getValue(pos.left - padding),
1188 width : getValue(width + padding * 2),
1189 height : getValue(height + padding * 2)
1190 };
1191
1192 return pos;
1193 },
1194
1195 step: function (now, fx) {
1196 var prop = fx.prop, value, ratio;
1197
1198 if (prop === 'width' || prop === 'height') {
1199 value = Math.ceil(now - (F.current.padding * 2));
1200
1201 if (prop === 'height') {
1202 ratio = (now - fx.start) / (fx.end - fx.start);
1203
1204 if (fx.start > fx.end) {
1205 ratio = 1 - ratio;
1206 }
1207
1208 value -= F.innerSpace * ratio;
1209 }
1210
1211 F.inner[prop](value);
1212 }
1213 },
1214
1215 zoomIn: function () {
1216 var wrap = F.wrap,
1217 current = F.current,
1218 effect = current.openEffect,
1219 elastic = effect === 'elastic',
1220 dim = current.dim,
1221 startPos = $.extend({}, dim, F._getPosition( elastic )),
1222 endPos = $.extend({opacity : 1}, startPos);
1223
1224 //Remove "position" property that breaks older IE
1225 delete endPos.position;
1226
1227 if (elastic) {
1228 startPos = this.getOrigPosition();
1229
1230 if (current.openOpacity) {
1231 startPos.opacity = 0;
1232 }
1233
1234 F.outer.add(F.inner).width('auto').height('auto');
1235
1236 } else if (effect === 'fade') {
1237 startPos.opacity = 0;
1238 }
1239
1240 wrap.css(startPos)
1241 .show()
1242 .animate(endPos, {
1243 duration : effect === 'none' ? 0 : current.openSpeed,
1244 easing : current.openEasing,
1245 step : elastic ? this.step : null,
1246 complete : F._afterZoomIn
1247 });
1248 },
1249
1250 zoomOut: function () {
1251 var wrap = F.wrap,
1252 current = F.current,
1253 effect = current.openEffect,
1254 elastic = effect === 'elastic',
1255 endPos = {opacity : 0};
1256
1257 if (elastic) {
1258 if (wrap.css('position') === 'fixed') {
1259 wrap.css(F._getPosition(true));
1260 }
1261
1262 endPos = this.getOrigPosition();
1263
1264 if (current.closeOpacity) {
1265 endPos.opacity = 0;
1266 }
1267 }
1268
1269 wrap.animate(endPos, {
1270 duration : effect === 'none' ? 0 : current.closeSpeed,
1271 easing : current.closeEasing,
1272 step : elastic ? this.step : null,
1273 complete : F._afterZoomOut
1274 });
1275 },
1276
1277 changeIn: function () {
1278 var wrap = F.wrap,
1279 current = F.current,
1280 effect = current.nextEffect,
1281 elastic = effect === 'elastic',
1282 startPos = F._getPosition( elastic ),
1283 endPos = { opacity : 1 };
1284
1285 startPos.opacity = 0;
1286
1287 if (elastic) {
1288 startPos.top = getValue(parseInt(startPos.top, 10) - 200);
1289 endPos.top = '+=200px';
1290 }
1291
1292 wrap.css(startPos)
1293 .show()
1294 .animate(endPos, {
1295 duration : effect === 'none' ? 0 : current.nextSpeed,
1296 easing : current.nextEasing,
1297 complete : F._afterZoomIn
1298 });
1299 },
1300
1301 changeOut: function () {
1302 var wrap = F.wrap,
1303 current = F.current,
1304 effect = current.prevEffect,
1305 endPos = { opacity : 0 },
1306 cleanUp = function () {
1307 $(this).trigger('onReset').remove();
1308 };
1309
1310 wrap.removeClass('fancybox-opened');
1311
1312 if (effect === 'elastic') {
1313 endPos.top = '+=200px';
1314 }
1315
1316 wrap.animate(endPos, {
1317 duration : effect === 'none' ? 0 : current.prevSpeed,
1318 easing : current.prevEasing,
1319 complete : cleanUp
1320 });
1321 }
1322 };
1323
1324 /*
1325 * Overlay helper
1326 */
1327
1328 F.helpers.overlay = {
1329 overlay: null,
1330
1331 update: function () {
1332 var width, scrollWidth, offsetWidth;
1333
1334 //Reset width/height so it will not mess
1335 this.overlay.width('100%').height('100%');
1336
1337 if ($.browser.msie || isTouch) {
1338 scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
1339 offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1340
1341 width = scrollWidth < offsetWidth ? W.width() : scrollWidth;
1342
1343 } else {
1344 width = D.width();
1345 }
1346
1347 this.overlay.width(width).height(D.height());
1348 },
1349
1350 beforeShow: function (opts) {
1351 if (this.overlay) {
1352 return;
1353 }
1354
1355 opts = $.extend(true, {}, F.defaults.helpers.overlay, opts);
1356
1357 this.overlay = $('<div id="fancybox-overlay"></div>').css(opts.css).appendTo('body');
1358
1359 if (opts.closeClick) {
1360 this.overlay.bind('click.fb', F.close);
1361 }
1362
1363 if (F.current.fixed && !isTouch) {
1364 this.overlay.addClass('overlay-fixed');
1365
1366 } else {
1367 this.update();
1368
1369 this.onUpdate = function () {
1370 this.update();
1371 };
1372 }
1373
1374 this.overlay.fadeTo(opts.speedIn, opts.opacity);
1375 },
1376
1377 afterClose: function (opts) {
1378 if (this.overlay) {
1379 this.overlay.fadeOut(opts.speedOut || 0, function () {
1380 $(this).remove();
1381 });
1382 }
1383
1384 this.overlay = null;
1385 }
1386 };
1387
1388 /*
1389 * Title helper
1390 */
1391
1392 F.helpers.title = {
1393 beforeShow: function (opts) {
1394 var title, text = F.current.title;
1395
1396 if (text) {
1397 title = $('<div class="fancybox-title fancybox-title-' + opts.type + '-wrap">' + text + '</div>').appendTo('body');
1398
1399 if (opts.type === 'float') {
1400 //This helps for some browsers
1401 title.width(title.width());
1402
1403 title.wrapInner('<span class="child"></span>');
1404
1405 //Increase bottom margin so this title will also fit into viewport
1406 F.current.margin[2] += Math.abs(parseInt(title.css('margin-bottom'), 10));
1407 }
1408
1409 title.appendTo(opts.type === 'over' ? F.inner : (opts.type === 'outside' ? F.wrap : F.skin));
1410 }
1411 }
1412 };
1413
1414 // jQuery plugin initialization
1415 $.fn.fancybox = function (options) {
1416 var that = $(this),
1417 selector = this.selector || '',
1418 index,
1419 run = function(e) {
1420 var what = this, idx = index, relType, relVal;
1421
1422 if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !$(what).is('.fancybox-wrap')) {
1423 e.preventDefault();
1424
1425 relType = options.groupAttr || 'data-fancybox-group';
1426 relVal = $(what).attr(relType);
1427
1428 if (!relVal) {
1429 relType = 'rel';
1430 relVal = what[ relType ];
1431 }
1432
1433 if (relVal && relVal !== '' && relVal !== 'nofollow') {
1434 what = selector.length ? $(selector) : that;
1435 what = what.filter('[' + relType + '="' + relVal + '"]');
1436 idx = what.index(this);
1437 }
1438
1439 options.index = idx;
1440
1441 F.open(what, options);
1442 }
1443 };
1444
1445 options = options || {};
1446 index = options.index || 0;
1447
1448 if (selector) {
1449 D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run);
1450
1451 } else {
1452 that.unbind('click.fb-start').bind('click.fb-start', run);
1453 }
1454
1455 return this;
1456 };
1457
1458 // Test for fixedPosition needs a body at doc ready
1459 $(document).ready(function() {
1460 F.defaults.fixed = $.support.fixedPosition || (!($.browser.msie && $.browser.version <= 6) && !isTouch);
1461 });
1462
1463}(window, document, jQuery));
1464\ No newline at end of file0\ No newline at end of file
14651
=== removed file 'media/fancybox/jquery.fancybox.pack.js'
--- media/fancybox/jquery.fancybox.pack.js 2012-04-24 13:30:24 +0000
+++ media/fancybox/jquery.fancybox.pack.js 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
1/*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */
2(function(s,l,d,t){var m=d(s),q=d(l),a=d.fancybox=function(){a.open.apply(this,arguments)},u=!1,k=l.createTouch!==t,o=function(a){return"string"===d.type(a)},n=function(b,c){c&&o(b)&&0<b.indexOf("%")&&(b=a.getViewport()[c]/100*parseInt(b,10));return Math.round(b)+"px"};d.extend(a,{version:"2.0.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoResize:!k,autoCenter:!k,fitToView:!0,aspectRatio:!1,topRatio:0.5,fixed:!1,scrolling:"auto",
3wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},keys:{next:[13,32,34,39,40],prev:[8,33,37,38],close:[27]},tpl:{wrap:'<div class="fancybox-wrap"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0"'+
4(d.browser.msie?' allowtransparency="true"':"")+"></iframe>",swf:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
5closeBtn:'<div title="Close" class="fancybox-item fancybox-close"></div>',next:'<a title="Next" class="fancybox-nav fancybox-next"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev"><span></span></a>'},openEffect:"fade",openSpeed:300,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:300,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",
6prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){a.close(!0);b&&!d.isArray(b)&&(b=b instanceof d?d(b).get():[b]);a.isActive=!0;a.opts=d.extend(!0,{},a.defaults,c);d.isPlainObject(c)&&c.keys!==t&&(a.opts.keys=c.keys?
7d.extend({},a.defaults.keys,c.keys):!1);a.group=b;a._start(a.opts.index||0)},cancel:function(){a.coming&&!1===a.trigger("onCancel")||(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload&&(a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null))},close:function(b){a.cancel();a.current&&!1!==a.trigger("beforeClose")&&(a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(d(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened=
8!1,d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]()))},play:function(b){var c=function(){clearTimeout(a.player.timer)},e=function(){c();a.current&&a.player.isActive&&(a.player.timer=setTimeout(a.next,a.current.playSpeed))},f=function(){c();d("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])f();else if(a.current&&(a.current.loop||
9a.current.index<a.group.length-1))a.player.isActive=!0,d("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":f,"beforeLoad.player":c}),e(),a.trigger("onPlayStart")},next:function(){a.current&&a.jumpto(a.current.index+1)},prev:function(){a.current&&a.jumpto(a.current.index-1)},jumpto:function(b){a.current&&(b=parseInt(b,10),1<a.group.length&&a.current.loop&&(b>=a.group.length?b=0:0>b&&(b=a.group.length-1)),a.group[b]!==t&&(a.cancel(),a._start(b)))},reposition:function(b,
10c){var e;a.isOpen&&(e=a._getPosition(c),b&&"scroll"===b.type?(delete e.position,a.wrap.stop(!0,!0).animate(e,200)):a.wrap.css(e))},update:function(b){a.isOpen&&(u||setTimeout(function(){var c=a.current,e=!b||b&&"orientationchange"===b.type;if(u&&(u=!1,c)){if(!b||"scroll"!==b.type||e)c.autoSize&&"iframe"!==c.type&&(a.inner.height("auto"),c.height=a.inner.height()),(c.autoResize||e)&&a._setDimension(),c.canGrow&&"iframe"!==c.type&&a.inner.height("auto");(c.autoCenter||e)&&a.reposition(b);a.trigger("onUpdate")}},
11200),u=!0)},toggle:function(){a.isOpen&&(a.current.fitToView=!a.current.fitToView,a.update())},hideLoading:function(){q.unbind("keypress.fb");d("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();q.bind("keypress.fb",function(b){27===b.keyCode&&(b.preventDefault(),a.cancel())});d('<div id="fancybox-loading"><div></div></div>').click(a.cancel).appendTo("body")},getViewport:function(){return{x:m.scrollLeft(),y:m.scrollTop(),w:k&&s.innerWidth?s.innerWidth:m.width(),h:k&&s.innerHeight?
12s.innerHeight:m.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");q.unbind(".fb");m.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(m.bind("resize.fb orientationchange.fb"+(b.autoCenter&&!b.fixed?" scroll.fb":""),a.update),c&&q.bind("keydown.fb",function(b){var f;f=b.target||b.srcElement;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&(!f||!f.type&&!d(f).is("[contenteditable]")))f=b.keyCode,-1<d.inArray(f,c.close)?(a.close(),b.preventDefault()):-1<d.inArray(f,c.next)?
13(a.next(),b.preventDefault()):-1<d.inArray(f,c.prev)&&(a.prev(),b.preventDefault())}),d.fn.mousewheel&&b.mouseWheel&&1<a.group.length&&a.wrap.bind("mousewheel.fb",function(b,c){var d=b.target||null;if(0!==c&&(!d||0===d.clientHeight||d.scrollHeight===d.clientHeight&&d.scrollWidth===d.clientWidth))b.preventDefault(),a[0<c?"prev":"next"]()}))},trigger:function(b,c){var e,f=c||a[-1<d.inArray(b,["onCancel","beforeLoad","afterLoad"])?"coming":"current"];if(f){d.isFunction(f[b])&&(e=f[b].apply(f,Array.prototype.slice.call(arguments,
141)));if(!1===e)return!1;f.helpers&&d.each(f.helpers,function(c,e){if(e&&d.isPlainObject(a.helpers[c])&&d.isFunction(a.helpers[c][b]))a.helpers[c][b](e,f)});d.event.trigger(b+".fb")}},isImage:function(a){return o(a)&&a.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i)},isSWF:function(a){return o(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(b){var c={},e=a.group[b]||null,f,g,i;if(e&&(e.nodeType||e instanceof d))f=!0,d.metadata&&(c=d(e).metadata());c=d.extend(!0,{},a.opts,{index:b,element:e},d.isPlainObject(e)?
15e:c);d.each(["href","title","content","type"],function(b,g){c[g]=a.opts[g]||f&&d(e).attr(g)||c[g]||null});"number"===typeof c.margin&&(c.margin=[c.margin,c.margin,c.margin,c.margin]);c.modal&&d.extend(!0,c,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{css:{cursor:"auto"},closeClick:!1}}});a.coming=c;if(!1===a.trigger("beforeLoad"))a.coming=null;else{g=c.type;b=c.href||e;g||(f&&(g=d(e).data("fancybox-type"),g||(g=(g=e.className.match(/fancybox\.(\w+)/))?
16g[1]:null)),!g&&o(b)&&(a.isImage(b)?g="image":a.isSWF(b)?g="swf":b.match(/^#/)&&(g="inline")),g||(g=f?"inline":"html"),c.type=g);if("inline"===g||"html"===g){if(c.content||(c.content="inline"===g?d(o(b)?b.replace(/.*(?=#[^\s]+$)/,""):b):e),!c.content||!c.content.length)g=null}else b||(g=null);"ajax"===g&&o(b)&&(i=b.split(/\s+/,2),b=i.shift(),c.selector=i.shift());c.href=b;c.group=a.group;c.isDom=f;switch(g){case "image":a._loadImage();break;case "ajax":a._loadAjax();break;case "inline":case "iframe":case "swf":case "html":a._afterLoad();
17break;default:a._error("type")}}},_error:function(b){a.hideLoading();d.extend(a.coming,{type:"html",autoSize:!0,minWidth:0,minHeight:0,padding:15,hasError:b,content:a.coming.tpl.error});a._afterLoad()},_loadImage:function(){var b=a.imgPreload=new Image;b.onload=function(){this.onload=this.onerror=null;a.coming.width=this.width;a.coming.height=this.height;a._afterLoad()};b.onerror=function(){this.onload=this.onerror=null;a._error("image")};b.src=a.coming.href;(b.complete===t||!b.complete)&&a.showLoading()},
18_loadAjax:function(){a.showLoading();a.ajaxLoad=d.ajax(d.extend({},a.coming.ajax,{url:a.coming.href,error:function(b,c){a.coming&&"abort"!==c?a._error("ajax",b):a.hideLoading()},success:function(b,c){"success"===c&&(a.coming.content=b,a._afterLoad())}}))},_preloadImages:function(){var b=a.group,c=a.current,e=b.length,f,g,i,h=Math.min(c.preload,e-1);if(c.preload&&!(2>b.length))for(i=1;i<=h;i+=1)if(f=b[(c.index+i)%e],g=f.href||d(f).attr("href")||f,"image"===f.type||a.isImage(g))(new Image).src=g},_afterLoad:function(){a.hideLoading();
19!a.coming||!1===a.trigger("afterLoad",a.current)?a.coming=!1:(a.isOpened?(d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.prevMethod]()):(d(".fancybox-wrap").stop().trigger("onReset").remove(),a.trigger("afterClose")),a.unbindEvents(),a.isOpen=!1,a.current=a.coming,a.wrap=d(a.current.tpl.wrap).addClass("fancybox-"+(k?"mobile":"desktop")+" fancybox-type-"+a.current.type+" fancybox-tmp "+a.current.wrapCSS).appendTo("body"),
20a.skin=d(".fancybox-skin",a.wrap).css("padding",n(a.current.padding)),a.outer=d(".fancybox-outer",a.wrap),a.inner=d(".fancybox-inner",a.wrap),a._setContent())},_setContent:function(){var b=a.current,c=b.content,e=b.type,f=b.minWidth,g=b.minHeight,i=b.maxWidth,h=b.maxHeight;switch(e){case "inline":case "ajax":case "html":b.selector?c=d("<div>").html(c).find(b.selector):c instanceof d&&(c.parent().hasClass("fancybox-inner")&&c.parents(".fancybox-wrap").unbind("onReset"),c=c.show().detach(),d(a.wrap).bind("onReset",
21function(){c.appendTo("body").hide()}));b.autoSize&&(f=d('<div class="fancybox-wrap '+a.current.wrapCSS+' fancybox-tmp"></div>').appendTo("body").css({minWidth:n(f,"w"),minHeight:n(g,"h"),maxWidth:n(i,"w"),maxHeight:n(h,"h")}).append(c),b.width=f.width(),b.height=f.height(),f.width(a.current.width),f.height()>b.height&&(f.width(b.width+1),b.width=f.width(),b.height=f.height()),c=f.contents().detach(),f.remove());break;case "image":c=b.tpl.image.replace("{href}",b.href);b.aspectRatio=!0;break;case "swf":c=
22b.tpl.swf.replace(/\{width\}/g,b.width).replace(/\{height\}/g,b.height).replace(/\{href\}/g,b.href);break;case "iframe":c=d(b.tpl.iframe.replace("{rnd}",(new Date).getTime())).attr("scrolling",b.scrolling).attr("src",b.href),b.scrolling=k?"scroll":"auto"}if("image"===e||"swf"===e)b.autoSize=!1,b.scrolling="visible";"iframe"===e&&b.autoSize?(a.showLoading(),a._setDimension(),a.inner.css("overflow",b.scrolling),c.bind({onCancel:function(){d(this).unbind();a._afterZoomOut()},load:function(){a.hideLoading();
23try{this.contentWindow.document.location&&(a.current.height=d(this).contents().find("body").height())}catch(b){a.current.autoSize=!1}a[a.isOpen?"_afterZoomIn":"_beforeShow"]()}}).appendTo(a.inner)):(a.inner.append(c),a._beforeShow())},_beforeShow:function(){a.coming=null;a.trigger("beforeShow");a._setDimension();a.wrap.hide().removeClass("fancybox-tmp");a.bindEvents();a._preloadImages();a.transitions[a.isOpened?a.current.nextMethod:a.current.openMethod]()},_setDimension:function(){var b=a.wrap,c=
24a.inner,e=a.current,f=a.getViewport(),g=e.margin,i=2*e.padding,h=e.width,j=e.height,r=e.maxWidth+i,k=e.maxHeight+i,l=e.minWidth+i,m=e.minHeight+i,p;f.w-=g[1]+g[3];f.h-=g[0]+g[2];o(h)&&0<h.indexOf("%")&&(h=(f.w-i)*parseFloat(h)/100);o(j)&&0<j.indexOf("%")&&(j=(f.h-i)*parseFloat(j)/100);g=h/j;h+=i;j+=i;e.fitToView&&(r=Math.min(f.w,r),k=Math.min(f.h,k));if(e.aspectRatio){if(h>r&&(h=r,j=(h-i)/g+i),j>k&&(j=k,h=(j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i),j<m)j=m,h=(j-i)*g+i}else h=Math.max(l,Math.min(h,r)),j=Math.max(m,
25Math.min(j,k));h=Math.round(h);j=Math.round(j);d(b.add(c)).width("auto").height("auto");c.width(h-i).height(j-i);b.width(h);p=b.height();if(h>r||p>k)for(;(h>r||p>k)&&h>l&&p>m;)j-=10,e.aspectRatio?(h=Math.round((j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i)):h-=10,c.width(h-i).height(j-i),b.width(h),p=b.height();e.dim={width:n(h),height:n(p)};e.canGrow=e.autoSize&&j>m&&j<k;e.canShrink=!1;e.canExpand=!1;if(h-i<e.width||j-i<e.height)e.canExpand=!0;else if((h>f.w||p>f.h)&&h>l&&j>m)e.canShrink=!0;a.innerSpace=p-i-
26c.height()},_getPosition:function(b){var c=a.current,e=a.getViewport(),f=c.margin,d=a.wrap.width()+f[1]+f[3],i=a.wrap.height()+f[0]+f[2],h={position:"absolute",top:f[0]+e.y,left:f[3]+e.x};c.autoCenter&&c.fixed&&!b&&i<=e.h&&d<=e.w&&(h={position:"fixed",top:f[0],left:f[3]});h.top=n(Math.max(h.top,h.top+(e.h-i)*c.topRatio));h.left=n(Math.max(h.left,h.left+0.5*(e.w-d)));return h},_afterZoomIn:function(){var b=a.current,c=b?b.scrolling:"no";if(b&&(a.isOpen=a.isOpened=!0,a.wrap.addClass("fancybox-opened"),
27a.inner.css("overflow","yes"===c?"scroll":"no"===c?"hidden":c),a.trigger("afterShow"),a.update(),(b.closeClick||b.nextClick)&&a.inner.css("cursor","pointer").bind("click.fb",function(c){if(!d(c.target).is("a")&&!d(c.target).parent().is("a"))a[b.closeClick?"close":"next"]()}),b.closeBtn&&d(b.tpl.closeBtn).appendTo(a.skin).bind("click.fb",a.close),b.arrows&&1<a.group.length&&((b.loop||0<b.index)&&d(b.tpl.prev).appendTo(a.outer).bind("click.fb",a.prev),(b.loop||b.index<a.group.length-1)&&d(b.tpl.next).appendTo(a.outer).bind("click.fb",
28a.next)),a.opts.autoPlay&&!a.player.isActive))a.opts.autoPlay=!1,a.play()},_afterZoomOut:function(){var b=a.current;a.wrap.trigger("onReset").remove();d.extend(a,{group:{},opts:{},current:null,isActive:!1,isOpened:!1,isOpen:!1,wrap:null,skin:null,outer:null,inner:null});a.trigger("afterClose",b)}});a.transitions={getOrigPosition:function(){var b=a.current,c=b.element,e=b.padding,f=d(b.orig),g={},i=50,h=50;!f.length&&b.isDom&&d(c).is(":visible")&&(f=d(c).find("img:first"),f.length||(f=d(c)));f.length?
29(g=f.offset(),f.is("img")&&(i=f.outerWidth(),h=f.outerHeight())):(b=a.getViewport(),g.top=b.y+0.5*(b.h-h),g.left=b.x+0.5*(b.w-i));return g={top:n(g.top-e),left:n(g.left-e),width:n(i+2*e),height:n(h+2*e)}},step:function(b,c){var e=c.prop,d,g;if("width"===e||"height"===e)d=Math.ceil(b-2*a.current.padding),"height"===e&&(g=(b-c.start)/(c.end-c.start),c.start>c.end&&(g=1-g),d-=a.innerSpace*g),a.inner[e](d)},zoomIn:function(){var b=a.wrap,c=a.current,e=c.openEffect,f="elastic"===e,g=d.extend({},c.dim,
30a._getPosition(f)),i=d.extend({opacity:1},g);delete i.position;f?(g=this.getOrigPosition(),c.openOpacity&&(g.opacity=0),a.outer.add(a.inner).width("auto").height("auto")):"fade"===e&&(g.opacity=0);b.css(g).show().animate(i,{duration:"none"===e?0:c.openSpeed,easing:c.openEasing,step:f?this.step:null,complete:a._afterZoomIn})},zoomOut:function(){var b=a.wrap,c=a.current,d=c.openEffect,f="elastic"===d,g={opacity:0};f&&("fixed"===b.css("position")&&b.css(a._getPosition(!0)),g=this.getOrigPosition(),c.closeOpacity&&
31(g.opacity=0));b.animate(g,{duration:"none"===d?0:c.closeSpeed,easing:c.closeEasing,step:f?this.step:null,complete:a._afterZoomOut})},changeIn:function(){var b=a.wrap,c=a.current,d=c.nextEffect,f="elastic"===d,g=a._getPosition(f),i={opacity:1};g.opacity=0;f&&(g.top=n(parseInt(g.top,10)-200),i.top="+=200px");b.css(g).show().animate(i,{duration:"none"===d?0:c.nextSpeed,easing:c.nextEasing,complete:a._afterZoomIn})},changeOut:function(){var b=a.wrap,c=a.current,e=c.prevEffect,f={opacity:0};b.removeClass("fancybox-opened");
32"elastic"===e&&(f.top="+=200px");b.animate(f,{duration:"none"===e?0:c.prevSpeed,easing:c.prevEasing,complete:function(){d(this).trigger("onReset").remove()}})}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width("100%").height("100%");d.browser.msie||k?(a=Math.max(l.documentElement.scrollWidth,l.body.scrollWidth),c=Math.max(l.documentElement.offsetWidth,l.body.offsetWidth),a=a<c?m.width():a):a=q.width();this.overlay.width(a).height(q.height())},beforeShow:function(b){this.overlay||
33(b=d.extend(!0,{},a.defaults.helpers.overlay,b),this.overlay=d('<div id="fancybox-overlay"></div>').css(b.css).appendTo("body"),b.closeClick&&this.overlay.bind("click.fb",a.close),a.current.fixed&&!k?this.overlay.addClass("overlay-fixed"):(this.update(),this.onUpdate=function(){this.update()}),this.overlay.fadeTo(b.speedIn,b.opacity))},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||0,function(){d(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c;
34if(c=a.current.title)c=d('<div class="fancybox-title fancybox-title-'+b.type+'-wrap">'+c+"</div>").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner('<span class="child"></span>'),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.skin)}};d.fn.fancybox=function(b){var c=d(this),e=this.selector||"",f,g=function(g){var h=this,j=f,k;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!d(h).is(".fancybox-wrap")&&
35(g.preventDefault(),g=b.groupAttr||"data-fancybox-group",k=d(h).attr(g),k||(g="rel",k=h[g]),k&&""!==k&&"nofollow"!==k&&(h=e.length?d(e):c,h=h.filter("["+g+'="'+k+'"]'),j=h.index(this)),b.index=j,a.open(h,b))},b=b||{};f=b.index||0;e?q.undelegate(e,"click.fb-start").delegate(e,"click.fb-start",g):c.unbind("click.fb-start").bind("click.fb-start",g);return this};d(l).ready(function(){a.defaults.fixed=d.support.fixedPosition||!(d.browser.msie&&6>=d.browser.version)&&!k})})(window,document,jQuery);
36\ No newline at end of file0\ No newline at end of file
371
=== modified file 'media/js/disableOnSubmit.js'
--- media/js/disableOnSubmit.js 2011-07-06 23:31:10 +0000
+++ media/js/disableOnSubmit.js 2017-09-26 21:12:14 +0000
@@ -6,11 +6,11 @@
6 */6 */
7$.fn.disableOnSubmit = function(disableList){7$.fn.disableOnSubmit = function(disableList){
8 8
9 if(disableList == null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';}9 if(disableList === null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';}
10 else{var $list = disableList;}10 else{var $list = disableList;}
11 11
12 // Makes sure button is enabled at start12 // Makes sure button is enabled at start
13 $(this).find($list).removeAttr('disabled');13 $(this).find($list).prop("disabled", true);
14 14
15 $(this).submit(function(){$(this).find($list).attr('disabled','disabled');});15 $(this).submit(function(){$(this).find($list).attr('disabled','disabled');});
16 return this;16 return this;
1717
=== modified file 'media/js/encyclopedia.js'
--- media/js/encyclopedia.js 2017-03-15 20:59:33 +0000
+++ media/js/encyclopedia.js 2017-09-26 21:12:14 +0000
@@ -1,6 +1,5 @@
1$(document).ready(function() {1$(document).ready(function() {
2 var elem = document.getElementById('apply_filter');2 $('#apply_filter').on('click', set_display);
3 elem.addEventListener('click', set_display);
4 // Find names of checkboxes:3 // Find names of checkboxes:
5 checkb_names = get_input_names(); 4 checkb_names = get_input_names();
6 // Initialize after reload, e.g. pressing F5:5 // Initialize after reload, e.g. pressing F5:
@@ -8,7 +7,7 @@
87
9 // Smooth scrolling, taken from:8 // Smooth scrolling, taken from:
10 // http://stackoverflow.com/a/187951129 // http://stackoverflow.com/a/18795112
11 $('a[href*=#]').click(function(event){10 $("a[href*='#']").click(function(event){
12 $('html, body').animate({11 $('html, body').animate({
13 scrollTop: $( $.attr(this, 'href') ).offset().top12 scrollTop: $( $.attr(this, 'href') ).offset().top
14 }, 500);13 }, 500);
1514
=== removed directory 'media/js/highcharts_219'
=== removed directory 'media/js/highcharts_219/adapters'
=== removed file 'media/js/highcharts_219/adapters/mootools-adapter.js'
--- media/js/highcharts_219/adapters/mootools-adapter.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/adapters/mootools-adapter.js 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1/*
2 Highcharts JS v2.1.9 (2011-11-11)
3 MooTools adapter
4
5 (c) 2010-2011 Torstein H?nsi
6
7 License: www.highcharts.com/license
8*/
9(function(){var e=window,h=e.MooTools.version.substring(0,3),i=h==="1.2"||h==="1.1",m=i||h==="1.3",j=e.$extend||function(){return Object.append.apply(Object,arguments)};e.HighchartsAdapter={init:function(a){var b=Fx.prototype,c=b.start,d=Fx.Morph.prototype,g=d.compute;b.start=function(f){var k=this.element;if(f.d)this.paths=a.init(k,k.d,this.toD);c.apply(this,arguments);return this};d.compute=function(f,k,n){var l=this.paths;if(l)this.element.attr("d",a.step(l[0],l[1],n,this.toD));else return g.apply(this,
10arguments)}},animate:function(a,b,c){var d=a.attr,g=c&&c.complete;if(d&&!a.setStyle){a.getStyle=a.attr;a.setStyle=function(){var f=arguments;a.attr.call(a,f[0],f[1][0])};a.$family=a.uid=true}e.HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a),j({transition:Fx.Transitions.Quad.easeInOut},c));if(b.d)c.toD=b.d;g&&c.addEvent("complete",g);c.start(b);a.fx=c},each:function(a,b){return i?$each(a,b):a.each(b)},map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},merge:function(){var a=
11arguments,b=[{}],c=a.length;if(i)a=$merge.apply(null,a);else{for(;c--;)if(typeof a[c]!=="boolean")b[c+1]=a[c];a=Object.merge.apply(Object,b)}return a},extendWithEvents:function(a){a.addEvent||(a.nodeName?$(a):j(a,new Events))},addEvent:function(a,b,c){if(typeof b==="string"){if(b==="unload")b="beforeunload";e.HighchartsAdapter.extendWithEvents(a);a.addEvent(b,c)}},removeEvent:function(a,b,c){if(typeof a!=="string"){e.HighchartsAdapter.extendWithEvents(a);if(b){if(b==="unload")b="beforeunload";c?a.removeEvent(b,
12c):a.removeEvents(b)}else a.removeEvents()}},fireEvent:function(a,b,c,d){b={type:b,target:a};b=m?new Event(b):new DOMEvent(b);b=j(b,c);b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},stop:function(a){a.fx&&a.fx.cancel()}}})();
130
=== removed file 'media/js/highcharts_219/adapters/mootools-adapter.src.js'
--- media/js/highcharts_219/adapters/mootools-adapter.src.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/adapters/mootools-adapter.src.js 1970-01-01 00:00:00 +0000
@@ -1,264 +0,0 @@
1/**
2 * @license Highcharts JS v2.1.9 (2011-11-11)
3 * MooTools adapter
4 *
5 * (c) 2010-2011 Torstein Hønsi
6 *
7 * License: www.highcharts.com/license
8 */
9
10// JSLint options:
11/*global Fx, $, $extend, $each, $merge, Events, Event, DOMEvent */
12
13(function () {
14
15var win = window,
16 mooVersion = win.MooTools.version.substring(0, 3), // Get the first three characters of the version number
17 legacy = mooVersion === '1.2' || mooVersion === '1.1', // 1.1 && 1.2 considered legacy, 1.3 is not.
18 legacyEvent = legacy || mooVersion === '1.3', // In versions 1.1 - 1.3 the event class is named Event, in newer versions it is named DOMEvent.
19 $extend = win.$extend || function () {
20 return Object.append.apply(Object, arguments);
21 };
22
23win.HighchartsAdapter = {
24 /**
25 * Initialize the adapter. This is run once as Highcharts is first run.
26 * @param {Object} pathAnim The helper object to do animations across adapters.
27 */
28 init: function (pathAnim) {
29 var fxProto = Fx.prototype,
30 fxStart = fxProto.start,
31 morphProto = Fx.Morph.prototype,
32 morphCompute = morphProto.compute;
33
34 // override Fx.start to allow animation of SVG element wrappers
35 /*jslint unparam: true*//* allow unused parameters in fx functions */
36 fxProto.start = function (from, to) {
37 var fx = this,
38 elem = fx.element;
39
40 // special for animating paths
41 if (from.d) {
42 //this.fromD = this.element.d.split(' ');
43 fx.paths = pathAnim.init(
44 elem,
45 elem.d,
46 fx.toD
47 );
48 }
49 fxStart.apply(fx, arguments);
50
51 return this; // chainable
52 };
53
54 // override Fx.step to allow animation of SVG element wrappers
55 morphProto.compute = function (from, to, delta) {
56 var fx = this,
57 paths = fx.paths;
58
59 if (paths) {
60 fx.element.attr(
61 'd',
62 pathAnim.step(paths[0], paths[1], delta, fx.toD)
63 );
64 } else {
65 return morphCompute.apply(fx, arguments);
66 }
67 };
68 /*jslint unparam: false*/
69 },
70
71 /**
72 * Animate a HTML element or SVG element wrapper
73 * @param {Object} el
74 * @param {Object} params
75 * @param {Object} options jQuery-like animation options: duration, easing, callback
76 */
77 animate: function (el, params, options) {
78 var isSVGElement = el.attr,
79 effect,
80 complete = options && options.complete;
81
82 if (isSVGElement && !el.setStyle) {
83 // add setStyle and getStyle methods for internal use in Moo
84 el.getStyle = el.attr;
85 el.setStyle = function () { // property value is given as array in Moo - break it down
86 var args = arguments;
87 el.attr.call(el, args[0], args[1][0]);
88 };
89 // dirty hack to trick Moo into handling el as an element wrapper
90 el.$family = el.uid = true;
91 }
92
93 // stop running animations
94 win.HighchartsAdapter.stop(el);
95
96 // define and run the effect
97 effect = new Fx.Morph(
98 isSVGElement ? el : $(el),
99 $extend({
100 transition: Fx.Transitions.Quad.easeInOut
101 }, options)
102 );
103
104 // special treatment for paths
105 if (params.d) {
106 effect.toD = params.d;
107 }
108
109 // jQuery-like events
110 if (complete) {
111 effect.addEvent('complete', complete);
112 }
113
114 // run
115 effect.start(params);
116
117 // record for use in stop method
118 el.fx = effect;
119 },
120
121 /**
122 * MooTool's each function
123 *
124 */
125 each: function (arr, fn) {
126 return legacy ?
127 $each(arr, fn) :
128 arr.each(fn);
129 },
130
131 /**
132 * Map an array
133 * @param {Array} arr
134 * @param {Function} fn
135 */
136 map: function (arr, fn) {
137 return arr.map(fn);
138 },
139
140 /**
141 * Grep or filter an array
142 * @param {Array} arr
143 * @param {Function} fn
144 */
145 grep: function (arr, fn) {
146 return arr.filter(fn);
147 },
148
149 /**
150 * Deep merge two objects and return a third
151 */
152 merge: function () {
153 var args = arguments,
154 args13 = [{}], // MooTools 1.3+
155 i = args.length,
156 ret;
157
158 if (legacy) {
159 ret = $merge.apply(null, args);
160 } else {
161 while (i--) {
162 // Boolean argumens should not be merged.
163 // JQuery explicitly skips this, so we do it here as well.
164 if (typeof args[i] !== 'boolean') {
165 args13[i + 1] = args[i];
166 }
167 }
168 ret = Object.merge.apply(Object, args13);
169 }
170
171 return ret;
172 },
173
174 /**
175 * Extends an object with Events, if its not done
176 */
177 extendWithEvents: function (el) {
178 // if the addEvent method is not defined, el is a custom Highcharts object
179 // like series or point
180 if (!el.addEvent) {
181 if (el.nodeName) {
182 el = $(el); // a dynamically generated node
183 } else {
184 $extend(el, new Events()); // a custom object
185 }
186 }
187 },
188
189 /**
190 * Add an event listener
191 * @param {Object} el HTML element or custom object
192 * @param {String} type Event type
193 * @param {Function} fn Event handler
194 */
195 addEvent: function (el, type, fn) {
196 if (typeof type === 'string') { // chart broke due to el being string, type function
197
198 if (type === 'unload') { // Moo self destructs before custom unload events
199 type = 'beforeunload';
200 }
201
202 win.HighchartsAdapter.extendWithEvents(el);
203
204 el.addEvent(type, fn);
205 }
206 },
207
208 removeEvent: function (el, type, fn) {
209 if (typeof el === 'string') {
210 // el.removeEvents below apperantly calls this method again. Do not quite understand why, so for now just bail out.
211 return;
212 }
213 win.HighchartsAdapter.extendWithEvents(el);
214 if (type) {
215 if (type === 'unload') { // Moo self destructs before custom unload events
216 type = 'beforeunload';
217 }
218
219 if (fn) {
220 el.removeEvent(type, fn);
221 } else {
222 el.removeEvents(type);
223 }
224 } else {
225 el.removeEvents();
226 }
227 },
228
229 fireEvent: function (el, event, eventArguments, defaultFunction) {
230 var eventArgs = {
231 type: event,
232 target: el
233 };
234 // create an event object that keeps all functions
235 event = legacyEvent ? new Event(eventArgs) : new DOMEvent(eventArgs);
236 event = $extend(event, eventArguments);
237 // override the preventDefault function to be able to use
238 // this for custom events
239 event.preventDefault = function () {
240 defaultFunction = null;
241 };
242 // if fireEvent is not available on the object, there hasn't been added
243 // any events to it above
244 if (el.fireEvent) {
245 el.fireEvent(event.type, event);
246 }
247
248 // fire the default if it is passed and it is not prevented above
249 if (defaultFunction) {
250 defaultFunction(event);
251 }
252 },
253
254 /**
255 * Stop running animations on the object
256 */
257 stop: function (el) {
258 if (el.fx) {
259 el.fx.cancel();
260 }
261 }
262};
263
264}());
2650
=== removed file 'media/js/highcharts_219/adapters/prototype-adapter.js'
--- media/js/highcharts_219/adapters/prototype-adapter.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/adapters/prototype-adapter.js 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1/*
2 Highcharts JS v2.1.9 (2011-11-11)
3 Prototype adapter
4
5 @author Michael Nelson, Torstein H?nsi.
6
7 Feel free to use and modify this script.
8 Highcharts license: www.highcharts.com/license.
9*/
10var HighchartsAdapter=function(){var g=typeof Effect!=="undefined";return{init:function(c){if(g)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(a,b,d,e){var f;this.element=a;this.key=b;f=a.attr(b);if(b==="d"){this.paths=c.init(a,a.d,d);this.toD=d;f=0;d=1}this.start(Object.extend(e||{},{from:f,to:d,attribute:b}))},setup:function(){HighchartsAdapter._extend(this.element);if(!this.element._highchart_animation)this.element._highchart_animation={};this.element._highchart_animation[this.key]=
11this},update:function(a){var b=this.paths;if(b)a=c.step(b[0],b[1],a,this.toD);this.element.attr(this.options.attribute,a)},finish:function(){delete this.element._highchart_animation[this.key]}})},addNS:function(c){var a=/^(?:click|mouse(?:down|up|over|move|out))$/;return/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/.test(c)||a.test(c)?c:"h:"+c},addEvent:function(c,a,b){if(c.addEventListener||c.attachEvent)Event.observe($(c),HighchartsAdapter.addNS(a),b);else{HighchartsAdapter._extend(c);
12c._highcharts_observe(a,b)}},animate:function(c,a,b){var d;b=b||{};b.delay=0;b.duration=(b.duration||500)/1E3;if(g)for(d in a)new Effect.HighchartsTransition($(c),d,a[d],b);else for(d in a)c.attr(d,a[d]);if(!c.attr)throw"Todo: implement animate DOM objects";},stop:function(c){var a;if(c._highcharts_extended&&c._highchart_animation)for(a in c._highchart_animation)c._highchart_animation[a].cancel()},each:function(c,a){$A(c).each(a)},fireEvent:function(c,a,b,d){if(c.fire)c.fire(HighchartsAdapter.addNS(a),
13b);else if(c._highcharts_extended){b=b||{};c._highcharts_fire(a,b)}if(b&&b.defaultPrevented)d=null;d&&d(b)},removeEvent:function(c,a,b){if($(c).stopObserving){if(a)a=HighchartsAdapter.addNS(a);$(c).stopObserving(a,b)}if(window===c)Event.stopObserving(c,a,b);else{HighchartsAdapter._extend(c);c._highcharts_stop_observing(a,b)}},grep:function(c,a){return c.findAll(a)},map:function(c,a){return c.map(a)},merge:function(){function c(a,b){var d,e;for(e in b){d=b[e];a[e]=d&&typeof d==="object"&&d.constructor!==
14Array&&typeof d.nodeType!=="number"?c(a[e]||{},d):b[e]}return a}return function(){var a=arguments,b,d={};for(b=0;b<a.length;b++)d=c(d,a[b]);return d}.apply(this,arguments)},_extend:function(c){c._highcharts_extended||Object.extend(c,{_highchart_events:{},_highchart_animation:null,_highcharts_extended:true,_highcharts_observe:function(a,b){this._highchart_events[a]=[this._highchart_events[a],b].compact().flatten()},_highcharts_stop_observing:function(a,b){if(a)if(b)this._highchart_events[a]=[this._highchart_events[a]].compact().flatten().without(b);
15else delete this._highchart_events[a];else this._highchart_events={}},_highcharts_fire:function(a,b){(this._highchart_events[a]||[]).each(function(d){if(!b.stopped){b.preventDefault=function(){b.defaultPrevented=true};d.bind(this)(b)===false&&b.preventDefault()}}.bind(this))}})}}}();
160
=== removed file 'media/js/highcharts_219/adapters/prototype-adapter.src.js'
--- media/js/highcharts_219/adapters/prototype-adapter.src.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/adapters/prototype-adapter.src.js 1970-01-01 00:00:00 +0000
@@ -1,331 +0,0 @@
1/**
2 * @license Highcharts JS v2.1.9 (2011-11-11)
3 * Prototype adapter
4 *
5 * @author Michael Nelson, Torstein Hønsi.
6 *
7 * Feel free to use and modify this script.
8 * Highcharts license: www.highcharts.com/license.
9 */
10
11/*
12 * Known issues:
13 * - Some grid lines land in wrong position - http://jsfiddle.net/highcharts/jaRhY/28
14 */
15
16// JSLint options:
17/*global Effect, Class, Event, $, $A */
18
19// Adapter interface between prototype and the Highcharts charting library
20var HighchartsAdapter = (function () {
21
22var hasEffect = typeof Effect !== 'undefined';
23
24return {
25
26 /**
27 * Initialize the adapter. This is run once as Highcharts is first run.
28 * @param {Object} pathAnim The helper object to do animations across adapters.
29 */
30 init: function (pathAnim) {
31 if (hasEffect) {
32 /**
33 * Animation for Highcharts SVG element wrappers only
34 * @param {Object} element
35 * @param {Object} attribute
36 * @param {Object} to
37 * @param {Object} options
38 */
39 Effect.HighchartsTransition = Class.create(Effect.Base, {
40 initialize: function (element, attr, to, options) {
41 var from,
42 opts;
43
44 this.element = element;
45 this.key = attr;
46 from = element.attr(attr);
47
48 // special treatment for paths
49 if (attr === 'd') {
50 this.paths = pathAnim.init(
51 element,
52 element.d,
53 to
54 );
55 this.toD = to;
56
57
58 // fake values in order to read relative position as a float in update
59 from = 0;
60 to = 1;
61 }
62
63 opts = Object.extend((options || {}), {
64 from: from,
65 to: to,
66 attribute: attr
67 });
68 this.start(opts);
69 },
70 setup: function () {
71 HighchartsAdapter._extend(this.element);
72 // If this is the first animation on this object, create the _highcharts_animation helper that
73 // contain pointers to the animation objects.
74 if (!this.element._highchart_animation) {
75 this.element._highchart_animation = {};
76 }
77
78 // Store a reference to this animation instance.
79 this.element._highchart_animation[this.key] = this;
80 },
81 update: function (position) {
82 var paths = this.paths;
83
84 if (paths) {
85 position = pathAnim.step(paths[0], paths[1], position, this.toD);
86 }
87
88 this.element.attr(this.options.attribute, position);
89 },
90 finish: function () {
91 // Delete the property that holds this animation now that it is finished.
92 // Both canceled animations and complete ones gets a 'finish' call.
93 delete this.element._highchart_animation[this.key];
94 }
95 });
96 }
97 },
98
99 /**
100 * Custom events in prototype needs to be namespaced. This method adds a namespace 'h:' in front of
101 * events that are not recognized as native.
102 */
103 addNS: function (eventName) {
104 var HTMLEvents = /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
105 MouseEvents = /^(?:click|mouse(?:down|up|over|move|out))$/;
106 return (HTMLEvents.test(eventName) || MouseEvents.test(eventName)) ?
107 eventName :
108 'h:' + eventName;
109 },
110
111 // el needs an event to be attached. el is not necessarily a dom element
112 addEvent: function (el, event, fn) {
113 if (el.addEventListener || el.attachEvent) {
114 Event.observe($(el), HighchartsAdapter.addNS(event), fn);
115
116 } else {
117 HighchartsAdapter._extend(el);
118 el._highcharts_observe(event, fn);
119 }
120 },
121
122 // motion makes things pretty. use it if effects is loaded, if not... still get to the end result.
123 animate: function (el, params, options) {
124 var key,
125 fx;
126
127 // default options
128 options = options || {};
129 options.delay = 0;
130 options.duration = (options.duration || 500) / 1000;
131
132 // animate wrappers and DOM elements
133 if (hasEffect) {
134 for (key in params) {
135 // The fx variable is seemingly thrown away here, but the Effect.setup will add itself to the _highcharts_animation object
136 // on the element itself so its not really lost.
137 fx = new Effect.HighchartsTransition($(el), key, params[key], options);
138 }
139 } else {
140 for (key in params) {
141 el.attr(key, params[key]);
142 }
143 }
144
145 if (!el.attr) {
146 throw 'Todo: implement animate DOM objects';
147 }
148 },
149
150 // this only occurs in higcharts 2.0+
151 stop: function (el) {
152 var key;
153 if (el._highcharts_extended && el._highchart_animation) {
154 for (key in el._highchart_animation) {
155 // Cancel the animation
156 // The 'finish' function in the Effect object will remove the reference
157 el._highchart_animation[key].cancel();
158 }
159 }
160 },
161
162 // um.. each
163 each: function (arr, fn) {
164 $A(arr).each(fn);
165 },
166
167 // fire an event based on an event name (event) and an object (el).
168 // again, el may not be a dom element
169 fireEvent: function (el, event, eventArguments, defaultFunction) {
170 if (el.fire) {
171 el.fire(HighchartsAdapter.addNS(event), eventArguments);
172 } else if (el._highcharts_extended) {
173 eventArguments = eventArguments || {};
174 el._highcharts_fire(event, eventArguments);
175 }
176
177 if (eventArguments && eventArguments.defaultPrevented) {
178 defaultFunction = null;
179 }
180
181 if (defaultFunction) {
182 defaultFunction(eventArguments);
183 }
184 },
185
186 removeEvent: function (el, event, handler) {
187 if ($(el).stopObserving) {
188 if (event) {
189 event = HighchartsAdapter.addNS(event);
190 }
191 $(el).stopObserving(event, handler);
192 } if (window === el) {
193 Event.stopObserving(el, event, handler);
194 } else {
195 HighchartsAdapter._extend(el);
196 el._highcharts_stop_observing(event, handler);
197 }
198 },
199
200 // um, grep
201 grep: function (arr, fn) {
202 return arr.findAll(fn);
203 },
204
205 // um, map
206 map: function (arr, fn) {
207 return arr.map(fn);
208 },
209
210 // deep merge. merge({a : 'a', b : {b1 : 'b1', b2 : 'b2'}}, {b : {b2 : 'b2_prime'}, c : 'c'}) => {a : 'a', b : {b1 : 'b1', b2 : 'b2_prime'}, c : 'c'}
211 /*merge: function(){
212 function doCopy(copy, original) {
213 var value,
214 key,
215 undef,
216 nil,
217 same,
218 obj,
219 arr,
220 node;
221
222 for (key in original) {
223 value = original[key];
224 undef = typeof(value) === 'undefined';
225 nil = value === null;
226 same = original === copy[key];
227
228 if (undef || nil || same) {
229 continue;
230 }
231
232 obj = typeof(value) === 'object';
233 arr = value && obj && value.constructor == Array;
234 node = !!value.nodeType;
235
236 if (obj && !arr && !node) {
237 copy[key] = doCopy(typeof copy[key] == 'object' ? copy[key] : {}, value);
238 }
239 else {
240 copy[key] = original[key];
241 }
242 }
243 return copy;
244 }
245
246 var args = arguments, retVal = {};
247
248 for (var i = 0; i < args.length; i++) {
249 retVal = doCopy(retVal, args[i]);
250 }
251
252 return retVal;
253 },*/
254 merge: function () { // the built-in prototype merge function doesn't do deep copy
255 function doCopy(copy, original) {
256 var value, key;
257
258 for (key in original) {
259 value = original[key];
260 if (value && typeof value === 'object' && value.constructor !== Array &&
261 typeof value.nodeType !== 'number') {
262 copy[key] = doCopy(copy[key] || {}, value); // copy
263
264 } else {
265 copy[key] = original[key];
266 }
267 }
268 return copy;
269 }
270
271 function merge() {
272 var args = arguments,
273 i,
274 retVal = {};
275
276 for (i = 0; i < args.length; i++) {
277 retVal = doCopy(retVal, args[i]);
278
279 }
280 return retVal;
281 }
282
283 return merge.apply(this, arguments);
284 },
285
286 // extend an object to handle highchart events (highchart objects, not svg elements).
287 // this is a very simple way of handling events but whatever, it works (i think)
288 _extend: function (object) {
289 if (!object._highcharts_extended) {
290 Object.extend(object, {
291 _highchart_events: {},
292 _highchart_animation: null,
293 _highcharts_extended: true,
294 _highcharts_observe: function (name, fn) {
295 this._highchart_events[name] = [this._highchart_events[name], fn].compact().flatten();
296 },
297 _highcharts_stop_observing: function (name, fn) {
298 if (name) {
299 if (fn) {
300 this._highchart_events[name] = [this._highchart_events[name]].compact().flatten().without(fn);
301 } else {
302 delete this._highchart_events[name];
303 }
304 } else {
305 this._highchart_events = {};
306 }
307 },
308 _highcharts_fire: function (name, args) {
309 (this._highchart_events[name] || []).each(function (fn) {
310 // args is never null here
311 if (args.stopped) {
312 return; // "throw $break" wasn't working. i think because of the scope of 'this'.
313 }
314
315 // Attach a simple preventDefault function to skip default handler if called
316 args.preventDefault = function () {
317 args.defaultPrevented = true;
318 };
319
320 // If the event handler return false, prevent the default handler from executing
321 if (fn.bind(this)(args) === false) {
322 args.preventDefault();
323 }
324 }
325.bind(this));
326 }
327 });
328 }
329 }
330};
331}());
3320
=== removed file 'media/js/highcharts_219/highcharts.js'
--- media/js/highcharts_219/highcharts.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/highcharts.js 1970-01-01 00:00:00 +0000
@@ -1,176 +0,0 @@
1/*
2 Highcharts JS v2.1.9 (2011-11-11)
3
4 (c) 2009-2011 Torstein H?nsi
5
6 License: www.highcharts.com/license
7*/
8(function(){function sa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function ja(a,b){return parseInt(a,b||10)}function Sb(a){return typeof a==="string"}function Nb(a){return typeof a==="object"}function lc(a){return typeof a==="number"}function mc(a){return Fa.log(a)/Fa.LN10}function nc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function K(a){return a!==Wa&&a!==null}function Ga(a,b,c){var d,e;if(Sb(b))if(K(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(K(b)&&
9Nb(b))for(d in b)a.setAttribute(d,b[d]);return e}function zc(a){return Object.prototype.toString.call(a)==="[object Array]"?a:[a]}function A(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Ja(a,b){if(Pc)if(b&&b.opacity!==Wa)b.filter="alpha(opacity="+b.opacity*100+")";sa(a.style,b)}function hb(a,b,c,d,e){a=ua.createElement(a);b&&sa(a,b);e&&Ja(a,{padding:0,border:jb,margin:0});c&&Ja(a,c);d&&d.appendChild(a);return a}function yb(a,b){var c=
10function(){};c.prototype=new a;sa(c.prototype,b);return c}function Ed(a,b,c,d){var e=Xa.lang;a=a;var f=isNaN(b=bb(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(ja(a=bb(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+bb(a-c).toFixed(f).slice(2):"")}function Fd(a){var b={left:a.offsetLeft,top:a.offsetTop};for(a=a.offsetParent;a;){b.left+=a.offsetLeft;b.top+=a.offsetTop;
11if(a!==ua.body&&a!==ua.documentElement){b.left-=a.scrollLeft;b.top-=a.scrollTop}a=a.offsetParent}return b}function Gd(){this.symbol=this.color=0}function fe(a,b,c,d,e,f,g){var h=g.x;g=g.y;var i=h-a+c-25,j=g-b+d+10,m;if(i<7)i=c+h+15;if(i+a>c+e){i-=i+a-(c+e);j-=b;m=true}if(j<5){j=5;if(m&&g>=j&&g<=j+b)j=g+b-5}else if(j+b>d+f)j=d+f-b-5;return{x:i,y:j}}function Hd(a,b){var c=a.length,d;for(d=0;d<c;d++)a[d].ss_i=d;a.sort(function(e,f){var g=b(e,f);return g===0?e.ss_i-f.ss_i:g});for(d=0;d<c;d++)delete a[d].ss_i}
12function Ac(a){for(var b in a){a[b]&&a[b].destroy&&a[b].destroy();delete a[b]}}function oc(a,b){Bc=A(a,b.animation)}function Id(){var a=Xa.global.useUTC;Qc=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,c,A(d,1),A(e,0),A(f,0),A(g,0))).getTime()};id=a?"getUTCMinutes":"getMinutes";jd=a?"getUTCHours":"getHours";kd=a?"getUTCDay":"getDay";Cc=a?"getUTCDate":"getDate";Rc=a?"getUTCMonth":"getMonth";Sc=a?"getUTCFullYear":"getFullYear";Jd=a?"setUTCMinutes":"setMinutes";Kd=a?"setUTCHours":"setHours";ld=
13a?"setUTCDate":"setDate";Ld=a?"setUTCMonth":"setMonth";Md=a?"setUTCFullYear":"setFullYear"}function pc(a){Tc||(Tc=hb(Tb));a&&Tc.appendChild(a);Tc.innerHTML=""}function Uc(){}function Nd(a,b){function c(p){function q(k,n){this.pos=k;this.minor=n;this.isNew=true;n||this.addLabel()}function w(k){if(k){this.options=k;this.id=k.id}return this}function x(k,n,t,r){this.isNegative=n;this.options=k;this.x=t;this.stack=r;this.alignOptions={align:k.align||(va?n?"left":"right":"center"),verticalAlign:k.verticalAlign||
14(va?"middle":n?"bottom":"top"),y:A(k.y,va?4:n?14:-6),x:A(k.x,va?n?-6:6:0)};this.textAlign=k.textAlign||(va?n?"right":"left":"center")}function V(){var k=[],n=[],t;pa=wa=null;zb=[];u(Ha,function(r){t=false;u(["xAxis","yAxis"],function(F){if(r.isCartesian&&(F==="xAxis"&&xa||F==="yAxis"&&!xa)&&(r.options[F]===o.index||r.options[F]===Wa&&o.index===0)){r[F]=I;zb.push(r);t=true}});if(!r.visible&&z.ignoreHiddenSeries)t=false;if(t){var J,E,Q,fa,ka,$;if(!xa){J=r.options.stacking;Vc=J==="percent";if(J){ka=
15r.options.stack;fa=r.type+A(ka,"");$="-"+fa;r.stackKey=fa;E=k[fa]||[];k[fa]=E;Q=n[$]||[];n[$]=Q}if(Vc){pa=0;wa=99}}if(r.isCartesian){u(r.data,function(F){var O=F.x,S=F.y,aa=S<0,Eb=aa?Q:E,kb=aa?$:fa;if(pa===null)pa=wa=F[qa];if(xa)if(O>wa)wa=O;else{if(O<pa)pa=O}else if(K(S)){if(J)Eb[O]=K(Eb[O])?Eb[O]+S:S;S=Eb?Eb[O]:S;F=A(F.low,S);if(!Vc)if(S>wa)wa=S;else if(F<pa)pa=F;if(J){s[kb]||(s[kb]={});s[kb][O]||(s[kb][O]=new x(o.stackLabels,aa,O,ka));s[kb][O].setTotal(S)}}});if(/(area|column|bar)/.test(r.type)&&
16!xa)if(pa>=0){pa=0;Od=true}else if(wa<0){wa=0;Pd=true}}}})}function N(k,n){var t,r;Fb=n?1:Fa.pow(10,lb(Fa.log(k)/Fa.LN10));t=k/Fb;if(!n){n=[1,2,2.5,5,10];if(o.allowDecimals===false||ca)if(Fb===1)n=[1,2,5,10];else if(Fb<=0.1)n=[1/Fb]}for(r=0;r<n.length;r++){k=n[r];if(t<=(n[r]+(n[r+1]||n[r]))/2)break}k*=Fb;return k}function ta(k){var n;n=k;Fb=A(Fb,Fa.pow(10,lb(Fa.log(Ta)/Fa.LN10)));if(Fb<1){n=W(1/Fb)*10;n=W(k*n)/n}return n}function da(){var k,n,t,r,J=o.tickInterval,E=o.tickPixelInterval;k=o.maxZoom||
17(xa&&!K(o.min)&&!K(o.max)?tb(l.smallestInterval*5,wa-pa):null);ya=R?Da:Aa;if(Ub){t=l[xa?"xAxis":"yAxis"][o.linkedTo];r=t.getExtremes();ia=A(r.min,r.dataMin);ra=A(r.max,r.dataMax)}else{ia=A(Vb,o.min,pa);ra=A(Gb,o.max,wa)}if(ca){ia=mc(ia);ra=mc(ra)}if(ra-ia<k){r=(k-ra+ia)/2;ia=Ia(ia-r,A(o.min,ia-r),pa);ra=tb(ia+k,A(o.max,ia+k),wa)}if(!Ya&&!Vc&&!Ub&&K(ia)&&K(ra)){k=ra-ia||1;if(!K(o.min)&&!K(Vb)&&Qd&&(pa<0||!Od))ia-=k*Qd;if(!K(o.max)&&!K(Gb)&&Rd&&(wa>0||!Pd))ra+=k*Rd}Ta=ia===ra?1:Ub&&!J&&E===t.options.tickPixelInterval?
18t.tickInterval:A(J,Ya?1:(ra-ia)*E/ya);if(!D&&!K(o.tickInterval))Ta=N(Ta);I.tickInterval=Ta;Wc=o.minorTickInterval==="auto"&&Ta?Ta/5:o.minorTickInterval;if(D){Ba=[];J=Xa.global.useUTC;var Q=1E3/ub,fa=6E4/ub,ka=36E5/ub;E=864E5/ub;k=6048E5/ub;r=2592E6/ub;var $=31556952E3/ub,F=[["second",Q,[1,2,5,10,15,30]],["minute",fa,[1,2,5,10,15,30]],["hour",ka,[1,2,3,4,6,8,12]],["day",E,[1,2]],["week",k,[1,2]],["month",r,[1,2,3,4,6]],["year",$,null]],O=F[6],S=O[1],aa=O[2];for(t=0;t<F.length;t++){O=F[t];S=O[1];aa=
19O[2];if(F[t+1])if(Ta<=(S*aa[aa.length-1]+F[t+1][1])/2)break}if(S===$&&Ta<5*S)aa=[1,2,5];F=N(Ta/S,aa);aa=new Date(ia*ub);aa.setMilliseconds(0);if(S>=Q)aa.setSeconds(S>=fa?0:F*lb(aa.getSeconds()/F));if(S>=fa)aa[Jd](S>=ka?0:F*lb(aa[id]()/F));if(S>=ka)aa[Kd](S>=E?0:F*lb(aa[jd]()/F));if(S>=E)aa[ld](S>=r?1:F*lb(aa[Cc]()/F));if(S>=r){aa[Ld](S>=$?0:F*lb(aa[Rc]()/F));n=aa[Sc]()}if(S>=$){n-=n%F;aa[Md](n)}S===k&&aa[ld](aa[Cc]()-aa[kd]()+o.startOfWeek);t=1;n=aa[Sc]();Q=aa.getTime()/ub;fa=aa[Rc]();for(ka=aa[Cc]();Q<
20ra&&t<Da;){Ba.push(Q);if(S===$)Q=Qc(n+t*F,0)/ub;else if(S===r)Q=Qc(n,fa+t*F)/ub;else if(!J&&(S===E||S===k))Q=Qc(n,fa,ka+t*F*(S===E?1:7));else Q+=S*F;t++}Ba.push(Q);Xc=o.dateTimeLabelFormats[O[0]]}else{t=ta(lb(ia/Ta)*Ta);n=ta(md(ra/Ta)*Ta);Ba=[];for(t=ta(t);t<=n;){Ba.push(t);t=ta(t+Ta)}}if(!Ub){if(Ya||xa&&l.hasColumn){n=(Ya?1:Ta)*0.5;if(Ya||!K(A(o.min,Vb)))ia-=n;if(Ya||!K(A(o.max,Gb)))ra+=n}n=Ba[0];t=Ba[Ba.length-1];if(o.startOnTick)ia=n;else ia>n&&Ba.shift();if(o.endOnTick)ra=t;else ra<t&&Ba.pop();
21Ob||(Ob={x:0,y:0});if(!D&&Ba.length>Ob[qa])Ob[qa]=Ba.length}}function Ma(){var k,n;Dc=ia;Sd=ra;V();da();Hb=fb;fb=ya/(ra-ia||1);if(!xa)for(k in s)for(n in s[k])s[k][n].cum=s[k][n].total;if(!I.isDirty)I.isDirty=ia!==Dc||ra!==Sd}function za(k){k=(new w(k)).render();Pb.push(k);return k}function eb(){var k=o.title,n=o.stackLabels,t=o.alternateGridColor,r=o.lineWidth,J,E,Q=(J=l.hasRendered)&&K(Dc)&&!isNaN(Dc);E=zb.length&&K(ia)&&K(ra);ya=R?Da:Aa;fb=ya/(ra-ia||1);cc=R?X:vb;if(E||Ub){if(Wc&&!Ya)for(E=ia+
22(Ba[0]-ia)%Wc;E<=ra;E+=Wc){Wb[E]||(Wb[E]=new q(E,true));Q&&Wb[E].isNew&&Wb[E].render(null,true);Wb[E].isActive=true;Wb[E].render()}u(Ba,function($,F){if(!Ub||$>=ia&&$<=ra){Q&&mb[$].isNew&&mb[$].render(F,true);mb[$].isActive=true;mb[$].render(F)}});t&&u(Ba,function($,F){if(F%2===0&&$<ra){dc[$]||(dc[$]=new w);dc[$].options={from:$,to:Ba[F+1]!==Wa?Ba[F+1]:ra,color:t};dc[$].render();dc[$].isActive=true}});J||u((o.plotLines||[]).concat(o.plotBands||[]),function($){Pb.push((new w($)).render())})}u([mb,
23Wb,dc],function($){for(var F in $)if($[F].isActive)$[F].isActive=false;else{$[F].destroy();delete $[F]}});if(r){J=X+(Oa?Da:0)+la;E=cb-vb-(Oa?Aa:0)+la;J=ga.crispLine([Za,R?X:J,R?E:ea,Ka,R?$a-Ib:J,R?E:cb-vb],r);if(La)La.animate({d:J});else La=ga.path(J).attr({stroke:o.lineColor,"stroke-width":r,zIndex:7}).add()}if(ba){J=R?X:ea;r=ja(k.style.fontSize||12);J={low:J+(R?0:ya),middle:J+ya/2,high:J+(R?ya:0)}[k.align];r=(R?ea+Aa:X)+(R?1:-1)*(Oa?-1:1)*nd+(L===2?r:0);ba[ba.isNew?"attr":"animate"]({x:R?J:r+(Oa?
24Da:0)+la+(k.x||0),y:R?r-(Oa?Aa:0)+la:J+(k.y||0)});ba.isNew=false}if(n&&n.enabled){var fa,ka;n=I.stackTotalGroup;if(!n)I.stackTotalGroup=n=ga.g("stack-labels").attr({visibility:Ab,zIndex:6}).translate(X,ea).add();for(fa in s){k=s[fa];for(ka in k)k[ka].render(n)}}I.isDirty=false}function ab(k){for(var n=Pb.length;n--;)Pb[n].id===k&&Pb[n].destroy()}var xa=p.isX,Oa=p.opposite,R=va?!xa:xa,L=R?Oa?0:2:Oa?1:3,s={},o=Ca(xa?Yc:od,[ge,he,Td,ie][L],p),I=this,ba,B=o.type,D=B==="datetime",ca=B==="logarithmic",
25la=o.offset||0,qa=xa?"x":"y",ya,fb,Hb,cc=R?X:vb,G,ha,na,Ra,La,pa,wa,zb,Vb,Gb,ra=null,ia=null,Dc,Sd,Qd=o.minPadding,Rd=o.maxPadding,Ub=K(o.linkedTo),Od,Pd,Vc;B=o.events;var pd,Pb=[],Ta,Wc,Fb,Ba,mb={},Wb={},dc={},qc,rc,nd,Xc,Ya=o.categories,je=o.labels.formatter||function(){var k=this.value;return Xc?Zc(Xc,k):Ta%1E6===0?k/1E6+"M":Ta%1E3===0?k/1E3+"k":!Ya&&k>=1E3?Ed(k,0):k},$c=R&&o.labels.staggerLines,ec=o.reversed,fc=Ya&&o.tickmarkPlacement==="between"?0.5:0;q.prototype={addLabel:function(){var k=this.pos,
26n=o.labels,t=!(k===ia&&!A(o.showFirstLabel,1)||k===ra&&!A(o.showLastLabel,0)),r=Ya&&R&&Ya.length&&!n.step&&!n.staggerLines&&!n.rotation&&Da/Ya.length||!R&&Da/2,J=Ya&&K(Ya[k])?Ya[k]:k,E=this.label;k=je.call({isFirst:k===Ba[0],isLast:k===Ba[Ba.length-1],dateTimeLabelFormat:Xc,value:ca?Fa.pow(10,J):J});r=r&&{width:Ia(1,W(r-2*(n.padding||10)))+Ua};r=sa(r,n.style);if(E===Wa)this.label=K(k)&&t&&n.enabled?ga.text(k,0,0,n.useHTML).attr({align:n.align,rotation:n.rotation}).css(r).add(na):null;else E&&E.attr({text:k}).css(r)},
27getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[R?"height":"width"]:0},render:function(k,n){var t=!this.minor,r=this.label,J=this.pos,E=o.labels,Q=this.gridLine,fa=t?o.gridLineWidth:o.minorGridLineWidth,ka=t?o.gridLineColor:o.minorGridLineColor,$=t?o.gridLineDashStyle:o.minorGridLineDashStyle,F=this.mark,O=t?o.tickLength:o.minorTickLength,S=t?o.tickWidth:o.minorTickWidth||0,aa=t?o.tickColor:o.minorTickColor,Eb=t?o.tickPosition:o.minorTickPosition,kb=E.step,nb=n&&ad||
28cb,Qb;Qb=R?G(J+fc,null,null,n)+cc:X+la+(Oa?(n&&qd||$a)-Ib-X:0);nb=R?nb-vb+la-(Oa?Aa:0):nb-G(J+fc,null,null,n)-cc;if(fa){J=ha(J+fc,fa,n);if(Q===Wa){Q={stroke:ka,"stroke-width":fa};if($)Q.dashstyle=$;if(t)Q.zIndex=1;this.gridLine=Q=fa?ga.path(J).attr(Q).add(Ra):null}!n&&Q&&J&&Q.animate({d:J})}if(S){if(Eb==="inside")O=-O;if(Oa)O=-O;t=ga.crispLine([Za,Qb,nb,Ka,Qb+(R?0:-O),nb+(R?O:0)],S);if(F)F.animate({d:t});else this.mark=ga.path(t).attr({stroke:aa,"stroke-width":S}).add(na)}if(r&&!isNaN(Qb)){Qb=Qb+
29E.x-(fc&&R?fc*fb*(ec?-1:1):0);nb=nb+E.y-(fc&&!R?fc*fb*(ec?1:-1):0);K(E.y)||(nb+=ja(r.styles.lineHeight)*0.9-r.getBBox().height/2);if($c)nb+=k/(kb||1)%$c*16;if(kb)r[k%kb?"hide":"show"]();r[this.isNew?"attr":"animate"]({x:Qb,y:nb})}this.isNew=false},destroy:function(){Ac(this)}};w.prototype={render:function(){var k=this,n=k.options,t=n.label,r=k.label,J=n.width,E=n.to,Q=n.from,fa=n.value,ka,$=n.dashStyle,F=k.svgElem,O=[],S,aa,Eb=n.color;aa=n.zIndex;var kb=n.events;if(ca){Q=mc(Q);E=mc(E);fa=mc(fa)}if(J){O=
30ha(fa,J);n={stroke:Eb,"stroke-width":J};if($)n.dashstyle=$}else if(K(Q)&&K(E)){Q=Ia(Q,ia);E=tb(E,ra);ka=ha(E);if((O=ha(Q))&&ka)O.push(ka[4],ka[5],ka[1],ka[2]);else O=null;n={fill:Eb}}else return;if(K(aa))n.zIndex=aa;if(F)if(O)F.animate({d:O},null,F.onGetPath);else{F.hide();F.onGetPath=function(){F.show()}}else if(O&&O.length){k.svgElem=F=ga.path(O).attr(n).add();if(kb){$=function(nb){F.on(nb,function(Qb){kb[nb].apply(k,[Qb])})};for(S in kb)$(S)}}if(t&&K(t.text)&&O&&O.length&&Da>0&&Aa>0){t=Ca({align:R&&
31ka&&"center",x:R?!ka&&4:10,verticalAlign:!R&&ka&&"middle",y:R?ka?16:10:ka?6:-4,rotation:R&&!ka&&90},t);if(!r)k.label=r=ga.text(t.text,0,0).attr({align:t.textAlign||t.align,rotation:t.rotation,zIndex:aa}).css(t.style).add();ka=[O[1],O[4],A(O[6],O[1])];O=[O[2],O[5],A(O[7],O[2])];S=tb.apply(Fa,ka);aa=tb.apply(Fa,O);r.align(t,false,{x:S,y:aa,width:Ia.apply(Fa,ka)-S,height:Ia.apply(Fa,O)-aa});r.show()}else r&&r.hide();return k},destroy:function(){Ac(this);nc(Pb,this)}};x.prototype={destroy:function(){Ac(this)},
32setTotal:function(k){this.cum=this.total=k},render:function(k){var n=this.options.formatter.call(this);if(this.label)this.label.attr({text:n,visibility:ob});else this.label=l.renderer.text(n,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:ob}).add(k)},setOffset:function(k,n){var t=this.isNegative,r=I.translate(this.total),J=I.translate(0);J=bb(r-J);var E=l.xAxis[0].translate(this.x)+k,Q=l.plotHeight;t={x:va?t?r:r-J:E,y:va?Q-E-n:t?Q-r-J:Q-r,width:va?
33J:n,height:va?n:J};this.label&&this.label.align(this.alignOptions,null,t).attr({visibility:Ab})}};G=function(k,n,t,r,J){var E=1,Q=0,fa=r?Hb:fb;r=r?Dc:ia;fa||(fa=fb);if(t){E*=-1;Q=ya}if(ec){E*=-1;Q-=E*ya}if(n){if(ec)k=ya-k;k=k/fa+r;if(ca&&J)k=Fa.pow(10,k)}else{if(ca&&J)k=mc(k);k=E*(k-r)*fa+Q}return k};ha=function(k,n,t){var r,J,E;k=G(k,null,null,t);var Q=t&&ad||cb,fa=t&&qd||$a,ka;t=J=W(k+cc);r=E=W(Q-k-cc);if(isNaN(k))ka=true;else if(R){r=ea;E=Q-vb;if(t<X||t>X+Da)ka=true}else{t=X;J=fa-Ib;if(r<ea||r>
34ea+Aa)ka=true}return ka?null:ga.crispLine([Za,t,r,Ka,J,E],n||0)};if(va&&xa&&ec===Wa)ec=true;sa(I,{addPlotBand:za,addPlotLine:za,adjustTickAmount:function(){if(Ob&&!D&&!Ya&&!Ub){var k=qc,n=Ba.length;qc=Ob[qa];if(n<qc){for(;Ba.length<qc;)Ba.push(ta(Ba[Ba.length-1]+Ta));fb*=(n-1)/(qc-1);ra=Ba[Ba.length-1]}if(K(k)&&qc!==k)I.isDirty=true}},categories:Ya,getExtremes:function(){return{min:ia,max:ra,dataMin:pa,dataMax:wa,userMin:Vb,userMax:Gb}},getPlotLinePath:ha,getThreshold:function(k){if(ia>k)k=ia;else if(ra<
35k)k=ra;return G(k,0,1)},isXAxis:xa,options:o,plotLinesAndBands:Pb,getOffset:function(){var k=zb.length&&K(ia)&&K(ra),n=0,t=0,r=o.title,J=o.labels,E=[-1,1,1,-1][L],Q;if(!na){na=ga.g("axis").attr({zIndex:7}).add();Ra=ga.g("grid").attr({zIndex:1}).add()}rc=0;if(k||Ub){u(Ba,function(fa){if(mb[fa])mb[fa].addLabel();else mb[fa]=new q(fa);if(L===0||L===2||{1:"left",3:"right"}[L]===J.align)rc=Ia(mb[fa].getLabelSize(),rc)});if($c)rc+=($c-1)*16}else for(Q in mb){mb[Q].destroy();delete mb[Q]}if(r&&r.text){if(!ba){ba=
36I.axisTitle=ga.text(r.text,0,0,r.useHTML).attr({zIndex:7,rotation:r.rotation||0,align:r.textAlign||{low:"left",middle:"center",high:"right"}[r.align]}).css(r.style).add();ba.isNew=true}n=ba.getBBox()[R?"height":"width"];t=A(r.margin,R?5:10)}la=E*(o.offset||Xb[L]);nd=rc+(L!==2&&rc&&E*o.labels[R?"y":"x"])+t;Xb[L]=Ia(Xb[L],nd+n+E*la)},render:eb,setCategories:function(k,n){I.categories=p.categories=Ya=k;u(zb,function(t){t.translate();t.setTooltipPoints(true)});I.isDirty=true;A(n,true)&&l.redraw()},setExtremes:function(k,
37n,t,r){t=A(t,true);Pa(I,"setExtremes",{min:k,max:n},function(){Vb=k;Gb=n;t&&l.redraw(r)})},setScale:Ma,setTickPositions:da,translate:G,redraw:function(){Yb.resetTracker&&Yb.resetTracker();eb();u(Pb,function(k){k.render()});u(zb,function(k){k.isDirty=true})},removePlotBand:ab,removePlotLine:ab,reversed:ec,stacks:s,destroy:function(){var k;pb(I);for(k in s){Ac(s[k]);s[k]=null}if(I.stackTotalGroup)I.stackTotalGroup=I.stackTotalGroup.destroy();u([mb,Wb,dc,Pb],function(n){Ac(n)});u([La,na,Ra,ba],function(n){n&&
38n.destroy()});La=na=Ra=ba=null}});for(pd in B)Qa(I,pd,B[pd]);Ma()}function d(){var p={};return{add:function(q,w,x,V){if(!p[q]){w=ga.text(w,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Ib-20,y:ea+30}).on("click",V).attr({align:"right",zIndex:20}).add();p[q]=w}},remove:function(q){pc(p[q].element);p[q]=null}}}function e(p){function q(){var B=this.points||zc(this),D=B[0].series.xAxis,ca=this.x;D=D&&D.options.type==="datetime";var la=Sb(ca)||D,qa;qa=la?['<span style="font-size: 10px">'+(D?Zc("%A, %b %e, %Y",
39ca):ca)+"</span>"]:[];u(B,function(ya){qa.push(ya.point.tooltipFormatter(la))});return qa.join("<br/>")}function w(B,D){L=xa?B:(2*L+B)/3;s=xa?D:(s+D)/2;o.translate(L,s);rd=bb(B-L)>1||bb(D-s)>1?function(){w(B,D)}:null}function x(){if(!xa){var B=l.hoverPoints;o.hide();u(da,function(D){D&&D.hide()});B&&u(B,function(D){D.setState()});l.hoverPoints=null;xa=true}}var V,N=p.borderWidth,ta=p.crosshairs,da=[],Ma=p.style,za=p.shared,eb=ja(Ma.padding),ab=N+eb,xa=true,Oa,R,L=0,s=0;Ma.padding=0;var o=ga.g("tooltip").attr({zIndex:8}).add(),
40I=ga.rect(ab,ab,0,0,p.borderRadius,N).attr({fill:p.backgroundColor,"stroke-width":N}).add(o).shadow(p.shadow),ba=ga.text("",eb+ab,ja(Ma.fontSize)+eb+ab,p.useHTML).attr({zIndex:1}).css(Ma).add(o);o.hide();return{shared:za,refresh:function(B){var D,ca,la,qa=0,ya={},fb=[];la=B.tooltipPos;D=p.formatter||q;ya=l.hoverPoints;if(za){ya&&u(ya,function(Hb){Hb.setState()});l.hoverPoints=B;u(B,function(Hb){Hb.setState(Bb);qa+=Hb.plotY;fb.push(Hb.getLabelConfig())});ca=B[0].plotX;qa=W(qa)/B.length;ya={x:B[0].category};
41ya.points=fb;B=B[0]}else ya=B.getLabelConfig();ya=D.call(ya);V=B.series;ca=za?ca:B.plotX;qa=za?qa:B.plotY;D=W(la?la[0]:va?Da-qa:ca);ca=W(la?la[1]:va?Aa-ca:qa);la=za||!B.series.isCartesian||gc(D,ca);if(ya===false||!la)x();else{if(xa){o.show();xa=false}ba.attr({text:ya});la=ba.getBBox();Oa=la.width+2*eb;R=la.height+2*eb;I.attr({width:Oa,height:R,stroke:p.borderColor||B.color||V.color||"#606060"});D=fe(Oa,R,X,ea,Da,Aa,{x:D,y:ca});w(W(D.x-ab),W(D.y-ab))}if(ta){ta=zc(ta);for(D=ta.length;D--;){ca=B.series[D?
42"yAxis":"xAxis"];if(ta[D]&&ca){ca=ca.getPlotLinePath(B[D?"y":"x"],1);if(da[D])da[D].attr({d:ca,visibility:Ab});else{la={"stroke-width":ta[D].width||1,stroke:ta[D].color||"#C0C0C0",zIndex:2};if(ta[D].dashStyle)la.dashstyle=ta[D].dashStyle;da[D]=ga.path(ca).attr(la).add()}}}}},hide:x,destroy:function(){u(da,function(B){B&&B.destroy()});u([I,ba,o],function(B){B&&B.destroy()});I=ba=o=null}}}function f(p){function q(L){var s,o=Ud&&ua.width/ua.body.scrollWidth-1,I,ba,B;L=L||db.event;if(!L.target)L.target=
43L.srcElement;s=L.touches?L.touches.item(0):L;if(L.type!=="mousemove"||db.opera||o){Jb=Fd(oa);I=Jb.left;ba=Jb.top}if(Pc){B=L.x;s=L.y}else if(s.layerX===Wa){B=s.pageX-I;s=s.pageY-ba}else{B=L.layerX;s=L.layerY}if(o){B+=W((o+1)*I-I);s+=W((o+1)*ba-ba)}return sa(L,{chartX:B,chartY:s})}function w(L){var s={xAxis:[],yAxis:[]};u(Va,function(o){var I=o.translate,ba=o.isXAxis;s[ba?"xAxis":"yAxis"].push({axis:o,value:I((va?!ba:ba)?L.chartX-X:Aa-L.chartY+ea,true)})});return s}function x(){var L=l.hoverSeries,
44s=l.hoverPoint;s&&s.onMouseOut();L&&L.onMouseOut();hc&&hc.hide();sd=null}function V(){if(za){var L={xAxis:[],yAxis:[]},s=za.getBBox(),o=s.x-X,I=s.y-ea;if(Ma){u(Va,function(ba){var B=ba.translate,D=ba.isXAxis,ca=va?!D:D,la=B(ca?o:Aa-I-s.height,true,0,0,1);B=B(ca?o+s.width:Aa-I,true,0,0,1);L[D?"xAxis":"yAxis"].push({axis:ba,min:tb(la,B),max:Ia(la,B)})});Pa(l,"selection",L,td)}za=za.destroy()}l.mouseIsDown=ud=Ma=false;pb(ua,Kb?"touchend":"mouseup",V)}function N(L){var s=K(L.pageX)?L.pageX:L.page.x;L=
45K(L.pageX)?L.pageY:L.page.y;Jb&&!gc(s-Jb.left-X,L-Jb.top-ea)&&x()}var ta,da,Ma,za,eb=z.zoomType,ab=/x/.test(eb),xa=/y/.test(eb),Oa=ab&&!va||xa&&va,R=xa&&!va||ab&&va;bd=function(){if(Ec){Ec.translate(X,ea);va&&Ec.attr({width:l.plotWidth,height:l.plotHeight}).invert()}else l.trackerGroup=Ec=ga.g("tracker").attr({zIndex:9}).add()};bd();if(p.enabled)l.tooltip=hc=e(p);(function(){oa.onmousedown=function(s){s=q(s);!Kb&&s.preventDefault&&s.preventDefault();l.mouseIsDown=ud=true;ta=s.chartX;da=s.chartY;Qa(ua,
46Kb?"touchend":"mouseup",V)};var L=function(s){if(!(s&&s.touches&&s.touches.length>1)){s=q(s);if(!Kb)s.returnValue=false;var o=s.chartX,I=s.chartY,ba=!gc(o-X,I-ea);Jb||(Jb=Fd(oa));if(Kb&&s.type==="touchstart")if(Ga(s.target,"isTracker"))l.runTrackerClick||s.preventDefault();else!ke&&!ba&&s.preventDefault();if(ba){if(o<X)o=X;else if(o>X+Da)o=X+Da;if(I<ea)I=ea;else if(I>ea+Aa)I=ea+Aa}if(ud&&s.type!=="touchstart"){Ma=Math.sqrt(Math.pow(ta-o,2)+Math.pow(da-I,2));if(Ma>10){if(sc&&(ab||xa)&&gc(ta-X,da-ea))za||
47(za=ga.rect(X,ea,Oa?1:Da,R?1:Aa,0).attr({fill:z.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Oa){o=o-ta;za.attr({width:bb(o),x:(o>0?0:o)+ta})}if(za&&R){I=I-da;za.attr({height:bb(I),y:(I>0?0:I)+da})}}}else if(!ba){var B;I=l.hoverPoint;o=l.hoverSeries;var D,ca,la=$a,qa=va?s.chartY:s.chartX-X;if(hc&&p.shared){B=[];D=Ha.length;for(ca=0;ca<D;ca++)if(Ha[ca].visible&&Ha[ca].tooltipPoints.length){s=Ha[ca].tooltipPoints[qa];s._dist=bb(qa-s.plotX);la=tb(la,s._dist);B.push(s)}for(D=
48B.length;D--;)B[D]._dist>la&&B.splice(D,1);if(B.length&&B[0].plotX!==sd){hc.refresh(B);sd=B[0].plotX}}if(o&&o.tracker)(s=o.tooltipPoints[qa])&&s!==I&&s.onMouseOver()}return ba||!sc}};oa.onmousemove=L;Qa(oa,"mouseleave",x);Qa(ua,"mousemove",N);oa.ontouchstart=function(s){if(ab||xa)oa.onmousedown(s);L(s)};oa.ontouchmove=L;oa.ontouchend=function(){Ma&&x()};oa.onclick=function(s){var o=l.hoverPoint;s=q(s);s.cancelBubble=true;if(!Ma)if(o&&Ga(s.target,"isTracker")){var I=o.plotX,ba=o.plotY;sa(o,{pageX:Jb.left+
49X+(va?Da-ba:I),pageY:Jb.top+ea+(va?Aa-I:ba)});Pa(o.series,"click",sa(s,{point:o}));o.firePointEvent("click",s)}else{sa(s,w(s));gc(s.chartX-X,s.chartY-ea)&&Pa(l,"click",s)}Ma=false}})();Vd=setInterval(function(){rd&&rd()},32);sa(this,{zoomX:ab,zoomY:xa,resetTracker:x,destroy:function(){if(l.trackerGroup)l.trackerGroup=Ec=l.trackerGroup.destroy();pb(ua,"mousemove",N);oa.onclick=oa.onmousedown=oa.onmousemove=oa.ontouchstart=oa.ontouchend=oa.ontouchmove=null}})}function g(p){var q=p.type||z.type||z.defaultSeriesType,
50w=wb[q],x=l.hasRendered;if(x)if(va&&q==="column")w=wb.bar;else if(!va&&q==="bar")w=wb.column;q=new w;q.init(l,p);if(!x&&q.inverted)va=true;if(q.isCartesian)sc=q.isCartesian;Ha.push(q);return q}function h(){z.alignTicks!==false&&u(Va,function(p){p.adjustTickAmount()});Ob=null}function i(p){var q=l.isDirtyLegend,w,x=l.isDirtyBox,V=Ha.length,N=V,ta=l.clipRect;for(oc(p,l);N--;){p=Ha[N];if(p.isDirty&&p.options.stacking){w=true;break}}if(w)for(N=V;N--;){p=Ha[N];if(p.options.stacking)p.isDirty=true}u(Ha,
51function(da){if(da.isDirty){da.cleanData();da.getSegments();if(da.options.legendType==="point")q=true}});if(q&&Fc.renderLegend){Fc.renderLegend();l.isDirtyLegend=false}if(sc){if(!cd){Ob=null;u(Va,function(da){da.setScale()})}h();Gc();u(Va,function(da){if(da.isDirty||x){da.redraw();x=true}})}if(x){vd();bd();if(ta){Hc(ta);ta.animate({width:l.plotSizeX,height:l.plotSizeY})}}u(Ha,function(da){if(da.isDirty&&da.visible&&(!da.isCartesian||da.xAxis))da.redraw()});Yb&&Yb.resetTracker&&Yb.resetTracker();Pa(l,
52"redraw")}function j(){var p=a.xAxis||{},q=a.yAxis||{},w;p=zc(p);u(p,function(x,V){x.index=V;x.isX=true});q=zc(q);u(q,function(x,V){x.index=V});Va=p.concat(q);l.xAxis=[];l.yAxis=[];Va=tc(Va,function(x){w=new c(x);l[w.isXAxis?"xAxis":"yAxis"].push(w);return w});h()}function m(p,q){uc=Ca(a.title,p);Ic=Ca(a.subtitle,q);u([["title",p,uc],["subtitle",q,Ic]],function(w){var x=w[0],V=l[x],N=w[1];w=w[2];if(V&&N)V=V.destroy();if(w&&w.text&&!V)l[x]=ga.text(w.text,0,0,w.useHTML).attr({align:w.align,"class":"highcharts-"+
53x,zIndex:1}).css(w.style).add().align(w,false,Rb)})}function v(){qb=z.renderTo;Wd=vc+wd++;if(Sb(qb))qb=ua.getElementById(qb);qb.innerHTML="";if(!qb.offsetWidth){Zb=qb.cloneNode(0);Ja(Zb,{position:ic,top:"-9999px",display:""});ua.body.appendChild(Zb)}dd=(Zb||qb).offsetWidth;Jc=(Zb||qb).offsetHeight;l.chartWidth=$a=z.width||dd||600;l.chartHeight=cb=z.height||(Jc>19?Jc:400);l.container=oa=hb(Tb,{className:"highcharts-container"+(z.className?" "+z.className:""),id:Wd},sa({position:Xd,overflow:ob,width:$a+
54Ua,height:cb+Ua,textAlign:"left"},z.style),Zb||qb);l.renderer=ga=z.forExport?new ed(oa,$a,cb,true):new fd(oa,$a,cb);var p,q;if(Yd&&oa.getBoundingClientRect){p=function(){Ja(oa,{left:0,top:0});q=oa.getBoundingClientRect();Ja(oa,{left:-(q.left-ja(q.left))+Ua,top:-(q.top-ja(q.top))+Ua})};p();Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}}function P(){function p(){var w=z.width||qb.offsetWidth,x=z.height||qb.offsetHeight;if(w&&x){if(w!==dd||x!==Jc){clearTimeout(q);q=setTimeout(function(){xd(w,
55x,false)},100)}dd=w;Jc=x}}var q;Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}function T(){Pa(l,"endResize",null,function(){cd-=1})}function Y(){var p=a.labels,q=a.credits,w;m();Fc=l.legend=new le;Gc();u(Va,function(x){x.setTickPositions(true)});h();Gc();vd();sc&&u(Va,function(x){x.render()});if(!l.seriesGroup)l.seriesGroup=ga.g("series-group").attr({zIndex:3}).add();u(Ha,function(x){x.translate();x.setTooltipPoints();x.render()});p.items&&u(p.items,function(){var x=sa(p.style,this.style),
56V=ja(x.left)+X,N=ja(x.top)+ea+12;delete x.left;delete x.top;ga.text(this.html,V,N).attr({zIndex:2}).css(x).add()});if(!l.toolbar)l.toolbar=d();if(q.enabled&&!l.credits){w=q.href;l.credits=ga.text(q.text,0,0).on("click",function(){if(w)location.href=w}).attr({align:q.position.align,zIndex:8}).css(q.style).add().align(q.position)}bd();l.hasRendered=true;if(Zb){qb.appendChild(oa);pc(Zb)}}function H(){var p,q=oa&&oa.parentNode;if(l!==null){Pa(l,"destroy");pb(db,"unload",H);pb(l);for(p=Va.length;p--;)Va[p]=
57Va[p].destroy();for(p=Ha.length;p--;)Ha[p]=Ha[p].destroy();u(["title","subtitle","seriesGroup","clipRect","credits","tracker"],function(w){var x=l[w];if(x)l[w]=x.destroy()});u([wc,xc,Kc,Fc,hc,ga,Yb],function(w){w&&w.destroy&&w.destroy()});wc=xc=Kc=Fc=hc=ga=Yb=null;if(oa){oa.innerHTML="";pb(oa);q&&pc(oa);oa=null}clearInterval(Vd);for(p in l)delete l[p];l=null}}function U(){if(!Lc&&db==db.top&&ua.readyState!=="complete")ua.attachEvent("onreadystatechange",function(){ua.detachEvent("onreadystatechange",
58U);ua.readyState==="complete"&&U()});else{v();yd();zd();u(a.series||[],function(p){g(p)});l.inverted=va=A(va,a.chart.inverted);j();l.render=Y;l.tracker=Yb=new f(a.tooltip);Y();Pa(l,"load");b&&b.apply(l,[l]);u(l.callbacks,function(p){p.apply(l,[l])})}}Yc=Ca(Yc,Xa.xAxis);od=Ca(od,Xa.yAxis);Xa.xAxis=Xa.yAxis=null;a=Ca(Xa,a);var z=a.chart,M=z.margin;M=Nb(M)?M:[M,M,M,M];var y=A(z.marginTop,M[0]),C=A(z.marginRight,M[1]),Z=A(z.marginBottom,M[2]),Sa=A(z.marginLeft,M[3]),Na=z.spacingTop,Ea=z.spacingRight,
59gb=z.spacingBottom,Lb=z.spacingLeft,Rb,uc,Ic,ea,Ib,vb,X,Xb,qb,Zb,oa,Wd,dd,Jc,$a,cb,qd,ad,wc,Kc,Ad,xc,l=this,ke=(M=z.events)&&!!M.click,Bd,gc,hc,ud,jc,Zd,Cd,Aa,Da,Yb,Ec,bd,Fc,$b,ac,Jb,sc=z.showAxes,cd=0,Va=[],Ob,Ha=[],va,ga,rd,Vd,sd,vd,Gc,yd,zd,xd,td,$d,le=function(){function p(G,ha){var na=G.legendItem,Ra=G.legendLine,La=G.legendSymbol,pa=Oa.color,wa=ha?N.itemStyle.color:pa,zb=ha?G.color:pa;pa=ha?G.pointAttr[ib]:{stroke:pa,fill:pa};na&&na.css({fill:wa});Ra&&Ra.attr({stroke:zb});La&&La.attr(pa)}function q(G,
60ha,na){var Ra=G.legendItem,La=G.legendLine,pa=G.legendSymbol;G=G.checkbox;Ra&&Ra.attr({x:ha,y:na});La&&La.translate(ha,na-4);pa&&pa.attr({x:ha+pa.xOff,y:na+pa.yOff});if(G){G.x=ha;G.y=na}}function w(){u(za,function(G){var ha=G.checkbox,na=qa.alignAttr;ha&&Ja(ha,{left:na.translateX+G.legendItemWidth+ha.x-40+Ua,top:na.translateY+ha.y-11+Ua})})}function x(G){var ha,na,Ra,La,pa=G.legendItem;La=G.series||G;var wa=La.options,zb=wa&&wa.borderWidth||0;if(!pa){La=/^(bar|pie|area|column)$/.test(La.type);G.legendItem=
61pa=ga.text(N.labelFormatter.call(G),0,0).css(G.visible?ab:Oa).on("mouseover",function(){G.setState(Bb);pa.css(xa)}).on("mouseout",function(){pa.css(G.visible?ab:Oa);G.setState()}).on("click",function(){var Gb=function(){G.setVisible()};G.firePointEvent?G.firePointEvent("legendItemClick",null,Gb):Pa(G,"legendItemClick",null,Gb)}).attr({zIndex:2}).add(qa);if(!La&&wa&&wa.lineWidth){var Vb={"stroke-width":wa.lineWidth,zIndex:2};if(wa.dashStyle)Vb.dashstyle=wa.dashStyle;G.legendLine=ga.path([Za,-da-Ma,
620,Ka,-Ma,0]).attr(Vb).add(qa)}if(La)ha=ga.rect(na=-da-Ma,Ra=-11,da,12,2).attr({zIndex:3}).add(qa);else if(wa&&wa.marker&&wa.marker.enabled)ha=ga.symbol(G.symbol,na=-da/2-Ma,Ra=-4,wa.marker.radius).attr({zIndex:3}).add(qa);if(ha){ha.xOff=na+zb%2/2;ha.yOff=Ra+zb%2/2}G.legendSymbol=ha;p(G,G.visible);if(wa&&wa.showCheckbox){G.checkbox=hb("input",{type:"checkbox",checked:G.selected,defaultChecked:G.selected},N.itemCheckboxStyle,oa);Qa(G.checkbox,"click",function(Gb){Pa(G,"checkboxClick",{checked:Gb.target.checked},
63function(){G.select()})})}}ha=pa.getBBox();na=G.legendItemWidth=N.itemWidth||da+Ma+ha.width+R;B=ha.height;if(ta&&o-s+na>(fb||$a-2*R-s)){o=s;I+=B}ba=I;q(G,o,I);if(ta)o+=na;else I+=B;ya=fb||Ia(ta?o-s:na,ya)}function V(){o=s;I=L;ba=ya=0;qa||(qa=ga.g("legend").attr({zIndex:7}).add());za=[];u(Hb,function(Ra){var La=Ra.options;if(La.showInLegend)za=za.concat(La.legendType==="point"?Ra.data:Ra)});Hd(za,function(Ra,La){return(Ra.options.legendIndex||0)-(La.options.legendIndex||0)});cc&&za.reverse();u(za,
64x);$b=fb||ya;ac=ba-L+B;if(ca||la){$b+=2*R;ac+=2*R;if(D){if($b>0&&ac>0){D[D.isNew?"attr":"animate"](D.crisp(null,null,null,$b,ac));D.isNew=false}}else{D=ga.rect(0,0,$b,ac,N.borderRadius,ca||0).attr({stroke:N.borderColor,"stroke-width":ca||0,fill:la||jb}).add(qa).shadow(N.shadow);D.isNew=true}D[za.length?"show":"hide"]()}for(var G=["left","right","top","bottom"],ha,na=4;na--;){ha=G[na];if(eb[ha]&&eb[ha]!=="auto"){N[na<2?"align":"verticalAlign"]=ha;N[na<2?"x":"y"]=ja(eb[ha])*(na%2?-1:1)}}za.length&&
65qa.align(sa(N,{width:$b,height:ac}),true,Rb);cd||w()}var N=l.options.legend;if(N.enabled){var ta=N.layout==="horizontal",da=N.symbolWidth,Ma=N.symbolPadding,za,eb=N.style,ab=N.itemStyle,xa=N.itemHoverStyle,Oa=N.itemHiddenStyle,R=ja(eb.padding),L=18,s=4+R+da+Ma,o,I,ba,B=0,D,ca=N.borderWidth,la=N.backgroundColor,qa,ya,fb=N.width,Hb=l.series,cc=N.reversed;V();Qa(l,"endResize",w);return{colorizeItem:p,destroyItem:function(G){var ha=G.checkbox;u(["legendItem","legendLine","legendSymbol"],function(na){G[na]&&
66G[na].destroy()});ha&&pc(G.checkbox)},renderLegend:V,destroy:function(){if(D)D=D.destroy();if(qa)qa=qa.destroy()}}}};gc=function(p,q){return p>=0&&p<=Da&&q>=0&&q<=Aa};$d=function(){Pa(l,"selection",{resetSelection:true},td);l.toolbar.remove("zoom")};td=function(p){var q=Xa.lang,w=l.pointCount<100;l.toolbar.add("zoom",q.resetZoom,q.resetZoomTitle,$d);!p||p.resetSelection?u(Va,function(x){x.setExtremes(null,null,false,w)}):u(p.xAxis.concat(p.yAxis),function(x){var V=x.axis;if(l.tracker[V.isXAxis?"zoomX":
67"zoomY"])V.setExtremes(x.min,x.max,false,w)});i()};Gc=function(){var p=a.legend,q=A(p.margin,10),w=p.x,x=p.y,V=p.align,N=p.verticalAlign,ta;yd();if((l.title||l.subtitle)&&!K(y))if(ta=Ia(l.title&&!uc.floating&&!uc.verticalAlign&&uc.y||0,l.subtitle&&!Ic.floating&&!Ic.verticalAlign&&Ic.y||0))ea=Ia(ea,ta+A(uc.margin,15)+Na);if(p.enabled&&!p.floating)if(V==="right")K(C)||(Ib=Ia(Ib,$b-w+q+Ea));else if(V==="left")K(Sa)||(X=Ia(X,$b+w+q+Lb));else if(N==="top")K(y)||(ea=Ia(ea,ac+x+q+Na));else if(N==="bottom")K(Z)||
68(vb=Ia(vb,ac-x+q+gb));sc&&u(Va,function(da){da.getOffset()});K(Sa)||(X+=Xb[3]);K(y)||(ea+=Xb[0]);K(Z)||(vb+=Xb[2]);K(C)||(Ib+=Xb[1]);zd()};xd=function(p,q,w){var x=l.title,V=l.subtitle;cd+=1;oc(w,l);ad=cb;qd=$a;l.chartWidth=$a=W(p);l.chartHeight=cb=W(q);Ja(oa,{width:$a+Ua,height:cb+Ua});ga.setSize($a,cb,w);Da=$a-X-Ib;Aa=cb-ea-vb;Ob=null;u(Va,function(N){N.isDirty=true;N.setScale()});u(Ha,function(N){N.isDirty=true});l.isDirtyLegend=true;l.isDirtyBox=true;Gc();x&&x.align(null,null,Rb);V&&V.align(null,
69null,Rb);i(w);ad=null;Pa(l,"resize");Bc===false?T():setTimeout(T,Bc&&Bc.duration||500)};zd=function(){l.plotLeft=X=W(X);l.plotTop=ea=W(ea);l.plotWidth=Da=W($a-X-Ib);l.plotHeight=Aa=W(cb-ea-vb);l.plotSizeX=va?Aa:Da;l.plotSizeY=va?Da:Aa;Rb={x:Lb,y:Na,width:$a-Lb-Ea,height:cb-Na-gb}};yd=function(){ea=A(y,Na);Ib=A(C,Ea);vb=A(Z,gb);X=A(Sa,Lb);Xb=[0,0,0,0]};vd=function(){var p=z.borderWidth||0,q=z.backgroundColor,w=z.plotBackgroundColor,x=z.plotBackgroundImage,V,N={x:X,y:ea,width:Da,height:Aa};V=p+(z.shadow?
708:0);if(p||q)if(wc)wc.animate(wc.crisp(null,null,null,$a-V,cb-V));else wc=ga.rect(V/2,V/2,$a-V,cb-V,z.borderRadius,p).attr({stroke:z.borderColor,"stroke-width":p,fill:q||jb}).add().shadow(z.shadow);if(w)if(Kc)Kc.animate(N);else Kc=ga.rect(X,ea,Da,Aa,0).attr({fill:w}).add().shadow(z.plotShadow);if(x)if(Ad)Ad.animate(N);else Ad=ga.image(x,X,ea,Da,Aa).add();if(z.plotBorderWidth)if(xc)xc.animate(xc.crisp(null,X,ea,Da,Aa));else xc=ga.rect(X,ea,Da,Aa,0,z.plotBorderWidth).attr({stroke:z.plotBorderColor,
71"stroke-width":z.plotBorderWidth,zIndex:4}).add();l.isDirtyBox=false};Qa(db,"unload",H);z.reflow!==false&&Qa(l,"load",P);if(M)for(Bd in M)Qa(l,Bd,M[Bd]);l.options=a;l.series=Ha;l.addSeries=function(p,q,w){var x;if(p){oc(w,l);q=A(q,true);Pa(l,"addSeries",{options:p},function(){x=g(p);x.isDirty=true;l.isDirtyLegend=true;q&&l.redraw()})}return x};l.animation=A(z.animation,true);l.destroy=H;l.get=function(p){var q,w,x;for(q=0;q<Va.length;q++)if(Va[q].options.id===p)return Va[q];for(q=0;q<Ha.length;q++)if(Ha[q].options.id===
72p)return Ha[q];for(q=0;q<Ha.length;q++){x=Ha[q].data;for(w=0;w<x.length;w++)if(x[w].id===p)return x[w]}return null};l.getSelectedPoints=function(){var p=[];u(Ha,function(q){p=p.concat(Dd(q.data,function(w){return w.selected}))});return p};l.getSelectedSeries=function(){return Dd(Ha,function(p){return p.selected})};l.hideLoading=function(){gd(jc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){Ja(jc,{display:jb})}});Cd=false};l.isInsidePlot=gc;l.redraw=i;l.setSize=xd;l.setTitle=m;l.showLoading=
73function(p){var q=a.loading;if(!jc){jc=hb(Tb,{className:"highcharts-loading"},sa(q.style,{left:X+Ua,top:ea+Ua,width:Da+Ua,height:Aa+Ua,zIndex:10,display:jb}),oa);Zd=hb("span",null,q.labelStyle,jc)}Zd.innerHTML=p||a.lang.loading;if(!Cd){Ja(jc,{opacity:0,display:""});gd(jc,{opacity:q.style.opacity},{duration:q.showDuration});Cd=true}};l.pointCount=0;l.counters=new Gd;U()}var ua=document,db=window,Fa=Math,W=Fa.round,lb=Fa.floor,md=Fa.ceil,Ia=Fa.max,tb=Fa.min,bb=Fa.abs,rb=Fa.cos,Cb=Fa.sin,kc=Fa.PI,ae=
74kc*2/360,yc=navigator.userAgent,Pc=/msie/i.test(yc)&&!db.opera,Mc=ua.documentMode===8,Ud=/AppleWebKit/.test(yc),Yd=/Firefox/.test(yc),Lc=!!ua.createElementNS&&!!ua.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,me=Yd&&parseInt(yc.split("Firefox/")[1],10)<4,fd,Kb=ua.documentElement.ontouchstart!==undefined,be={},wd=0,ub=1,Tc,Xa,Zc,Bc,Nc,Wa,Tb="div",ic="absolute",Xd="relative",ob="hidden",vc="highcharts-",Ab="visible",Ua="px",jb="none",Za="M",Ka="L",ce="rgba(192,192,192,"+(Lc?1.0E-6:
750.0020)+")",ib="",Bb="hover",Qc,id,jd,kd,Cc,Rc,Sc,Jd,Kd,ld,Ld,Md,ma=db.HighchartsAdapter,Db=ma||{},u=Db.each,Dd=Db.grep,tc=Db.map,Ca=Db.merge,Qa=Db.addEvent,pb=Db.removeEvent,Pa=Db.fireEvent,gd=Db.animate,Hc=Db.stop,wb={};Zc=function(a,b,c){function d(P){return P.toString().replace(/^([0-9])$/,"0$1")}if(!K(b)||isNaN(b))return"Invalid date";a=A(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*ub);var e,f=b[jd](),g=b[kd](),h=b[Cc](),i=b[Rc](),j=b[Sc](),m=Xa.lang,v=m.weekdays;b={a:v[g].substr(0,3),A:v[g],d:d(h),
76e:h,b:m.shortMonths[i],B:m.months[i],m:d(i+1),y:j.toString().substr(2,2),Y:j,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[id]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};Gd.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};Nc={init:function(a,b,c){b=b||"";var d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h,
77i,j=function(m){for(g=m.length;g--;)m[g]===Za&&m.splice(g+1,0,m[g+1],m[g+2],m[g+1],m[g+2])};if(e){j(b);j(c)}if(a.isArea){h=b.splice(b.length-6,6);i=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(i)}return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]);
78e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ma&&ma.init&&ma.init(Nc);if(!ma&&db.jQuery){var Mb=jQuery;u=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Dd=Mb.grep;tc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};Ca=function(){var a=arguments;return Mb.extend(true,null,a[0],a[1],a[2],a[3])};Qa=function(a,b,c){Mb(a).bind(b,c)};pb=function(a,b,c){var d=ua.removeEventListener?"removeEventListener":"detachEvent";
79if(ua[d]&&!a[d])a[d]=function(){};Mb(a).unbind(b,c)};Pa=function(a,b,c,d){var e=Mb.Event(b),f="detached"+b;sa(e,c);if(a[b]){a[f]=a[b];a[b]=null}Mb(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};gd=function(a,b,c){var d=Mb(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Hc=function(a){Mb(a).stop()};Mb.extend(Mb.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var de=jQuery.fx,ee=de.step;u(["cur","_default","width","height"],function(a,b){var c=b?
80ee:de.prototype,d=c[a],e;if(d)c[a]=function(f){f=b?f:this;e=f.elem;return e.attr?e.attr(f.prop,f.now):d.apply(this,arguments)}});ee.d=function(a){var b=a.elem;if(!a.started){var c=Nc.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",Nc.step(a.start,a.end,a.pos,b.toD))}}ma={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Xa={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle",
81"diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7",
82borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false,
83animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:Ca(ma,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:ic,color:"#3E576F"}},legend:{enabled:true,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},
84borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:ic,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Xd,top:"1em"},showDuration:100,style:{position:ic,backgroundColor:"white",opacity:0.5,textAlign:"center"}},
85tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Kb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}};var Yc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M",
86hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:ma,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F",
87fontWeight:"bold"}},type:"linear"},od=Ca(Yc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ma.style}}),ie={labels:{align:"right",x:-8,y:null},title:{rotation:270}},he={labels:{align:"left",x:8,y:null},title:{rotation:90}},Td={labels:{align:"center",x:0,y:14},title:{rotation:0}},
88ge=Ca(Td,{labels:{y:-5}}),xb=Xa.plotOptions;ma=xb.line;xb.spline=Ca(ma);xb.scatter=Ca(ma,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=Ca(ma,{});xb.areaspline=Ca(xb.area);xb.column=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}},dataLabels:{y:null,verticalAlign:null}});xb.bar=Ca(xb.column,{dataLabels:{align:"left",x:5,
89y:0}});xb.pie=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Id();var bc=function(a){var b=[],c;(function(d){if(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(d))b=[ja(c[1]),ja(c[2]),ja(c[3]),parseFloat(c[4],
9010)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[ja(c[1],16),ja(c[2],16),ja(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(lc(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=ja(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Uc.prototype={init:function(a,b){this.element=ua.createElementNS("http://www.w3.org/2000/svg",
91b);this.renderer=a},animate:function(a,b,c){if(b=A(b,Bc,true)){b=Ca(b);if(c)b.complete=c;gd(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,i=this.renderer,j,m=this.shadows,v=this.htmlNode,P,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";T=Ga(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")T=parseFloat(T)}else for(c in a){j=false;d=a[c];if(c==="d"){if(d&&d.join)d=
92d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ga(f,"x")===Ga(g,"x")&&Ga(f,"x",d)}if(this.rotation)Ga(g,"transform","rotate("+this.rotation+" "+d+" "+ja(a.y||Ga(g,"y"))+")")}else if(c==="fill")d=i.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();j=true}else if(c===
93"stroke")d=i.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=ja(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=ja(d);else if(c===
94"align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}else if(c==="title"){e=ua.createElementNS("http://www.w3.org/2000/svg","title");e.appendChild(ua.createTextNode(d));g.appendChild(e)}if(c==="strokeWidth")c="stroke-width";if(Ud&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!P){this.symbolAttr(a);P=true}j=true}if(m&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=m.length;e--;)Ga(m[e],c,d);if((c==="width"||c==="height")&&h===
95"rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&i.buildText(this)}else j||Ga(g,c,d);if(v&&(c==="x"||c==="y"||c==="translateX"||c==="translateY"||c==="visibility")){e=v.length?v:[this];f=e.length;var Y;for(Y=0;Y<f;Y++){v=e[Y];j=v.getBBox();v=v.htmlNode;Ja(v,sa(this.styles,{left:j.x+(this.translateX||0)+Ua,top:j.y+(this.translateY||0)+Ua}));c==="visibility"&&Ja(v,{visibility:d})}}}return T},symbolAttr:function(a){var b=this;u(["x","y","r","start","end","width","height","innerR"],function(c){b[c]=
96A(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](W(b.x*2)/2,W(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},i;a=a||this.strokeWidth||0;i=a%2/2;h.x=lb(b||this.x||0)+i;h.y=lb(c||this.y||0)+i;h.width=lb((d||this.width||0)-2*i);h.height=lb((e||this.height||0)-2*i);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f];
97return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c,d="",e=function(f,g){return"-"+g.toLowerCase()};if(a&&a.color)a.fill=a.color;this.styles=a=sa(this.styles,a);if(Pc&&!Lc){b&&delete a.width;Ja(this.element,a)}else{for(c in a)d+=c.replace(/([A-Z])/g,e)+":"+a[c]+";";this.attr({style:d})}b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Kb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this},
98translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ga(this.element,"transform",e.join(" "))},toFront:function(){var a=
99this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=A(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=W(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||
1001);h[b?"translateY":"y"]=W(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*ae;try{a=sa({},this.element.getBBox())}catch(f){a={width:0,height:0}}b=a.width;c=a.height;if(d){a.width=bb(c*Cb(e))+bb(b*rb(e));a.height=bb(c*rb(e))+bb(b*Cb(e))}return a},show:function(){return this.attr({visibility:Ab})},hide:function(){return this.attr({visibility:ob})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=
101d.childNodes,f=this.element,g=Ga(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(a&&this.htmlNode){if(!a.htmlNode)a.htmlNode=[];a.htmlNode.push(this)}if(g){c.handleZ=true;g=ja(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ga(a,"zIndex");if(a!==f&&(ja(b)>g||!K(g)&&K(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||
102{},c=a.shadows,d,e;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=null;Hc(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(e=0;e<a.stops.length;e++)a.stops[e]=a.stops[e].destroy();a.stops=null}a.safeRemoveChild(b);c&&u(c,function(f){a.safeRemoveChild(f)});nc(a.renderer.alignedObjects,a);for(d in a)delete a[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,b){var c=[],d,e,f=this.element,g=this.parentInverted?
103"(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ga(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var ed=function(){this.init.apply(this,arguments)};ed.prototype={Element:Uc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(f.element);
104this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Pc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.gradients=[];this.setSize(b,c,false)},destroy:function(){var a,b=this.gradients,c=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();if(b){for(a=0;a<b.length;a++)this.gradients[a]=b[a].destroy();this.gradients=null}if(c)this.defs=c.destroy();return this.alignedObjects=null},createElement:function(a){var b=new this.Element;
105b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=A(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ga(b,"x"),h=a.styles,i=h&&a.useHTML&&!this.forExport,j=a.htmlNode,m=h&&ja(h.width),v=h&&h.lineHeight,P,T=d.length;T--;)b.removeChild(d[T]);m&&!a.added&&
106this.box.appendChild(b);u(c,function(Y,H){var U,z=0,M;Y=Y.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");U=Y.split("|||");u(U,function(y){if(y!==""||U.length===1){var C={},Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(y)&&Ga(Z,"style",y.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(y)){Ga(Z,"onclick",'location.href="'+y.match(f)[1]+'"');Ja(Z,{cursor:"pointer"})}y=(y.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");Z.appendChild(ua.createTextNode(y));
107if(z)C.dx=3;else C.x=g;if(!z){if(H){!Lc&&a.renderer.forExport&&Ja(Z,{display:"block"});M=db.getComputedStyle&&ja(db.getComputedStyle(P,null).getPropertyValue("line-height"));if(!M||isNaN(M))M=v||P.offsetHeight||18;Ga(Z,"dy",M)}P=Z}Ga(Z,C);b.appendChild(Z);z++;if(m){y=y.replace(/-/g,"- ").split(" ");for(var Sa,Na=[];y.length||Na.length;){Sa=b.getBBox().width;C=Sa>m;if(!C||y.length===1){y=Na;Na=[];if(y.length){Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");Ga(Z,{dy:v||16,x:g});b.appendChild(Z);
108if(Sa>m)m=Sa}}else{Z.removeChild(Z.firstChild);Na.unshift(y.pop())}y.length&&Z.appendChild(ua.createTextNode(y.join(" ").replace(/- /g,"-")))}}}})});if(i){if(!j)j=a.htmlNode=hb("span",null,sa(h,{position:ic,top:0,left:0}),this.box.parentNode);j.innerHTML=a.textStr;for(T=d.length;T--;)d[T].style.visibility=ob}},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=W(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=W(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a,
109b,c){a=Nb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Ia(c,0),Ia(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;
110this.height=b;for(this.boxWrapper[A(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return K(a)?b.attr({"class":vc+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&sa(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f,
111g=this.symbols[a];g=g&&g(W(b),W(c),d,e);var h=/^url\((.*?)\)$/,i;if(g){f=this.path(g);sa(f,{symbolName:a,x:b,y:c,r:d});e&&sa(f,e)}else if(h.test(a)){var j=function(m,v){m.attr({width:v[0],height:v[1]}).translate(-W(v[0]/2),-W(v[1]/2))};i=a.match(h)[1];a=be[i];f=this.image(i).attr({x:b,y:c});if(a)j(f,a);else{f.attr({width:0,height:0});hb("img",{onload:function(){j(f,be[i]=[this.width,this.height])},src:i})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c,
112b-c,Ka,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ka,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ka,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ka,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=rb(e),i=Cb(e),j=rb(f);f=Cb(f);d=d.end-e<kc?0:1;return[Za,a+c*h,b+c*i,"A",c,c,0,d,1,a+c*j,b+c*f,Ka,a+g*j,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*i,"Z"]}},clipRect:function(a,b,
113c,d){var e=vc+wd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=vc+wd++;var g,h,i;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);f.gradients.push(g);g.stops=[];u(a.stops,function(j){if(e.test(j[1])){d=bc(j[1]);h=d.get("rgb");i=d.get("a")}else{h=j[1];i=1}j=
114f.createElement("stop").attr({offset:j[0],"stop-color":h,"stop-opacity":i}).add(g);g.stops.push(j)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=bc(a);Ga(b,c+"-opacity",d.get("a"));return d.get("rgb")}else{b.removeAttribute(c+"-opacity");return a}},text:function(a,b,c,d){var e=Xa.chart.style;b=W(A(b,0));c=W(A(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({fontFamily:e.fontFamily,fontSize:e.fontSize});a.x=b;a.y=c;a.useHTML=d;return a}};fd=ed;if(!Lc){Db=yb(Uc,{init:function(a,
115b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",ic,";"];if(b==="shape"||b===Tb)d.push("left:0;top:0;width:10px;height:10px;");if(Mc)d.push("visibility: ",b===Tb?ob:Ab);c.push(' style="',d.join(""),'"/>');if(b){c=b===Tb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=hb(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Mc&&d.gVis===ob&&Ja(c,{visibility:ob});d.appendChild(c);this.added=true;this.alignOnAdd&&
116this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,i=this.renderer,j=this.symbolName,m,v,P=this.shadows,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;T=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];m=false;if(j&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!v){this.symbolAttr(a);v=true}m=true}else if(c==="d"){d=d||[];this.d=d.join(" ");e=d.length;for(m=[];e--;)m[e]=lc(d[e])?W(d[e]*10)-
1175:d[e]==="Z"?"x":d[e];d=m.join(" ")||"x";f.path=d;if(P)for(e=P.length;e--;)P[e].path=d;m=true}else if(c==="zIndex"||c==="visibility"){if(Mc&&c==="visibility"&&h==="DIV"){f.gVis=d;m=f.childNodes;for(e=m.length;e--;)Ja(m[e],{visibility:d});if(d===Ab)d=null}if(d)g[c]=d;m=true}else if(/^(width|height)$/.test(c)){this[c]=d;if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;m=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName==="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]=
118d}else if(c==="class")f.className=d;else if(c==="stroke"){d=i.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(lc(d))d+=Ua}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||hb(i.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;m=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=i.color(d,f,c);c="fillcolor"}else if(c==="translateX"||c==="translateY"||c==="rotation"||
119c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();m=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;m=true}if(P&&c==="visibility")for(e=P.length;e--;)P[e].style[c]=d;if(!m)if(Mc)f[c]=d;else Ga(f,c,d)}return T},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){nc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=b;this.updateTransform()}this.styles=sa(this.styles,
120a);Ja(this.element,a);return this},safeRemoveChild:function(a){a.parentNode&&pc(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Uc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=ic;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+
121a]=function(){var c=db.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&u(b.childNodes,function(z){a.renderer.invertChild(z,b)});if(b.tagName==="SPAN"){var j,m;c=a.rotation;var v;j=0;d=1;var P=0,T;v=ja(a.textWidth);var Y=a.xCorr||0,H=a.yCorr||0,U=[c,g,b.innerHTML,
122a.textWidth].join(",");if(U!==a.cTT){if(K(c)){j=c*ae;d=rb(j);P=Cb(j);Ja(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-P,", M21=",P,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}j=b.offsetWidth;m=b.offsetHeight;if(j>v){Ja(b,{width:v+Ua,display:"block",whiteSpace:"normal"});j=v}v=W((ja(b.style.fontSize)||12)*1.2);Y=d<0&&-j;H=P<0&&-m;T=d*P<0;Y+=P*v*(T?1-h:h);H-=d*v*(c?T?h:1-h:1);if(i){Y-=j*h*(d<0?-1:1);if(c)H-=m*h*(P<0?-1:1);Ja(b,{textAlign:g})}a.xCorr=Y;a.yCorr=
123H}Ja(b,{left:e+Y,top:f+H});a.cTT=U}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,i,j=e.path;if(j&&typeof j.value!=="string")j="x";if(a){for(d=1;d<=3;d++){i=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',j,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=hb(f.prepVML(i),null,{left:ja(h.left)+1,top:ja(h.top)+1});i=['<stroke color="black" opacity="',0.05*d,'"/>'];hb(f.prepVML(i),null,null,g);b?b.element.appendChild(g):
124e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ma=function(){this.init.apply(this,arguments)};ma.prototype=Ca(ed.prototype,{Element:Db,isIE8:yc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Tb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!ua.namespaces.hcv){ua.namespaces.add("hcv","urn:schemas-microsoft-com:vml");ua.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}},
125clipRect:function(a,b,c,d){var e=this.createElement();return sa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,i=h+this.width,j=g+this.height;g={clip:"rect("+W(f?h:g)+"px,"+W(f?j:i)+"px,"+W(f?i:j)+"px,"+W(f?g:h)+"px)"};!f&&Mc&&sa(g,{width:i+Ua,height:j+Ua});return g},updateClipping:function(){u(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,i,j,m,v;u(a.stops,
126function(P,T){if(e.test(P[1])){d=bc(P[1]);f=d.get("rgb");g=d.get("a")}else{f=P[1];g=1}if(T){m=f;v=g}else{i=f;j=g}});a=90-Fa.atan((h[3]-h[1])/(h[2]-h[0]))*180/kc;a=["<",c,' colors="0% ',i,",100% ",m,'" angle="',a,'" opacity="',v,'" o:opacity2="',j,'" type="gradient" focus="100%" />'];hb(this.prepVML(a),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=bc(a);a=["<",c,' opacity="',d.get("a"),'"/>'];hb(this.prepVML(a),null,null,b);return d.get("rgb")}else{b=b.getElementsByTagName(c);if(b.length)b[0].opacity=
1271;return a}},prepVML:function(a){var b=this.isIE8;a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Xa.chart.style;return this.createElement("span").attr({text:a,x:W(b),y:W(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily,
128fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:vc+a,"class":vc+a};return this.createElement(Tb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;
129a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Ia(c,0),Ia(d,0)))},invertChild:function(a,b){var c=b.style;Ja(a,{flip:"x",left:ja(c.width)-10,top:ja(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=rb(e),h=Cb(e),i=rb(f),j=Cb(f);d=d.innerR;var m=0.07/c,v=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*kc-f+e<m)i=-m;else if(f-e<v)i=rb(e+v);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*i,b+c*j,"at",a-d,b-d,a+d,b+d,a+d*i,b+d*j,a+d*g,b+d*h,"x","e"]},circle:function(a,
130b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!K(d))return[];var e=d.width;d=d.height;var f=a+e,g=b+d;c=tb(c,e,d);return[Za,a+c,b,Ka,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ka,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ka,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ka,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});fd=ma}Nd.prototype.callbacks=[];var Oc=function(){};Oc.prototype={init:function(a,b){var c=a.chart.counters,d;this.series=a;this.applyOptions(b);this.pointAttr=
131{};if(a.options.colorByPoint){d=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||d[c.color++];c.wrapColor(d.length)}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(lc(a)||a===null)this.y=a;else if(Nb(a)&&!lc(a.length)){sa(this,a);this.options=a}else if(Sb(a[0])){this.name=a[0];this.y=a[1]}else if(lc(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Wa)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series,
132c=b.chart.hoverPoints,d;b.chart.pointCount--;if(c){a.setState();nc(c,a)}a===b.chart.hoverPoint&&a.onMouseOut();pb(a);u(["graphic","tracker","group","dataLabel","connector","shadowGroup"],function(e){a[e]&&a[e].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(d in a)a[d]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;a=A(a,
133!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=a;c.setState(a&&"select");b||u(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=false;e.setState(ib);e.firePointEvent("unselect")}})})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Bb);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState();
134this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=A(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Nb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c=
135this,d=c.series,e=d.chart,f=d.data;oc(b,e);a=A(a,true);c.firePointEvent("remove",null,function(){nc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();if(a==="click"&&e.allowPointSelect)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=Ca(this.series.options.point,
136this.options).events,b;this.events=a;for(b in a)Qa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,i=this.pointAttr;a=a||ib;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(i[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0,
1370,i[a].r).attr(i[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var sb=function(){};sb.prototype={isCartesian:true,type:"line",pointClass:Oc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);sa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:ib,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events;
138for(c in d)Qa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=A(b,a.pointStart,0);this.pointInterval=A(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;Hd(b,function(h,i){return h.x-i.x});if(this.options.connectNulls)for(g=
139b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Wa||f<d)){d=f;c=g}}if(e===Wa||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;u(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return Ca(b[this.type],b.series,a)},getColor:function(){var a=
140this.chart.options.colors,b=this.chart.counters;this.color=this.options.color||a[b.color++]||"#0000ff";b.wrapColor(a.length)},getSymbol:function(){var a=this.chart.options.symbols,b=this.chart.counters;this.symbol=this.options.marker.symbol||a[b.symbol++];b.wrapSymbol(a.length)},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);oc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=A(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs();
141this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(K(e))f.counters.color=e;for(a=tc(zc(a||[]),function(h){return(new c.pointClass).init(c,h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;A(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=A(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend=
142d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,i=g.y,j=g.low,m=d.stacks[(i<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&m&&m[h]){j=m[h];h=j.total;j.cum=j=j.cum-i;i=j+i;if(b==="percent"){j=h?j*100/h:0;i=h?i*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(K(j))g.yBottom=d.translate(j,0,1,0,1);if(i!==null)g.plotY=
143d.translate(i,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Wa?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=W((c?b.plotTop:b.plotLeft)+b.plotSizeX),f,g,h=[];if(a)this.tooltipPoints=null;u(this.segments,function(i){d=d.concat(i)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();u(d,function(i,j){f=d[j-1]?d[j-1]._high+1:0;for(g=i._high=d[j+1]?lb((i.plotX+(d[j+1]?d[j+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=i});this.tooltipPoints=h},
144onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Kb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Bb);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect,
145d=this.options.animation;if(d&&!Nb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,d,e,f,g,h,i;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;i=g.graphic;if(e!==Wa&&!isNaN(e)){a=g.pointAttr[g.selected?"select":ib];h=a.r;if(i)i.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(A(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}},
146convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=A(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Bb],e,f=a.color,g={stroke:f,fill:f},h=a.data,i=[],j,m=a.pointAttrToOptions,v;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||bc(d.color||f).brighten(d.brightness).get();i[ib]=a.convertAttribs(b,
147g);u([Bb,"select"],function(P){i[P]=a.convertAttribs(c[P],i[ib])});a.pointAttr=i;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=0;e=false;if(g.options)for(v in m)if(K(b[m[v]]))e=true;if(e){j=[];c=b.states||{};e=c[Bb]=c[Bb]||{};if(!a.options.marker)e.color=bc(e.color||g.options.color).brighten(e.brightness||d.brightness).get();j[ib]=a.convertAttribs(b,i[ib]);j[Bb]=a.convertAttribs(c[Bb],i[Bb],j[ib]);j.select=a.convertAttribs(c.select,i.select,
148j[ib])}else j=i;g.pointAttr=j}},destroy:function(){var a=this,b=a.chart,c=a.clipRect,d=/\/5[0-9\.]+ (Safari|Mobile)\//.test(yc),e,f;Pa(a,"destroy");pb(a);a.legendItem&&a.chart.legend.destroyItem(a);u(a.data,function(g){g.destroy()});if(c&&c!==b.clipRect)a.clipRect=c.destroy();u(["area","graph","dataLabelsGroup","group","tracker"],function(g){if(a[g]){e=d&&g==="group"?"hide":"destroy";a[g][e]()}});if(b.hoverSeries===a)b.hoverSeries=null;nc(b.series,a);for(f in a)delete a[f]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a,
149b,c=this.data,d=this.options,e=d.dataLabels,f,g=this.dataLabelsGroup,h=this.chart,i=h.renderer,j=h.inverted,m=this.type,v;v=d.stacking;var P=m==="column"||m==="bar",T=e.verticalAlign===null,Y=e.y===null;if(P)if(v){if(T)e=Ca(e,{verticalAlign:"middle"});if(Y)e=Ca(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else if(T)e=Ca(e,{verticalAlign:"top"});if(g)g.translate(h.plotLeft,h.plotTop);else g=this.dataLabelsGroup=i.g("data-labels").attr({visibility:this.visible?Ab:ob,zIndex:6}).translate(h.plotLeft,
150h.plotTop).add();v=e.color;if(v==="auto")v=null;e.style.color=A(v,this.color,"black");u(c,function(H){var U=H.barX,z=U&&U+H.barW/2||H.plotX||-999,M=A(H.plotY,-999),y=H.dataLabel,C=e.align,Z=Y?H.y>=0?-6:12:e.y;f=e.formatter.call(H.getLabelConfig());a=(j?h.plotWidth-M:z)+e.x;b=(j?h.plotHeight-z:M)+Z;if(m==="column")a+={left:-1,right:1}[C]*H.barW/2||0;if(j&&H.y<0){C="right";a-=10}if(y){if(j&&!e.y)b=b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2;y.attr({text:f}).animate({x:a,y:b})}else if(K(f)){y=
151H.dataLabel=i.text(f,a,b).attr({align:C,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&y.attr({y:b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2})}if(P&&d.stacking&&y){z=H.barY;M=H.barW;H=H.barH;y.align(e,null,{x:j?h.plotWidth-z-H:U,y:j?h.plotHeight-U-M:z,width:j?H:M,height:j?M:H})}})}},drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,i=b.lineWidth,j=b.dashStyle,m,v=a.chart.renderer,P=a.yAxis.getThreshold(b.threshold||0),T=/^area/.test(a.type),
152Y=[],H=[];u(a.segments,function(U){m=[];u(U,function(C,Z){if(a.getPointSpline)m.push.apply(m,a.getPointSpline(U,C,Z));else{m.push(Z?Ka:Za);Z&&b.step&&m.push(C.plotX,U[Z-1].plotY);m.push(C.plotX,C.plotY)}});if(U.length>1)d=d.concat(m);else Y.push(U[0]);if(T){var z=[],M,y=m.length;for(M=0;M<y;M++)z.push(m[M]);y===3&&z.push(Ka,m[1],m[2]);if(b.stacking&&a.type!=="areaspline")for(M=U.length-1;M>=0;M--)z.push(U[M].plotX,U[M].yBottom);else z.push(Ka,U[U.length-1].plotX,P,Ka,U[0].plotX,P);H=H.concat(z)}});
153a.graphPath=d;a.singlePoints=Y;if(T){e=A(b.fillColor,bc(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:H});else a.area=a.chart.renderer.path(H).attr({fill:e}).add(g)}if(c){Hc(c);c.animate({d:d})}else if(i){c={stroke:h,"stroke-width":i};if(j)c.dashstyle=j;a.graph=v.path(d).attr(c).add(g).shadow(b.shadow)}},render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect,i=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&&
154b.clipRect?b.clipRect:i.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=i.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Qa(b,"resize",d);Qa(a,"destroy",function(){pb(b,"resize",d)})}c.clip(a.clipRect).attr({visibility:a.visible?Ab:ob,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!==
155false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a||
156ib;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,i=this.data,j=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Wa?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=i.length;e--;){f=i[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty=
157true;this.options.stacking&&u(c.series,function(m){if(m.options.stacking&&m.visible)m.isDirty=true});if(j)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Wa?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor;
158h=h&&{cursor:h};var i=a.singlePoints,j;if(d)for(j=d+1;j--;){c[j]===Za&&c.splice(j+1,0,c[j+1]-f,c[j+2],Ka);if(j&&c[j]===Za||j===d)c.splice(j,0,Ka,c[j-2]+f,c[j-1])}for(j=0;j<i.length;j++){d=i[j];c.push(Za,d.plotX-f,d.plotY,Ka,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:ce,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?Ab:ob,zIndex:b.zIndex||1}).on(Kb?"touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout",
159function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ma=yb(sb);wb.line=ma;ma=yb(sb,{type:"area"});wb.area=ma;ma=yb(sb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,m;if(c&&c<a.length-1){a=f.plotY;j=g.plotX;g=g.plotY;var v;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;m=(1.5*e+g)/2.5;v=(m-i)*(j-d)/(j-h)+e-m;i+=v;m+=v;if(i>a&&i>e){i=Ia(a,e);m=2*e-i}else if(i<a&&i<e){i=tb(a,e);m=2*e-i}if(m>g&&m>e){m=Ia(g,e);i=2*e-m}else if(m<
160g&&m<e){m=tb(g,e);i=2*e-m}b.rightContX=j;b.rightContY=m}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});wb.spline=ma;ma=yb(ma,{type:"areaspline"});wb.areaspline=ma;var hd=yb(sb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){sb.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&u(b.series,function(c){if(c.type===
161a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,i={},j,m;sb.prototype.translate.apply(a);u(b.series,function(C){if(C.type===a.type&&C.visible){if(C.options.stacking){j=C.stackKey;if(i[j]===Wa)i[j]=f++;m=i[j]}else m=f++;C.columnIndex=m}});var v=a.data,P=a.closestPoints;h=bb(v[1]?v[P].plotX-v[P-1].plotX:b.plotSizeX/(h&&h.length||1));P=h*c.groupPadding;var T=(h-2*P)/f,Y=c.pointWidth,H=K(Y)?(T-Y)/2:
162T*c.pointPadding,U=Ia(A(Y,T-2*H),1),z=H+(P+((g?f-a.columnIndex:a.columnIndex)||0)*T-h/2)*(g?-1:1),M=a.yAxis.getThreshold(c.threshold||0),y=A(c.minPointLength,5);u(v,function(C){var Z=C.plotY,Sa=C.yBottom||M,Na=C.plotX+z,Ea=md(tb(Z,Sa)),gb=md(Ia(Z,Sa)-Ea),Lb=a.yAxis.stacks[(C.y<0?"-":"")+a.stackKey],Rb;d&&a.visible&&Lb&&Lb[C.x]&&Lb[C.x].setOffset(z,U);if(bb(gb)<y){if(y){gb=y;Ea=bb(Ea-M)>y?Sa-y:M-(Z<=M?y:0)}Rb=Ea-3}sa(C,{barX:Na,barY:Ea,barW:U,barH:gb});C.shapeType="rect";Z=sa(b.renderer.Element.prototype.crisp.apply({},
163[e,Na,Ea,U,gb]),{r:c.borderRadius});if(e%2){Z.y-=1;Z.height+=1}C.shapeArgs=Z;C.trackerArgs=K(Rb)&&Ca(C.shapeArgs,{height:Ia(6,gb+3),y:Rb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;u(a.data,function(f){var g=f.plotY;if(g!==Wa&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Hc(d);d.animate(e)}else f.graphic=c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":ib]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a=
164this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options,h=g.cursor,i=h&&{cursor:h},j;u(a.data,function(m){e=m.tracker;d=m.trackerArgs||m.shapeArgs;delete d.strokeWidth;if(m.y!==null)if(e)e.attr(d);else m.tracker=c[m.shapeType](d).attr({isTracker:f,fill:ce,visibility:a.visible?Ab:ob,zIndex:g.zIndex||1}).on(Kb?"touchstart":"mouseover",function(v){j=v.relatedTarget||v.fromElement;b.hoverSeries!==a&&Ga(j,"isTracker")!==f&&a.onMouseOver();m.onMouseOver()}).on("mouseout",function(v){if(!g.stickyTracking){j=
165v.relatedTarget||v.toElement;Ga(j,"isTracker")!==f&&a.onMouseOut()}}).css(i).add(m.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){u(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&u(b.series,function(c){if(c.type===a.type)c.isDirty=true});sb.prototype.remove.apply(a,arguments)}});wb.column=hd;ma=yb(hd,
166{type:"bar",init:function(a){a.inverted=this.inverted=true;hd.prototype.init.apply(this,arguments)}});wb.bar=ma;ma=yb(sb,{type:"scatter",translate:function(){var a=this;sb.prototype.translate.apply(a);u(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},d;u(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout",
167function(){a.options.stickyTracking||a.onMouseOut()}).css(c)})},cleanData:function(){}});wb.scatter=ma;ma=yb(Oc,{init:function(){Oc.prototype.init.apply(this,arguments);var a=this,b;sa(a,{visible:a.visible!==false,name:A(a.name,"Slice")});b=function(){a.slice()};Qa(a,"select",b);Qa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,d=this.dataLabel,e=this.connector,f=this.shadowGroup,g;g=(this.visible=a=a===Wa?!this.visible:a)?"show":"hide";this.group[g]();c&&
168c[g]();d&&d[g]();e&&e[g]();f&&f[g]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;oc(c,d);A(b,true);a=this.sliced=K(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ma=yb(sb,{type:"pie",isCartesian:false,pointClass:ma,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=
169this.chart.counters.color},animate:function(){var a=this;u(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-kc/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,i=g.plotHeight,j,m,v,P=this.data,T=2*kc,Y,H=tb(h,i),U,z,M,y=c.dataLabels.distance;f=tc(f,function(C,Z){return(U=
170/%$/.test(C))?[h,i,H,H][Z]*ja(C)/100:C});this.getX=function(C,Z){v=Fa.asin((C-f[1])/(f[2]/2+y));return f[0]+(Z?-1:1)*rb(v)*(f[2]/2+y)};this.center=f;u(P,function(C){a+=C.y});u(P,function(C){Y=a?C.y/a:0;j=W(b*T*1E3)/1E3;b+=Y;m=W(b*T*1E3)/1E3;C.shapeType="arc";C.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:j,end:m};v=(m+j)/2;C.slicedTranslation=tc([rb(v)*d+g.plotLeft,Cb(v)*d+g.plotTop],W);z=rb(v)*f[2]/2;M=Cb(v)*f[2]/2;C.tooltipPos=[f[0]+z*0.7,f[1]+M*0.7];C.labelPos=[f[0]+z+rb(v)*y,f[1]+M+Cb(v)*
171y,f[0]+z+rb(v)*e,f[1]+M+Cb(v)*e,f[0]+z,f[1]+M,y<0?"center":v<T/4?"left":"right",v];C.percentage=Y*100;C.total=a});this.setTooltipPoints()},render:function(){this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=false},drawPoints:function(){var a=this.chart,b=a.renderer,c,d,e,f=this.options.shadow,g,h;u(this.data,function(i){d=i.graphic;h=i.shapeArgs;e=i.group;g=i.shadowGroup;if(f&&!g)g=
172i.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=i.group=b.g("point").attr({zIndex:5}).add();c=i.sliced?i.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else i.graphic=b.arc(h).attr(sa(i.pointAttr[ib],{"stroke-linejoin":"round"})).add(i.group).shadow(f,g);i.visible===false&&i.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,e=A(d.connectorPadding,10),f=A(d.connectorWidth,1),
173g,h,i=A(d.softConnector,true),j=d.distance,m=this.center,v=m[2]/2;m=m[1];var P=j>0,T=[[],[]],Y,H,U,z,M=2,y;if(d.enabled){sb.prototype.drawDataLabels.apply(this);u(a,function(gb){if(gb.dataLabel)T[gb.labelPos[7]<kc/2?0:1].push(gb)});T[1].reverse();z=function(gb,Lb){return Lb.y-gb.y};for(a=T[0][0]&&T[0][0].dataLabel&&ja(T[0][0].dataLabel.styles.lineHeight);M--;){var C=[],Z=[],Sa=T[M],Na=Sa.length,Ea;for(y=m-v-j;y<=m+v+j;y+=a)C.push(y);U=C.length;if(Na>U){h=[].concat(Sa);h.sort(z);for(y=Na;y--;)h[y].rank=
174y;for(y=Na;y--;)Sa[y].rank>=U&&Sa.splice(y,1);Na=Sa.length}for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;b=9999;for(H=0;H<U;H++){g=bb(C[H]-h[1]);if(g<b){b=g;Ea=H}}if(Ea<y&&C[y]!==null)Ea=y;else{if(U<Na-y+Ea&&C[y]!==null)Ea=U-Na+y;for(;C[Ea]===null;)Ea++}Z.push({i:Ea,y:C[Ea]});C[Ea]=null}Z.sort(z);for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;g=b.dataLabel;H=Z.pop();Y=h[1];U=b.visible===false?ob:Ab;Ea=H.i;H=H.y;if(Y>H&&C[Ea+1]!==null||Y<H&&C[Ea-1]!==null)H=Y;Y=this.getX(Ea===0||Ea===C.length-1?Y:H,M);g.attr({visibility:U,
175align:h[6]})[g.moved?"animate":"attr"]({x:Y+d.x+({left:e,right:-e}[h[6]]||0),y:H+d.y});g.moved=true;if(P&&f){g=b.connector;h=i?[Za,Y+(h[6]==="left"?5:-5),H,"C",Y,H,2*h[2]-h[4],2*h[3]-h[5],h[2],h[3],Ka,h[4],h[5]]:[Za,Y+(h[6]==="left"?5:-5),H,Ka,h[2],h[3],Ka,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",U)}else b.connector=g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||b.color||"#606060",visibility:U,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}},drawTracker:hd.prototype.drawTracker,
176getSymbol:function(){}});wb.pie=ma;db.Highcharts={Chart:Nd,dateFormat:Zc,pathAnim:Nc,getOptions:function(){return Xa},hasRtlBug:me,numberFormat:Ed,Point:Oc,Color:bc,Renderer:fd,seriesTypes:wb,setOptions:function(a){Xa=Ca(Xa,a);Id();return Xa},Series:sb,addEvent:Qa,removeEvent:pb,createElement:hb,discardElement:pc,css:Ja,each:u,extend:sa,map:tc,merge:Ca,pick:A,extendClass:yb,product:"Highcharts",version:"2.1.9"}})();
1770
=== removed file 'media/js/highcharts_219/highcharts.src.js'
--- media/js/highcharts_219/highcharts.src.js 2011-11-18 22:51:37 +0000
+++ media/js/highcharts_219/highcharts.src.js 1970-01-01 00:00:00 +0000
@@ -1,11454 +0,0 @@
1// ==ClosureCompiler==
2// @compilation_level SIMPLE_OPTIMIZATIONS
3
4/**
5 * @license Highcharts JS v2.1.9 (2011-11-11)
6 *
7 * (c) 2009-2011 Torstein Hønsi
8 *
9 * License: www.highcharts.com/license
10 */
11
12// JSLint options:
13/*global document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $ */
14
15(function () {
16// encapsulated variables
17var doc = document,
18 win = window,
19 math = Math,
20 mathRound = math.round,
21 mathFloor = math.floor,
22 mathCeil = math.ceil,
23 mathMax = math.max,
24 mathMin = math.min,
25 mathAbs = math.abs,
26 mathCos = math.cos,
27 mathSin = math.sin,
28 mathPI = math.PI,
29 deg2rad = mathPI * 2 / 360,
30
31
32 // some variables
33 userAgent = navigator.userAgent,
34 isIE = /msie/i.test(userAgent) && !win.opera,
35 docMode8 = doc.documentMode === 8,
36 isWebKit = /AppleWebKit/.test(userAgent),
37 isFirefox = /Firefox/.test(userAgent),
38 SVG_NS = 'http://www.w3.org/2000/svg',
39 hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,
40 hasRtlBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38
41 Renderer,
42 hasTouch = doc.documentElement.ontouchstart !== undefined,
43 symbolSizes = {},
44 idCounter = 0,
45 timeFactor = 1, // 1 = JavaScript time, 1000 = Unix time
46 garbageBin,
47 defaultOptions,
48 dateFormat, // function
49 globalAnimation,
50 pathAnim,
51
52
53 // some constants for frequently used strings
54 UNDEFINED,
55 DIV = 'div',
56 ABSOLUTE = 'absolute',
57 RELATIVE = 'relative',
58 HIDDEN = 'hidden',
59 PREFIX = 'highcharts-',
60 VISIBLE = 'visible',
61 PX = 'px',
62 NONE = 'none',
63 M = 'M',
64 L = 'L',
65 /*
66 * Empirical lowest possible opacities for TRACKER_FILL
67 * IE6: 0.002
68 * IE7: 0.002
69 * IE8: 0.002
70 * IE9: 0.00000000001 (unlimited)
71 * FF: 0.00000000001 (unlimited)
72 * Chrome: 0.000001
73 * Safari: 0.000001
74 * Opera: 0.00000000001 (unlimited)
75 */
76 TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.000001 : 0.002) + ')', // invisible but clickable
77 NORMAL_STATE = '',
78 HOVER_STATE = 'hover',
79 SELECT_STATE = 'select',
80
81 // time methods, changed based on whether or not UTC is used
82 makeTime,
83 getMinutes,
84 getHours,
85 getDay,
86 getDate,
87 getMonth,
88 getFullYear,
89 setMinutes,
90 setHours,
91 setDate,
92 setMonth,
93 setFullYear,
94
95 // check for a custom HighchartsAdapter defined prior to this file
96 globalAdapter = win.HighchartsAdapter,
97 adapter = globalAdapter || {},
98
99 // Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object
100 // and all the utility functions will be null. In that case they are populated by the
101 // default adapters below.
102 each = adapter.each,
103 grep = adapter.grep,
104 map = adapter.map,
105 merge = adapter.merge,
106 addEvent = adapter.addEvent,
107 removeEvent = adapter.removeEvent,
108 fireEvent = adapter.fireEvent,
109 animate = adapter.animate,
110 stop = adapter.stop,
111
112 // lookup over the types and the associated classes
113 seriesTypes = {};
114
115/**
116 * Extend an object with the members of another
117 * @param {Object} a The object to be extended
118 * @param {Object} b The object to add to the first one
119 */
120function extend(a, b) {
121 var n;
122 if (!a) {
123 a = {};
124 }
125 for (n in b) {
126 a[n] = b[n];
127 }
128 return a;
129}
130
131/**
132 * Shortcut for parseInt
133 * @param {Object} s
134 */
135function pInt(s, mag) {
136 return parseInt(s, mag || 10);
137}
138
139/**
140 * Check for string
141 * @param {Object} s
142 */
143function isString(s) {
144 return typeof s === 'string';
145}
146
147/**
148 * Check for object
149 * @param {Object} obj
150 */
151function isObject(obj) {
152 return typeof obj === 'object';
153}
154
155/**
156 * Check for array
157 * @param {Object} obj
158 */
159function isArray(obj) {
160 return Object.prototype.toString.call(obj) === '[object Array]';
161}
162
163/**
164 * Check for number
165 * @param {Object} n
166 */
167function isNumber(n) {
168 return typeof n === 'number';
169}
170
171function log2lin(num) {
172 return math.log(num) / math.LN10;
173}
174function lin2log(num) {
175 return math.pow(10, num);
176}
177
178/**
179 * Remove last occurence of an item from an array
180 * @param {Array} arr
181 * @param {Mixed} item
182 */
183function erase(arr, item) {
184 var i = arr.length;
185 while (i--) {
186 if (arr[i] === item) {
187 arr.splice(i, 1);
188 break;
189 }
190 }
191 //return arr;
192}
193
194/**
195 * Returns true if the object is not null or undefined. Like MooTools' $.defined.
196 * @param {Object} obj
197 */
198function defined(obj) {
199 return obj !== UNDEFINED && obj !== null;
200}
201
202/**
203 * Set or get an attribute or an object of attributes. Can't use jQuery attr because
204 * it attempts to set expando properties on the SVG element, which is not allowed.
205 *
206 * @param {Object} elem The DOM element to receive the attribute(s)
207 * @param {String|Object} prop The property or an abject of key-value pairs
208 * @param {String} value The value if a single property is set
209 */
210function attr(elem, prop, value) {
211 var key,
212 setAttribute = 'setAttribute',
213 ret;
214
215 // if the prop is a string
216 if (isString(prop)) {
217 // set the value
218 if (defined(value)) {
219
220 elem[setAttribute](prop, value);
221
222 // get the value
223 } else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...
224 ret = elem.getAttribute(prop);
225 }
226
227 // else if prop is defined, it is a hash of key/value pairs
228 } else if (defined(prop) && isObject(prop)) {
229 for (key in prop) {
230 elem[setAttribute](key, prop[key]);
231 }
232 }
233 return ret;
234}
235/**
236 * Check if an element is an array, and if not, make it into an array. Like
237 * MooTools' $.splat.
238 */
239function splat(obj) {
240 return isArray(obj) ? obj : [obj];
241}
242
243
244/**
245 * Return the first value that is defined. Like MooTools' $.pick.
246 */
247function pick() {
248 var args = arguments,
249 i,
250 arg,
251 length = args.length;
252 for (i = 0; i < length; i++) {
253 arg = args[i];
254 if (typeof arg !== 'undefined' && arg !== null) {
255 return arg;
256 }
257 }
258}
259
260/**
261 * Set CSS on a given element
262 * @param {Object} el
263 * @param {Object} styles Style object with camel case property names
264 */
265function css(el, styles) {
266 if (isIE) {
267 if (styles && styles.opacity !== UNDEFINED) {
268 styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
269 }
270 }
271 extend(el.style, styles);
272}
273
274/**
275 * Utility function to create element with attributes and styles
276 * @param {Object} tag
277 * @param {Object} attribs
278 * @param {Object} styles
279 * @param {Object} parent
280 * @param {Object} nopad
281 */
282function createElement(tag, attribs, styles, parent, nopad) {
283 var el = doc.createElement(tag);
284 if (attribs) {
285 extend(el, attribs);
286 }
287 if (nopad) {
288 css(el, {padding: 0, border: NONE, margin: 0});
289 }
290 if (styles) {
291 css(el, styles);
292 }
293 if (parent) {
294 parent.appendChild(el);
295 }
296 return el;
297}
298
299/**
300 * Extend a prototyped class by new members
301 * @param {Object} parent
302 * @param {Object} members
303 */
304function extendClass(parent, members) {
305 var object = function () {};
306 object.prototype = new parent();
307 extend(object.prototype, members);
308 return object;
309}
310
311/**
312 * Format a number and return a string based on input settings
313 * @param {Number} number The input number to format
314 * @param {Number} decimals The amount of decimals
315 * @param {String} decPoint The decimal point, defaults to the one given in the lang options
316 * @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options
317 */
318function numberFormat(number, decimals, decPoint, thousandsSep) {
319 var lang = defaultOptions.lang,
320 // http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
321 n = number,
322 c = isNaN(decimals = mathAbs(decimals)) ? 2 : decimals,
323 d = decPoint === undefined ? lang.decimalPoint : decPoint,
324 t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,
325 s = n < 0 ? "-" : "",
326 i = String(pInt(n = mathAbs(+n || 0).toFixed(c))),
327 j = i.length > 3 ? i.length % 3 : 0;
328
329 return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) +
330 (c ? d + mathAbs(n - i).toFixed(c).slice(2) : "");
331}
332
333/**
334 * Based on http://www.php.net/manual/en/function.strftime.php
335 * @param {String} format
336 * @param {Number} timestamp
337 * @param {Boolean} capitalize
338 */
339dateFormat = function (format, timestamp, capitalize) {
340 function pad(number) {
341 return number.toString().replace(/^([0-9])$/, '0$1');
342 }
343
344 if (!defined(timestamp) || isNaN(timestamp)) {
345 return 'Invalid date';
346 }
347 format = pick(format, '%Y-%m-%d %H:%M:%S');
348
349 var date = new Date(timestamp * timeFactor),
350 key, // used in for constuct below
351 // get the basic time values
352 hours = date[getHours](),
353 day = date[getDay](),
354 dayOfMonth = date[getDate](),
355 month = date[getMonth](),
356 fullYear = date[getFullYear](),
357 lang = defaultOptions.lang,
358 langWeekdays = lang.weekdays,
359 /* // uncomment this and the 'W' format key below to enable week numbers
360 weekNumber = function() {
361 var clone = new Date(date.valueOf()),
362 day = clone[getDay]() == 0 ? 7 : clone[getDay](),
363 dayNumber;
364 clone.setDate(clone[getDate]() + 4 - day);
365 dayNumber = mathFloor((clone.getTime() - new Date(clone[getFullYear](), 0, 1, -6)) / 86400000);
366 return 1 + mathFloor(dayNumber / 7);
367 },
368 */
369
370 // list all format keys
371 replacements = {
372
373 // Day
374 'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
375 'A': langWeekdays[day], // Long weekday, like 'Monday'
376 'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
377 'e': dayOfMonth, // Day of the month, 1 through 31
378
379 // Week (none implemented)
380 //'W': weekNumber(),
381
382 // Month
383 'b': lang.shortMonths[month], // Short month, like 'Jan'
384 'B': lang.months[month], // Long month, like 'January'
385 'm': pad(month + 1), // Two digit month number, 01 through 12
386
387 // Year
388 'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
389 'Y': fullYear, // Four digits year, like 2009
390
391 // Time
392 'H': pad(hours), // Two digits hours in 24h format, 00 through 23
393 'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
394 'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
395 'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
396 'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
397 'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
398 'S': pad(date.getSeconds()) // Two digits seconds, 00 through 59
399
400 };
401
402
403 // do the replaces
404 for (key in replacements) {
405 format = format.replace('%' + key, replacements[key]);
406 }
407
408 // Optionally capitalize the string and return
409 return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;
410};
411
412/**
413 * Loop up the node tree and add offsetWidth and offsetHeight to get the
414 * total page offset for a given element. Used by Opera and iOS on hover and
415 * all browsers on point click.
416 *
417 * @param {Object} el
418 *
419 */
420function getPosition(el) {
421 var p = { left: el.offsetLeft, top: el.offsetTop };
422 el = el.offsetParent;
423 while (el) {
424 p.left += el.offsetLeft;
425 p.top += el.offsetTop;
426 if (el !== doc.body && el !== doc.documentElement) {
427 p.left -= el.scrollLeft;
428 p.top -= el.scrollTop;
429 }
430 el = el.offsetParent;
431 }
432 return p;
433}
434
435/**
436 * Helper class that contains variuos counters that are local to the chart.
437 */
438function ChartCounters() {
439 this.color = 0;
440 this.symbol = 0;
441}
442
443ChartCounters.prototype = {
444 /**
445 * Wraps the color counter if it reaches the specified length.
446 */
447 wrapColor: function (length) {
448 if (this.color >= length) {
449 this.color = 0;
450 }
451 },
452
453 /**
454 * Wraps the symbol counter if it reaches the specified length.
455 */
456 wrapSymbol: function (length) {
457 if (this.symbol >= length) {
458 this.symbol = 0;
459 }
460 }
461};
462
463/**
464 * Utility method extracted from Tooltip code that places a tooltip in a chart without spilling over
465 * and not covering the point it self.
466 */
467function placeBox(boxWidth, boxHeight, outerLeft, outerTop, outerWidth, outerHeight, point) {
468 // keep the box within the chart area
469 var pointX = point.x,
470 pointY = point.y,
471 x = pointX - boxWidth + outerLeft - 25,
472 y = pointY - boxHeight + outerTop + 10,
473 alignedRight;
474
475 // it is too far to the left, adjust it
476 if (x < 7) {
477 x = outerLeft + pointX + 15;
478 }
479
480 // Test to see if the tooltip is to far to the right,
481 // if it is, move it back to be inside and then up to not cover the point.
482 if ((x + boxWidth) > (outerLeft + outerWidth)) {
483 x -= (x + boxWidth) - (outerLeft + outerWidth);
484 y -= boxHeight;
485 alignedRight = true;
486 }
487
488 if (y < 5) {
489 y = 5; // above
490
491 // If the tooltip is still covering the point, move it below instead
492 if (alignedRight && pointY >= y && pointY <= (y + boxHeight)) {
493 y = pointY + boxHeight - 5; // below
494 }
495 } else if (y + boxHeight > outerTop + outerHeight) {
496 y = outerTop + outerHeight - boxHeight - 5; // below
497 }
498
499 return {x: x, y: y};
500}
501
502/**
503 * Utility method that sorts an object array and keeping the order of equal items.
504 * ECMA script standard does not specify the behaviour when items are equal.
505 */
506function stableSort(arr, sortFunction) {
507 var length = arr.length,
508 i;
509
510 // Add index to each item
511 for (i = 0; i < length; i++) {
512 arr[i].ss_i = i; // stable sort index
513 }
514
515 arr.sort(function (a, b) {
516 var sortValue = sortFunction(a, b);
517 return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
518 });
519
520 // Remove index from items
521 for (i = 0; i < length; i++) {
522 delete arr[i].ss_i; // stable sort index
523 }
524}
525
526/**
527 * Utility method that destroys any SVGElement or VMLElement that are properties on the given object.
528 * It loops all properties and invokes destroy if there is a destroy method. The property is
529 * then delete'ed.
530 */
531function destroyObjectProperties(obj) {
532 var n;
533 for (n in obj) {
534 // If the object is non-null and destroy is defined
535 if (obj[n] && obj[n].destroy) {
536 // Invoke the destroy
537 obj[n].destroy();
538 }
539
540 // Delete the property from the object.
541 delete obj[n];
542 }
543}
544
545/**
546 * Path interpolation algorithm used across adapters
547 */
548pathAnim = {
549 /**
550 * Prepare start and end values so that the path can be animated one to one
551 */
552 init: function (elem, fromD, toD) {
553 fromD = fromD || '';
554 var shift = elem.shift,
555 bezier = fromD.indexOf('C') > -1,
556 numParams = bezier ? 7 : 3,
557 endLength,
558 slice,
559 i,
560 start = fromD.split(' '),
561 end = [].concat(toD), // copy
562 startBaseLine,
563 endBaseLine,
564 sixify = function (arr) { // in splines make move points have six parameters like bezier curves
565 i = arr.length;
566 while (i--) {
567 if (arr[i] === M) {
568 arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
569 }
570 }
571 };
572
573 if (bezier) {
574 sixify(start);
575 sixify(end);
576 }
577
578 // pull out the base lines before padding
579 if (elem.isArea) {
580 startBaseLine = start.splice(start.length - 6, 6);
581 endBaseLine = end.splice(end.length - 6, 6);
582 }
583
584 // if shifting points, prepend a dummy point to the end path
585 if (shift) {
586
587 end = [].concat(end).splice(0, numParams).concat(end);
588 elem.shift = false; // reset for following animations
589 }
590
591 // copy and append last point until the length matches the end length
592 if (start.length) {
593 endLength = end.length;
594 while (start.length < endLength) {
595
596 //bezier && sixify(start);
597 slice = [].concat(start).splice(start.length - numParams, numParams);
598 if (bezier) { // disable first control point
599 slice[numParams - 6] = slice[numParams - 2];
600 slice[numParams - 5] = slice[numParams - 1];
601 }
602 start = start.concat(slice);
603 }
604 }
605
606 if (startBaseLine) { // append the base lines for areas
607 start = start.concat(startBaseLine);
608 end = end.concat(endBaseLine);
609 }
610 return [start, end];
611 },
612
613 /**
614 * Interpolate each value of the path and return the array
615 */
616 step: function (start, end, pos, complete) {
617 var ret = [],
618 i = start.length,
619 startVal;
620
621 if (pos === 1) { // land on the final path without adjustment points appended in the ends
622 ret = complete;
623
624 } else if (i === end.length && pos < 1) {
625 while (i--) {
626 startVal = parseFloat(start[i]);
627 ret[i] =
628 isNaN(startVal) ? // a letter instruction like M or L
629 start[i] :
630 pos * (parseFloat(end[i] - startVal)) + startVal;
631
632 }
633 } else { // if animation is finished or length not matching, land on right value
634 ret = end;
635 }
636 return ret;
637 }
638};
639
640
641/**
642 * Set the global animation to either a given value, or fall back to the
643 * given chart's animation option
644 * @param {Object} animation
645 * @param {Object} chart
646 */
647function setAnimation(animation, chart) {
648 globalAnimation = pick(animation, chart.animation);
649}
650
651/*
652 * Define the adapter for frameworks. If an external adapter is not defined,
653 * Highcharts reverts to the built-in jQuery adapter.
654 */
655if (globalAdapter && globalAdapter.init) {
656 // Initialize the adapter with the pathAnim object that takes care
657 // of path animations.
658 globalAdapter.init(pathAnim);
659}
660if (!globalAdapter && win.jQuery) {
661 var jQ = jQuery;
662
663 /**
664 * Utility for iterating over an array. Parameters are reversed compared to jQuery.
665 * @param {Array} arr
666 * @param {Function} fn
667 */
668 each = function (arr, fn) {
669 var i = 0,
670 len = arr.length;
671 for (; i < len; i++) {
672 if (fn.call(arr[i], arr[i], i, arr) === false) {
673 return i;
674 }
675 }
676 };
677
678 /**
679 * Filter an array
680 */
681 grep = jQ.grep;
682
683 /**
684 * Map an array
685 * @param {Array} arr
686 * @param {Function} fn
687 */
688 map = function (arr, fn) {
689 //return jQuery.map(arr, fn);
690 var results = [],
691 i = 0,
692 len = arr.length;
693 for (; i < len; i++) {
694 results[i] = fn.call(arr[i], arr[i], i, arr);
695 }
696 return results;
697
698 };
699
700 /**
701 * Deep merge two objects and return a third object
702 */
703 merge = function () {
704 var args = arguments;
705 return jQ.extend(true, null, args[0], args[1], args[2], args[3]);
706 };
707
708 /**
709 * Add an event listener
710 * @param {Object} el A HTML element or custom object
711 * @param {String} event The event type
712 * @param {Function} fn The event handler
713 */
714 addEvent = function (el, event, fn) {
715 jQ(el).bind(event, fn);
716 };
717
718 /**
719 * Remove event added with addEvent
720 * @param {Object} el The object
721 * @param {String} eventType The event type. Leave blank to remove all events.
722 * @param {Function} handler The function to remove
723 */
724 removeEvent = function (el, eventType, handler) {
725 // workaround for jQuery issue with unbinding custom events:
726 // http://forum.jquery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jquery-1-4-2
727 var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';
728 if (doc[func] && !el[func]) {
729 el[func] = function () {};
730 }
731
732 jQ(el).unbind(eventType, handler);
733 };
734
735 /**
736 * Fire an event on a custom object
737 * @param {Object} el
738 * @param {String} type
739 * @param {Object} eventArguments
740 * @param {Function} defaultFunction
741 */
742 fireEvent = function (el, type, eventArguments, defaultFunction) {
743 var event = jQ.Event(type),
744 detachedType = 'detached' + type;
745 extend(event, eventArguments);
746
747 // Prevent jQuery from triggering the object method that is named the
748 // same as the event. For example, if the event is 'select', jQuery
749 // attempts calling el.select and it goes into a loop.
750 if (el[type]) {
751 el[detachedType] = el[type];
752 el[type] = null;
753 }
754
755 // trigger it
756 jQ(el).trigger(event);
757
758 // attach the method
759 if (el[detachedType]) {
760 el[type] = el[detachedType];
761 el[detachedType] = null;
762 }
763
764 if (defaultFunction && !event.isDefaultPrevented()) {
765 defaultFunction(event);
766 }
767 };
768
769 /**
770 * Animate a HTML element or SVG element wrapper
771 * @param {Object} el
772 * @param {Object} params
773 * @param {Object} options jQuery-like animation options: duration, easing, callback
774 */
775 animate = function (el, params, options) {
776 var $el = jQ(el);
777 if (params.d) {
778 el.toD = params.d; // keep the array form for paths, used in jQ.fx.step.d
779 params.d = 1; // because in jQuery, animating to an array has a different meaning
780 }
781
782 $el.stop();
783 $el.animate(params, options);
784
785 };
786 /**
787 * Stop running animation
788 */
789 stop = function (el) {
790 jQ(el).stop();
791 };
792
793
794 //=== Extend jQuery on init
795
796 /*jslint unparam: true*//* allow unused param x in this function */
797 jQ.extend(jQ.easing, {
798 easeOutQuad: function (x, t, b, c, d) {
799 return -c * (t /= d) * (t - 2) + b;
800 }
801 });
802 /*jslint unparam: false*/
803
804 // extend the animate function to allow SVG animations
805 var jFx = jQuery.fx,
806 jStep = jFx.step;
807
808 // extend some methods to check for elem.attr, which means it is a Highcharts SVG object
809 each(['cur', '_default', 'width', 'height'], function (fn, i) {
810 var obj = i ? jStep : jFx.prototype, // 'cur', the getter' relates to jFx.prototype
811 base = obj[fn],
812 elem;
813
814 if (base) { // step.width and step.height don't exist in jQuery < 1.7
815
816 // create the extended function replacement
817 obj[fn] = function (fx) {
818
819 // jFx.prototype.cur does not use fx argument
820 fx = i ? fx : this;
821
822 // shortcut
823 elem = fx.elem;
824
825 // jFX.prototype.cur returns the current value. The other ones are setters
826 // and returning a value has no effect.
827 return elem.attr ? // is SVG element wrapper
828 elem.attr(fx.prop, fx.now) : // apply the SVG wrapper's method
829 base.apply(this, arguments); // use jQuery's built-in method
830 };
831 }
832 });
833
834 // animate paths
835 jStep.d = function (fx) {
836 var elem = fx.elem;
837
838
839 // Normally start and end should be set in state == 0, but sometimes,
840 // for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped
841 // in these cases
842 if (!fx.started) {
843 var ends = pathAnim.init(elem, elem.d, elem.toD);
844 fx.start = ends[0];
845 fx.end = ends[1];
846 fx.started = true;
847 }
848
849
850 // interpolate each value of the path
851 elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));
852
853 };
854}
855
856
857/**
858 * Add a global listener for mousemove events
859 */
860/*addEvent(doc, 'mousemove', function(e) {
861 if (globalMouseMove) {
862 globalMouseMove(e);
863 }
864});*/
865/**
866 * Set the time methods globally based on the useUTC option. Time method can be either
867 * local time or UTC (default).
868 */
869function setTimeMethods() {
870 var useUTC = defaultOptions.global.useUTC;
871
872 makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {
873 return new Date(
874 year,
875 month,
876 pick(date, 1),
877 pick(hours, 0),
878 pick(minutes, 0),
879 pick(seconds, 0)
880 ).getTime();
881 };
882 getMinutes = useUTC ? 'getUTCMinutes' : 'getMinutes';
883 getHours = useUTC ? 'getUTCHours' : 'getHours';
884 getDay = useUTC ? 'getUTCDay' : 'getDay';
885 getDate = useUTC ? 'getUTCDate' : 'getDate';
886 getMonth = useUTC ? 'getUTCMonth' : 'getMonth';
887 getFullYear = useUTC ? 'getUTCFullYear' : 'getFullYear';
888 setMinutes = useUTC ? 'setUTCMinutes' : 'setMinutes';
889 setHours = useUTC ? 'setUTCHours' : 'setHours';
890 setDate = useUTC ? 'setUTCDate' : 'setDate';
891 setMonth = useUTC ? 'setUTCMonth' : 'setMonth';
892 setFullYear = useUTC ? 'setUTCFullYear' : 'setFullYear';
893
894}
895
896/**
897 * Merge the default options with custom options and return the new options structure
898 * @param {Object} options The new custom options
899 */
900function setOptions(options) {
901 defaultOptions = merge(defaultOptions, options);
902
903 // apply UTC
904 setTimeMethods();
905
906 return defaultOptions;
907}
908
909/**
910 * Get the updated default options. Merely exposing defaultOptions for outside modules
911 * isn't enough because the setOptions method creates a new object.
912 */
913function getOptions() {
914 return defaultOptions;
915}
916
917/**
918 * Discard an element by moving it to the bin and delete
919 * @param {Object} The HTML node to discard
920 */
921function discardElement(element) {
922 // create a garbage bin element, not part of the DOM
923 if (!garbageBin) {
924 garbageBin = createElement(DIV);
925 }
926
927 // move the node and empty bin
928 if (element) {
929 garbageBin.appendChild(element);
930 }
931 garbageBin.innerHTML = '';
932}
933
934/* ****************************************************************************
935 * Handle the options *
936 *****************************************************************************/
937var
938
939defaultLabelOptions = {
940 enabled: true,
941 // rotation: 0,
942 align: 'center',
943 x: 0,
944 y: 15,
945 /*formatter: function() {
946 return this.value;
947 },*/
948 style: {
949 color: '#666',
950 fontSize: '11px',
951 lineHeight: '14px'
952 }
953};
954
955defaultOptions = {
956 colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE',
957 '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'],
958 symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],
959 lang: {
960 loading: 'Loading...',
961 months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',
962 'August', 'September', 'October', 'November', 'December'],
963 shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
964 weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
965 decimalPoint: '.',
966 resetZoom: 'Reset zoom',
967 resetZoomTitle: 'Reset zoom level 1:1',
968 thousandsSep: ','
969 },
970 global: {
971 useUTC: true
972 },
973 chart: {
974 //animation: true,
975 //alignTicks: false,
976 //reflow: true,
977 //className: null,
978 //events: { load, selection },
979 //margin: [null],
980 //marginTop: null,
981 //marginRight: null,
982 //marginBottom: null,
983 //marginLeft: null,
984 borderColor: '#4572A7',
985 //borderWidth: 0,
986 borderRadius: 5,
987 defaultSeriesType: 'line',
988 ignoreHiddenSeries: true,
989 //inverted: false,
990 //shadow: false,
991 spacingTop: 10,
992 spacingRight: 10,
993 spacingBottom: 15,
994 spacingLeft: 10,
995 style: {
996 fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font
997 fontSize: '12px'
998 },
999 backgroundColor: '#FFFFFF',
1000 //plotBackgroundColor: null,
1001 plotBorderColor: '#C0C0C0'
1002 //plotBorderWidth: 0,
1003 //plotShadow: false,
1004 //zoomType: ''
1005 },
1006 title: {
1007 text: 'Chart title',
1008 align: 'center',
1009 // floating: false,
1010 // margin: 15,
1011 // x: 0,
1012 // verticalAlign: 'top',
1013 y: 15,
1014 style: {
1015 color: '#3E576F',
1016 fontSize: '16px'
1017 }
1018
1019 },
1020 subtitle: {
1021 text: '',
1022 align: 'center',
1023 // floating: false
1024 // x: 0,
1025 // verticalAlign: 'top',
1026 y: 30,
1027 style: {
1028 color: '#6D869F'
1029 }
1030 },
1031
1032 plotOptions: {
1033 line: { // base series options
1034 allowPointSelect: false,
1035 showCheckbox: false,
1036 animation: {
1037 duration: 1000
1038 },
1039 //connectNulls: false,
1040 //cursor: 'default',
1041 //dashStyle: null,
1042 //enableMouseTracking: true,
1043 events: {},
1044 //legendIndex: 0,
1045 lineWidth: 2,
1046 shadow: true,
1047 // stacking: null,
1048 marker: {
1049 enabled: true,
1050 //symbol: null,
1051 lineWidth: 0,
1052 radius: 4,
1053 lineColor: '#FFFFFF',
1054 //fillColor: null,
1055 states: { // states for a single point
1056 hover: {
1057 //radius: base + 2
1058 },
1059 select: {
1060 fillColor: '#FFFFFF',
1061 lineColor: '#000000',
1062 lineWidth: 2
1063 }
1064 }
1065 },
1066 point: {
1067 events: {}
1068 },
1069 dataLabels: merge(defaultLabelOptions, {
1070 enabled: false,
1071 y: -6,
1072 formatter: function () {
1073 return this.y;
1074 }
1075 }),
1076
1077 //pointStart: 0,
1078 //pointInterval: 1,
1079 showInLegend: true,
1080 states: { // states for the entire series
1081 hover: {
1082 //enabled: false,
1083 //lineWidth: base + 1,
1084 marker: {
1085 // lineWidth: base + 1,
1086 // radius: base + 1
1087 }
1088 },
1089 select: {
1090 marker: {}
1091 }
1092 },
1093 stickyTracking: true
1094 //zIndex: null
1095 }
1096 },
1097 labels: {
1098 //items: [],
1099 style: {
1100 //font: defaultFont,
1101 position: ABSOLUTE,
1102 color: '#3E576F'
1103 }
1104 },
1105 legend: {
1106 enabled: true,
1107 align: 'center',
1108 //floating: false,
1109 layout: 'horizontal',
1110 labelFormatter: function () {
1111 return this.name;
1112 },
1113 borderWidth: 1,
1114 borderColor: '#909090',
1115 borderRadius: 5,
1116 // margin: 10,
1117 // reversed: false,
1118 shadow: false,
1119 // backgroundColor: null,
1120 style: {
1121 padding: '5px'
1122 },
1123 itemStyle: {
1124 cursor: 'pointer',
1125 color: '#3E576F'
1126 },
1127 itemHoverStyle: {
1128 cursor: 'pointer',
1129 color: '#000000'
1130 },
1131 itemHiddenStyle: {
1132 color: '#C0C0C0'
1133 },
1134 itemCheckboxStyle: {
1135 position: ABSOLUTE,
1136 width: '13px', // for IE precision
1137 height: '13px'
1138 },
1139 // itemWidth: undefined,
1140 symbolWidth: 16,
1141 symbolPadding: 5,
1142 verticalAlign: 'bottom',
1143 // width: undefined,
1144 x: 0,
1145 y: 0
1146 },
1147
1148 loading: {
1149 hideDuration: 100,
1150 labelStyle: {
1151 fontWeight: 'bold',
1152 position: RELATIVE,
1153 top: '1em'
1154 },
1155 showDuration: 100,
1156 style: {
1157 position: ABSOLUTE,
1158 backgroundColor: 'white',
1159 opacity: 0.5,
1160 textAlign: 'center'
1161 }
1162 },
1163
1164 tooltip: {
1165 enabled: true,
1166 //crosshairs: null,
1167 backgroundColor: 'rgba(255, 255, 255, .85)',
1168 borderWidth: 2,
1169 borderRadius: 5,
1170 //formatter: defaultFormatter,
1171 shadow: true,
1172 //shared: false,
1173 snap: hasTouch ? 25 : 10,
1174 style: {
1175 color: '#333333',
1176 fontSize: '12px',
1177 padding: '5px',
1178 whiteSpace: 'nowrap'
1179 }
1180 },
1181
1182 toolbar: {
1183 itemStyle: {
1184 color: '#4572A7',
1185 cursor: 'pointer'
1186 }
1187 },
1188
1189 credits: {
1190 enabled: true,
1191 text: 'Highcharts.com',
1192 href: 'http://www.highcharts.com',
1193 position: {
1194 align: 'right',
1195 x: -10,
1196 verticalAlign: 'bottom',
1197 y: -5
1198 },
1199 style: {
1200 cursor: 'pointer',
1201 color: '#909090',
1202 fontSize: '10px'
1203 }
1204 }
1205};
1206
1207// Axis defaults
1208var defaultXAxisOptions = {
1209 // allowDecimals: null,
1210 // alternateGridColor: null,
1211 // categories: [],
1212 dateTimeLabelFormats: {
1213 second: '%H:%M:%S',
1214 minute: '%H:%M',
1215 hour: '%H:%M',
1216 day: '%e. %b',
1217 week: '%e. %b',
1218 month: '%b \'%y',
1219 year: '%Y'
1220 },
1221 endOnTick: false,
1222 gridLineColor: '#C0C0C0',
1223 // gridLineDashStyle: 'solid', // docs
1224 // gridLineWidth: 0,
1225 // reversed: false,
1226
1227 labels: defaultLabelOptions,
1228 // { step: null },
1229 lineColor: '#C0D0E0',
1230 lineWidth: 1,
1231 //linkedTo: null,
1232 max: null,
1233 min: null,
1234 minPadding: 0.01,
1235 maxPadding: 0.01,
1236 //maxZoom: null,
1237 minorGridLineColor: '#E0E0E0',
1238 // minorGridLineDashStyle: null,
1239 minorGridLineWidth: 1,
1240 minorTickColor: '#A0A0A0',
1241 //minorTickInterval: null,
1242 minorTickLength: 2,
1243 minorTickPosition: 'outside', // inside or outside
1244 //minorTickWidth: 0,
1245 //opposite: false,
1246 //offset: 0,
1247 //plotBands: [{
1248 // events: {},
1249 // zIndex: 1,
1250 // labels: { align, x, verticalAlign, y, style, rotation, textAlign }
1251 //}],
1252 //plotLines: [{
1253 // events: {}
1254 // dashStyle: {}
1255 // zIndex:
1256 // labels: { align, x, verticalAlign, y, style, rotation, textAlign }
1257 //}],
1258 //reversed: false,
1259 // showFirstLabel: true,
1260 // showLastLabel: false,
1261 startOfWeek: 1,
1262 startOnTick: false,
1263 tickColor: '#C0D0E0',
1264 //tickInterval: null,
1265 tickLength: 5,
1266 tickmarkPlacement: 'between', // on or between
1267 tickPixelInterval: 100,
1268 tickPosition: 'outside',
1269 tickWidth: 1,
1270 title: {
1271 //text: null,
1272 align: 'middle', // low, middle or high
1273 //margin: 0 for horizontal, 10 for vertical axes,
1274 //rotation: 0,
1275 //side: 'outside',
1276 style: {
1277 color: '#6D869F',
1278 //font: defaultFont.replace('normal', 'bold')
1279 fontWeight: 'bold'
1280 }
1281 //x: 0,
1282 //y: 0
1283 },
1284 type: 'linear' // linear, logarithmic or datetime
1285},
1286
1287defaultYAxisOptions = merge(defaultXAxisOptions, {
1288 endOnTick: true,
1289 gridLineWidth: 1,
1290 tickPixelInterval: 72,
1291 showLastLabel: true,
1292 labels: {
1293 align: 'right',
1294 x: -8,
1295 y: 3
1296 },
1297 lineWidth: 0,
1298 maxPadding: 0.05,
1299 minPadding: 0.05,
1300 startOnTick: true,
1301 tickWidth: 0,
1302 title: {
1303 rotation: 270,
1304 text: 'Y-values'
1305 },
1306 stackLabels: {
1307 enabled: false,
1308 //align: dynamic,
1309 //y: dynamic,
1310 //x: dynamic,
1311 //verticalAlign: dynamic,
1312 //textAlign: dynamic,
1313 //rotation: 0,
1314 formatter: function () {
1315 return this.total;
1316 },
1317 style: defaultLabelOptions.style
1318 }
1319}),
1320
1321defaultLeftAxisOptions = {
1322 labels: {
1323 align: 'right',
1324 x: -8,
1325 y: null
1326 },
1327 title: {
1328 rotation: 270
1329 }
1330},
1331defaultRightAxisOptions = {
1332 labels: {
1333 align: 'left',
1334 x: 8,
1335 y: null
1336 },
1337 title: {
1338 rotation: 90
1339 }
1340},
1341defaultBottomAxisOptions = { // horizontal axis
1342 labels: {
1343 align: 'center',
1344 x: 0,
1345 y: 14
1346 // staggerLines: null
1347 },
1348 title: {
1349 rotation: 0
1350 }
1351},
1352defaultTopAxisOptions = merge(defaultBottomAxisOptions, {
1353 labels: {
1354 y: -5
1355 // staggerLines: null
1356 }
1357});
1358
1359
1360
1361
1362// Series defaults
1363var defaultPlotOptions = defaultOptions.plotOptions,
1364 defaultSeriesOptions = defaultPlotOptions.line;
1365//defaultPlotOptions.line = merge(defaultSeriesOptions);
1366defaultPlotOptions.spline = merge(defaultSeriesOptions);
1367defaultPlotOptions.scatter = merge(defaultSeriesOptions, {
1368 lineWidth: 0,
1369 states: {
1370 hover: {
1371 lineWidth: 0
1372 }
1373 }
1374});
1375defaultPlotOptions.area = merge(defaultSeriesOptions, {
1376 // threshold: 0,
1377 // lineColor: null, // overrides color, but lets fillColor be unaltered
1378 // fillOpacity: 0.75,
1379 // fillColor: null
1380
1381});
1382defaultPlotOptions.areaspline = merge(defaultPlotOptions.area);
1383defaultPlotOptions.column = merge(defaultSeriesOptions, {
1384 borderColor: '#FFFFFF',
1385 borderWidth: 1,
1386 borderRadius: 0,
1387 //colorByPoint: undefined,
1388 groupPadding: 0.2,
1389 marker: null, // point options are specified in the base options
1390 pointPadding: 0.1,
1391 //pointWidth: null,
1392 minPointLength: 0,
1393 states: {
1394 hover: {
1395 brightness: 0.1,
1396 shadow: false
1397 },
1398 select: {
1399 color: '#C0C0C0',
1400 borderColor: '#000000',
1401 shadow: false
1402 }
1403 },
1404 dataLabels: {
1405 y: null,
1406 verticalAlign: null
1407 }
1408});
1409defaultPlotOptions.bar = merge(defaultPlotOptions.column, {
1410 dataLabels: {
1411 align: 'left',
1412 x: 5,
1413 y: 0
1414 }
1415});
1416defaultPlotOptions.pie = merge(defaultSeriesOptions, {
1417 //dragType: '', // n/a
1418 borderColor: '#FFFFFF',
1419 borderWidth: 1,
1420 center: ['50%', '50%'],
1421 colorByPoint: true, // always true for pies
1422 dataLabels: {
1423 // align: null,
1424 // connectorWidth: 1,
1425 // connectorColor: point.color,
1426 // connectorPadding: 5,
1427 distance: 30,
1428 enabled: true,
1429 formatter: function () {
1430 return this.point.name;
1431 },
1432 // softConnector: true,
1433 y: 5
1434 },
1435 //innerSize: 0,
1436 legendType: 'point',
1437 marker: null, // point options are specified in the base options
1438 size: '75%',
1439 showInLegend: false,
1440 slicedOffset: 10,
1441 states: {
1442 hover: {
1443 brightness: 0.1,
1444 shadow: false
1445 }
1446 }
1447
1448});
1449
1450// set the default time methods
1451setTimeMethods();
1452
1453
1454/**
1455 * Handle color operations. The object methods are chainable.
1456 * @param {String} input The input color in either rbga or hex format
1457 */
1458var Color = function (input) {
1459 // declare variables
1460 var rgba = [], result;
1461
1462 /**
1463 * Parse the input color to rgba array
1464 * @param {String} input
1465 */
1466 function init(input) {
1467
1468 // rgba
1469 result = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(input);
1470 if (result) {
1471 rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];
1472 } else { // hex
1473 result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(input);
1474 if (result) {
1475 rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];
1476 }
1477 }
1478
1479 }
1480 /**
1481 * Return the color a specified format
1482 * @param {String} format
1483 */
1484 function get(format) {
1485 var ret;
1486
1487 // it's NaN if gradient colors on a column chart
1488 if (rgba && !isNaN(rgba[0])) {
1489 if (format === 'rgb') {
1490 ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
1491 } else if (format === 'a') {
1492 ret = rgba[3];
1493 } else {
1494 ret = 'rgba(' + rgba.join(',') + ')';
1495 }
1496 } else {
1497 ret = input;
1498 }
1499 return ret;
1500 }
1501
1502 /**
1503 * Brighten the color
1504 * @param {Number} alpha
1505 */
1506 function brighten(alpha) {
1507 if (isNumber(alpha) && alpha !== 0) {
1508 var i;
1509 for (i = 0; i < 3; i++) {
1510 rgba[i] += pInt(alpha * 255);
1511
1512 if (rgba[i] < 0) {
1513 rgba[i] = 0;
1514 }
1515 if (rgba[i] > 255) {
1516 rgba[i] = 255;
1517 }
1518 }
1519 }
1520 return this;
1521 }
1522 /**
1523 * Set the color's opacity to a given alpha value
1524 * @param {Number} alpha
1525 */
1526 function setOpacity(alpha) {
1527 rgba[3] = alpha;
1528 return this;
1529 }
1530
1531 // initialize: parse the input
1532 init(input);
1533
1534 // public methods
1535 return {
1536 get: get,
1537 brighten: brighten,
1538 setOpacity: setOpacity
1539 };
1540};
1541
1542/**
1543 * A wrapper object for SVG elements
1544 */
1545function SVGElement() {}
1546
1547SVGElement.prototype = {
1548 /**
1549 * Initialize the SVG renderer
1550 * @param {Object} renderer
1551 * @param {String} nodeName
1552 */
1553 init: function (renderer, nodeName) {
1554 this.element = doc.createElementNS(SVG_NS, nodeName);
1555 this.renderer = renderer;
1556 },
1557 /**
1558 * Animate a given attribute
1559 * @param {Object} params
1560 * @param {Number} options The same options as in jQuery animation
1561 * @param {Function} complete Function to perform at the end of animation
1562 */
1563 animate: function (params, options, complete) {
1564 var animOptions = pick(options, globalAnimation, true);
1565 if (animOptions) {
1566 animOptions = merge(animOptions);
1567 if (complete) { // allows using a callback with the global animation without overwriting it
1568 animOptions.complete = complete;
1569 }
1570 animate(this, params, animOptions);
1571 } else {
1572 this.attr(params);
1573 if (complete) {
1574 complete();
1575 }
1576 }
1577 },
1578 /**
1579 * Set or get a given attribute
1580 * @param {Object|String} hash
1581 * @param {Mixed|Undefined} val
1582 */
1583 attr: function (hash, val) {
1584 var key,
1585 value,
1586 i,
1587 child,
1588 element = this.element,
1589 nodeName = element.nodeName,
1590 renderer = this.renderer,
1591 skipAttr,
1592 shadows = this.shadows,
1593 htmlNode = this.htmlNode,
1594 hasSetSymbolSize,
1595 ret = this;
1596
1597 // single key-value pair
1598 if (isString(hash) && defined(val)) {
1599 key = hash;
1600 hash = {};
1601 hash[key] = val;
1602 }
1603
1604 // used as a getter: first argument is a string, second is undefined
1605 if (isString(hash)) {
1606 key = hash;
1607 if (nodeName === 'circle') {
1608 key = { x: 'cx', y: 'cy' }[key] || key;
1609 } else if (key === 'strokeWidth') {
1610 key = 'stroke-width';
1611 }
1612 ret = attr(element, key) || this[key] || 0;
1613
1614 if (key !== 'd' && key !== 'visibility') { // 'd' is string in animation step
1615 ret = parseFloat(ret);
1616 }
1617
1618 // setter
1619 } else {
1620
1621 for (key in hash) {
1622 skipAttr = false; // reset
1623 value = hash[key];
1624
1625 // paths
1626 if (key === 'd') {
1627 if (value && value.join) { // join path
1628 value = value.join(' ');
1629 }
1630 if (/(NaN| {2}|^$)/.test(value)) {
1631 value = 'M 0 0';
1632 }
1633 this.d = value; // shortcut for animations
1634
1635 // update child tspans x values
1636 } else if (key === 'x' && nodeName === 'text') {
1637 for (i = 0; i < element.childNodes.length; i++) {
1638 child = element.childNodes[i];
1639 // if the x values are equal, the tspan represents a linebreak
1640 if (attr(child, 'x') === attr(element, 'x')) {
1641 //child.setAttribute('x', value);
1642 attr(child, 'x', value);
1643 }
1644 }
1645
1646 if (this.rotation) {
1647 attr(element, 'transform', 'rotate(' + this.rotation + ' ' + value + ' ' +
1648 pInt(hash.y || attr(element, 'y')) + ')');
1649 }
1650
1651 // apply gradients
1652 } else if (key === 'fill') {
1653 value = renderer.color(value, element, key);
1654
1655 // circle x and y
1656 } else if (nodeName === 'circle' && (key === 'x' || key === 'y')) {
1657 key = { x: 'cx', y: 'cy' }[key] || key;
1658
1659 // translation and text rotation
1660 } else if (key === 'translateX' || key === 'translateY' || key === 'rotation' || key === 'verticalAlign') {
1661 this[key] = value;
1662 this.updateTransform();
1663 skipAttr = true;
1664
1665 // apply opacity as subnode (required by legacy WebKit and Batik)
1666 } else if (key === 'stroke') {
1667 value = renderer.color(value, element, key);
1668
1669 // emulate VML's dashstyle implementation
1670 } else if (key === 'dashstyle') {
1671 key = 'stroke-dasharray';
1672 value = value && value.toLowerCase();
1673 if (value === 'solid') {
1674 value = NONE;
1675 } else if (value) {
1676 value = value
1677 .replace('shortdashdotdot', '3,1,1,1,1,1,')
1678 .replace('shortdashdot', '3,1,1,1')
1679 .replace('shortdot', '1,1,')
1680 .replace('shortdash', '3,1,')
1681 .replace('longdash', '8,3,')
1682 .replace(/dot/g, '1,3,')
1683 .replace('dash', '4,3,')
1684 .replace(/,$/, '')
1685 .split(','); // ending comma
1686
1687 i = value.length;
1688 while (i--) {
1689 value[i] = pInt(value[i]) * hash['stroke-width'];
1690 }
1691
1692 value = value.join(',');
1693 }
1694
1695 // special
1696 } else if (key === 'isTracker') {
1697 this[key] = value;
1698
1699 // IE9/MooTools combo: MooTools returns objects instead of numbers and IE9 Beta 2
1700 // is unable to cast them. Test again with final IE9.
1701 } else if (key === 'width') {
1702 value = pInt(value);
1703
1704 // Text alignment
1705 } else if (key === 'align') {
1706 key = 'text-anchor';
1707 value = { left: 'start', center: 'middle', right: 'end' }[value];
1708
1709
1710 // Title requires a subnode, #431
1711 } else if (key === 'title') {
1712 var title = doc.createElementNS(SVG_NS, 'title');
1713 title.appendChild(doc.createTextNode(value));
1714 element.appendChild(title);
1715 }
1716
1717
1718
1719 // jQuery animate changes case
1720 if (key === 'strokeWidth') {
1721 key = 'stroke-width';
1722 }
1723
1724 // Chrome/Win < 6 bug (http://code.google.com/p/chromium/issues/detail?id=15461)
1725 if (isWebKit && key === 'stroke-width' && value === 0) {
1726 value = 0.000001;
1727 }
1728
1729 // symbols
1730 if (this.symbolName && /^(x|y|r|start|end|innerR)/.test(key)) {
1731
1732
1733 if (!hasSetSymbolSize) {
1734 this.symbolAttr(hash);
1735 hasSetSymbolSize = true;
1736 }
1737 skipAttr = true;
1738 }
1739
1740 // let the shadow follow the main element
1741 if (shadows && /^(width|height|visibility|x|y|d)$/.test(key)) {
1742 i = shadows.length;
1743 while (i--) {
1744 attr(shadows[i], key, value);
1745 }
1746 }
1747
1748 // validate heights
1749 if ((key === 'width' || key === 'height') && nodeName === 'rect' && value < 0) {
1750 value = 0;
1751 }
1752
1753 if (key === 'text') {
1754 // only one node allowed
1755 this.textStr = value;
1756 if (this.added) {
1757 renderer.buildText(this);
1758 }
1759 } else if (!skipAttr) {
1760 //element.setAttribute(key, value);
1761 attr(element, key, value);
1762 }
1763
1764 // Issue #38
1765 if (htmlNode && (key === 'x' || key === 'y' ||
1766 key === 'translateX' || key === 'translateY' || key === 'visibility')) {
1767 var wrapper = this,
1768 bBox,
1769 arr = htmlNode.length ? htmlNode : [this],
1770 length = arr.length,
1771 itemWrapper,
1772 j;
1773
1774 for (j = 0; j < length; j++) {
1775 itemWrapper = arr[j];
1776 bBox = itemWrapper.getBBox();
1777 htmlNode = itemWrapper.htmlNode; // reassign to child item
1778 css(htmlNode, extend(wrapper.styles, {
1779 left: (bBox.x + (wrapper.translateX || 0)) + PX,
1780 top: (bBox.y + (wrapper.translateY || 0)) + PX
1781 }));
1782
1783 if (key === 'visibility') {
1784 css(htmlNode, {
1785 visibility: value
1786 });
1787 }
1788 }
1789 }
1790
1791 }
1792
1793 }
1794 return ret;
1795 },
1796
1797 /**
1798 * If one of the symbol size affecting parameters are changed,
1799 * check all the others only once for each call to an element's
1800 * .attr() method
1801 * @param {Object} hash
1802 */
1803 symbolAttr: function (hash) {
1804 var wrapper = this;
1805
1806 each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR'], function (key) {
1807 wrapper[key] = pick(hash[key], wrapper[key]);
1808 });
1809
1810 wrapper.attr({
1811 d: wrapper.renderer.symbols[wrapper.symbolName](
1812 mathRound(wrapper.x * 2) / 2, // Round to halves. Issue #274.
1813 mathRound(wrapper.y * 2) / 2,
1814 wrapper.r,
1815 {
1816 start: wrapper.start,
1817 end: wrapper.end,
1818 width: wrapper.width,
1819 height: wrapper.height,
1820 innerR: wrapper.innerR
1821 }
1822 )
1823 });
1824 },
1825
1826 /**
1827 * Apply a clipping path to this object
1828 * @param {String} id
1829 */
1830 clip: function (clipRect) {
1831 return this.attr('clip-path', 'url(' + this.renderer.url + '#' + clipRect.id + ')');
1832 },
1833
1834 /**
1835 * Calculate the coordinates needed for drawing a rectangle crisply and return the
1836 * calculated attributes
1837 * @param {Number} strokeWidth
1838 * @param {Number} x
1839 * @param {Number} y
1840 * @param {Number} width
1841 * @param {Number} height
1842 */
1843 crisp: function (strokeWidth, x, y, width, height) {
1844
1845 var wrapper = this,
1846 key,
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches