]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/cacti/cacti-0.8.8a-legal.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[people/teissler/ipfire-2.x.git] / src / patches / cacti / cacti-0.8.8a-legal.patch
1 diff -up cacti-0.8.8a/include/js/jquery/colorpicker.js.legal cacti-0.8.8a/include/js/jquery/colorpicker.js
2 --- cacti-0.8.8a/include/js/jquery/colorpicker.js.legal 2013-01-04 15:44:38.025416061 -0500
3 +++ cacti-0.8.8a/include/js/jquery/colorpicker.js 2013-01-04 15:43:12.644377988 -0500
4 @@ -0,0 +1,484 @@
5 +/**
6 + *
7 + * Color picker
8 + * Author: Stefan Petre www.eyecon.ro
9 + *
10 + * Dual licensed under the MIT and GPL licenses
11 + *
12 + */
13 +(function ($) {
14 + var ColorPicker = function () {
15 + var
16 + ids = {},
17 + inAction,
18 + charMin = 65,
19 + visible,
20 + tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
21 + defaults = {
22 + eventName: 'click',
23 + onShow: function () {},
24 + onBeforeShow: function(){},
25 + onHide: function () {},
26 + onChange: function () {},
27 + onSubmit: function () {},
28 + color: 'ff0000',
29 + livePreview: true,
30 + flat: false
31 + },
32 + fillRGBFields = function (hsb, cal) {
33 + var rgb = HSBToRGB(hsb);
34 + $(cal).data('colorpicker').fields
35 + .eq(1).val(rgb.r).end()
36 + .eq(2).val(rgb.g).end()
37 + .eq(3).val(rgb.b).end();
38 + },
39 + fillHSBFields = function (hsb, cal) {
40 + $(cal).data('colorpicker').fields
41 + .eq(4).val(hsb.h).end()
42 + .eq(5).val(hsb.s).end()
43 + .eq(6).val(hsb.b).end();
44 + },
45 + fillHexFields = function (hsb, cal) {
46 + $(cal).data('colorpicker').fields
47 + .eq(0).val(HSBToHex(hsb)).end();
48 + },
49 + setSelector = function (hsb, cal) {
50 + $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
51 + $(cal).data('colorpicker').selectorIndic.css({
52 + left: parseInt(150 * hsb.s/100, 10),
53 + top: parseInt(150 * (100-hsb.b)/100, 10)
54 + });
55 + },
56 + setHue = function (hsb, cal) {
57 + $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
58 + },
59 + setCurrentColor = function (hsb, cal) {
60 + $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
61 + },
62 + setNewColor = function (hsb, cal) {
63 + $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
64 + },
65 + keyDown = function (ev) {
66 + var pressedKey = ev.charCode || ev.keyCode || -1;
67 + if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
68 + return false;
69 + }
70 + var cal = $(this).parent().parent();
71 + if (cal.data('colorpicker').livePreview === true) {
72 + change.apply(this);
73 + }
74 + },
75 + change = function (ev) {
76 + var cal = $(this).parent().parent(), col;
77 + if (this.parentNode.className.indexOf('_hex') > 0) {
78 + cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
79 + } else if (this.parentNode.className.indexOf('_hsb') > 0) {
80 + cal.data('colorpicker').color = col = fixHSB({
81 + h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
82 + s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
83 + b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
84 + });
85 + } else {
86 + cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
87 + r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
88 + g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
89 + b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
90 + }));
91 + }
92 + if (ev) {
93 + fillRGBFields(col, cal.get(0));
94 + fillHexFields(col, cal.get(0));
95 + fillHSBFields(col, cal.get(0));
96 + }
97 + setSelector(col, cal.get(0));
98 + setHue(col, cal.get(0));
99 + setNewColor(col, cal.get(0));
100 + cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
101 + },
102 + blur = function (ev) {
103 + var cal = $(this).parent().parent();
104 + cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105 + },
106 + focus = function () {
107 + charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
108 + $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
109 + $(this).parent().addClass('colorpicker_focus');
110 + },
111 + downIncrement = function (ev) {
112 + var field = $(this).parent().find('input').focus();
113 + var current = {
114 + el: $(this).parent().addClass('colorpicker_slider'),
115 + max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
116 + y: ev.pageY,
117 + field: field,
118 + val: parseInt(field.val(), 10),
119 + preview: $(this).parent().parent().data('colorpicker').livePreview
120 + };
121 + $(document).bind('mouseup', current, upIncrement);
122 + $(document).bind('mousemove', current, moveIncrement);
123 + },
124 + moveIncrement = function (ev) {
125 + ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
126 + if (ev.data.preview) {
127 + change.apply(ev.data.field.get(0), [true]);
128 + }
129 + return false;
130 + },
131 + upIncrement = function (ev) {
132 + change.apply(ev.data.field.get(0), [true]);
133 + ev.data.el.removeClass('colorpicker_slider').find('input').focus();
134 + $(document).unbind('mouseup', upIncrement);
135 + $(document).unbind('mousemove', moveIncrement);
136 + return false;
137 + },
138 + downHue = function (ev) {
139 + var current = {
140 + cal: $(this).parent(),
141 + y: $(this).offset().top
142 + };
143 + current.preview = current.cal.data('colorpicker').livePreview;
144 + $(document).bind('mouseup', current, upHue);
145 + $(document).bind('mousemove', current, moveHue);
146 + },
147 + moveHue = function (ev) {
148 + change.apply(
149 + ev.data.cal.data('colorpicker')
150 + .fields
151 + .eq(4)
152 + .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
153 + .get(0),
154 + [ev.data.preview]
155 + );
156 + return false;
157 + },
158 + upHue = function (ev) {
159 + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
160 + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
161 + $(document).unbind('mouseup', upHue);
162 + $(document).unbind('mousemove', moveHue);
163 + return false;
164 + },
165 + downSelector = function (ev) {
166 + var current = {
167 + cal: $(this).parent(),
168 + pos: $(this).offset()
169 + };
170 + current.preview = current.cal.data('colorpicker').livePreview;
171 + $(document).bind('mouseup', current, upSelector);
172 + $(document).bind('mousemove', current, moveSelector);
173 + },
174 + moveSelector = function (ev) {
175 + change.apply(
176 + ev.data.cal.data('colorpicker')
177 + .fields
178 + .eq(6)
179 + .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
180 + .end()
181 + .eq(5)
182 + .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
183 + .get(0),
184 + [ev.data.preview]
185 + );
186 + return false;
187 + },
188 + upSelector = function (ev) {
189 + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
190 + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
191 + $(document).unbind('mouseup', upSelector);
192 + $(document).unbind('mousemove', moveSelector);
193 + return false;
194 + },
195 + enterSubmit = function (ev) {
196 + $(this).addClass('colorpicker_focus');
197 + },
198 + leaveSubmit = function (ev) {
199 + $(this).removeClass('colorpicker_focus');
200 + },
201 + clickSubmit = function (ev) {
202 + var cal = $(this).parent();
203 + var col = cal.data('colorpicker').color;
204 + cal.data('colorpicker').origColor = col;
205 + setCurrentColor(col, cal.get(0));
206 + cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
207 + },
208 + show = function (ev) {
209 + var cal = $('#' + $(this).data('colorpickerId'));
210 + cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
211 + var pos = $(this).offset();
212 + var viewPort = getViewport();
213 + var top = pos.top + this.offsetHeight;
214 + var left = pos.left;
215 + if (top + 176 > viewPort.t + viewPort.h) {
216 + top -= this.offsetHeight + 176;
217 + }
218 + if (left + 356 > viewPort.l + viewPort.w) {
219 + left -= 356;
220 + }
221 + cal.css({left: left + 'px', top: top + 'px'});
222 + if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
223 + cal.show();
224 + }
225 + $(document).bind('mousedown', {cal: cal}, hide);
226 + return false;
227 + },
228 + hide = function (ev) {
229 + if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
230 + if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
231 + ev.data.cal.hide();
232 + }
233 + $(document).unbind('mousedown', hide);
234 + }
235 + },
236 + isChildOf = function(parentEl, el, container) {
237 + if (parentEl == el) {
238 + return true;
239 + }
240 + if (parentEl.contains) {
241 + return parentEl.contains(el);
242 + }
243 + if ( parentEl.compareDocumentPosition ) {
244 + return !!(parentEl.compareDocumentPosition(el) & 16);
245 + }
246 + var prEl = el.parentNode;
247 + while(prEl && prEl != container) {
248 + if (prEl == parentEl)
249 + return true;
250 + prEl = prEl.parentNode;
251 + }
252 + return false;
253 + },
254 + getViewport = function () {
255 + var m = document.compatMode == 'CSS1Compat';
256 + return {
257 + l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
258 + t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
259 + w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
260 + h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
261 + };
262 + },
263 + fixHSB = function (hsb) {
264 + return {
265 + h: Math.min(360, Math.max(0, hsb.h)),
266 + s: Math.min(100, Math.max(0, hsb.s)),
267 + b: Math.min(100, Math.max(0, hsb.b))
268 + };
269 + },
270 + fixRGB = function (rgb) {
271 + return {
272 + r: Math.min(255, Math.max(0, rgb.r)),
273 + g: Math.min(255, Math.max(0, rgb.g)),
274 + b: Math.min(255, Math.max(0, rgb.b))
275 + };
276 + },
277 + fixHex = function (hex) {
278 + var len = 6 - hex.length;
279 + if (len > 0) {
280 + var o = [];
281 + for (var i=0; i<len; i++) {
282 + o.push('0');
283 + }
284 + o.push(hex);
285 + hex = o.join('');
286 + }
287 + return hex;
288 + },
289 + HexToRGB = function (hex) {
290 + var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
291 + return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
292 + },
293 + HexToHSB = function (hex) {
294 + return RGBToHSB(HexToRGB(hex));
295 + },
296 + RGBToHSB = function (rgb) {
297 + var hsb = {
298 + h: 0,
299 + s: 0,
300 + b: 0
301 + };
302 + var min = Math.min(rgb.r, rgb.g, rgb.b);
303 + var max = Math.max(rgb.r, rgb.g, rgb.b);
304 + var delta = max - min;
305 + hsb.b = max;
306 + if (max != 0) {
307 +
308 + }
309 + hsb.s = max != 0 ? 255 * delta / max : 0;
310 + if (hsb.s != 0) {
311 + if (rgb.r == max) {
312 + hsb.h = (rgb.g - rgb.b) / delta;
313 + } else if (rgb.g == max) {
314 + hsb.h = 2 + (rgb.b - rgb.r) / delta;
315 + } else {
316 + hsb.h = 4 + (rgb.r - rgb.g) / delta;
317 + }
318 + } else {
319 + hsb.h = -1;
320 + }
321 + hsb.h *= 60;
322 + if (hsb.h < 0) {
323 + hsb.h += 360;
324 + }
325 + hsb.s *= 100/255;
326 + hsb.b *= 100/255;
327 + return hsb;
328 + },
329 + HSBToRGB = function (hsb) {
330 + var rgb = {};
331 + var h = Math.round(hsb.h);
332 + var s = Math.round(hsb.s*255/100);
333 + var v = Math.round(hsb.b*255/100);
334 + if(s == 0) {
335 + rgb.r = rgb.g = rgb.b = v;
336 + } else {
337 + var t1 = v;
338 + var t2 = (255-s)*v/255;
339 + var t3 = (t1-t2)*(h%60)/60;
340 + if(h==360) h = 0;
341 + if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
342 + else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
343 + else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
344 + else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
345 + else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
346 + else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
347 + else {rgb.r=0; rgb.g=0; rgb.b=0}
348 + }
349 + return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
350 + },
351 + RGBToHex = function (rgb) {
352 + var hex = [
353 + rgb.r.toString(16),
354 + rgb.g.toString(16),
355 + rgb.b.toString(16)
356 + ];
357 + $.each(hex, function (nr, val) {
358 + if (val.length == 1) {
359 + hex[nr] = '0' + val;
360 + }
361 + });
362 + return hex.join('');
363 + },
364 + HSBToHex = function (hsb) {
365 + return RGBToHex(HSBToRGB(hsb));
366 + },
367 + restoreOriginal = function () {
368 + var cal = $(this).parent();
369 + var col = cal.data('colorpicker').origColor;
370 + cal.data('colorpicker').color = col;
371 + fillRGBFields(col, cal.get(0));
372 + fillHexFields(col, cal.get(0));
373 + fillHSBFields(col, cal.get(0));
374 + setSelector(col, cal.get(0));
375 + setHue(col, cal.get(0));
376 + setNewColor(col, cal.get(0));
377 + };
378 + return {
379 + init: function (opt) {
380 + opt = $.extend({}, defaults, opt||{});
381 + if (typeof opt.color == 'string') {
382 + opt.color = HexToHSB(opt.color);
383 + } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
384 + opt.color = RGBToHSB(opt.color);
385 + } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
386 + opt.color = fixHSB(opt.color);
387 + } else {
388 + return this;
389 + }
390 + return this.each(function () {
391 + if (!$(this).data('colorpickerId')) {
392 + var options = $.extend({}, opt);
393 + options.origColor = opt.color;
394 + var id = 'collorpicker_' + parseInt(Math.random() * 1000);
395 + $(this).data('colorpickerId', id);
396 + var cal = $(tpl).attr('id', id);
397 + if (options.flat) {
398 + cal.appendTo(this).show();
399 + } else {
400 + cal.appendTo(document.body);
401 + }
402 + options.fields = cal
403 + .find('input')
404 + .bind('keyup', keyDown)
405 + .bind('change', change)
406 + .bind('blur', blur)
407 + .bind('focus', focus);
408 + cal
409 + .find('span').bind('mousedown', downIncrement).end()
410 + .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
411 + options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
412 + options.selectorIndic = options.selector.find('div div');
413 + options.el = this;
414 + options.hue = cal.find('div.colorpicker_hue div');
415 + cal.find('div.colorpicker_hue').bind('mousedown', downHue);
416 + options.newColor = cal.find('div.colorpicker_new_color');
417 + options.currentColor = cal.find('div.colorpicker_current_color');
418 + cal.data('colorpicker', options);
419 + cal.find('div.colorpicker_submit')
420 + .bind('mouseenter', enterSubmit)
421 + .bind('mouseleave', leaveSubmit)
422 + .bind('click', clickSubmit);
423 + fillRGBFields(options.color, cal.get(0));
424 + fillHSBFields(options.color, cal.get(0));
425 + fillHexFields(options.color, cal.get(0));
426 + setHue(options.color, cal.get(0));
427 + setSelector(options.color, cal.get(0));
428 + setCurrentColor(options.color, cal.get(0));
429 + setNewColor(options.color, cal.get(0));
430 + if (options.flat) {
431 + cal.css({
432 + position: 'relative',
433 + display: 'block'
434 + });
435 + } else {
436 + $(this).bind(options.eventName, show);
437 + }
438 + }
439 + });
440 + },
441 + showPicker: function() {
442 + return this.each( function () {
443 + if ($(this).data('colorpickerId')) {
444 + show.apply(this);
445 + }
446 + });
447 + },
448 + hidePicker: function() {
449 + return this.each( function () {
450 + if ($(this).data('colorpickerId')) {
451 + $('#' + $(this).data('colorpickerId')).hide();
452 + }
453 + });
454 + },
455 + setColor: function(col) {
456 + if (typeof col == 'string') {
457 + col = HexToHSB(col);
458 + } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
459 + col = RGBToHSB(col);
460 + } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
461 + col = fixHSB(col);
462 + } else {
463 + return this;
464 + }
465 + return this.each(function(){
466 + if ($(this).data('colorpickerId')) {
467 + var cal = $('#' + $(this).data('colorpickerId'));
468 + cal.data('colorpicker').color = col;
469 + cal.data('colorpicker').origColor = col;
470 + fillRGBFields(col, cal.get(0));
471 + fillHSBFields(col, cal.get(0));
472 + fillHexFields(col, cal.get(0));
473 + setHue(col, cal.get(0));
474 + setSelector(col, cal.get(0));
475 + setCurrentColor(col, cal.get(0));
476 + setNewColor(col, cal.get(0));
477 + }
478 + });
479 + }
480 + };
481 + }();
482 + $.fn.extend({
483 + ColorPicker: ColorPicker.init,
484 + ColorPickerHide: ColorPicker.hidePicker,
485 + ColorPickerShow: ColorPicker.showPicker,
486 + ColorPickerSetColor: ColorPicker.setColor
487 + });
488 +})(jQuery)
489 \ No newline at end of file
490 diff -up cacti-0.8.8a/include/js/jquery/jquery.cookie.js.legal cacti-0.8.8a/include/js/jquery/jquery.cookie.js
491 --- cacti-0.8.8a/include/js/jquery/jquery.cookie.js.legal 2013-01-04 15:44:38.027416060 -0500
492 +++ cacti-0.8.8a/include/js/jquery/jquery.cookie.js 2013-01-04 15:43:12.644377988 -0500
493 @@ -0,0 +1,91 @@
494 +/*jslint browser: true */ /*global jQuery: true */
495 +
496 +/**
497 + * jQuery Cookie plugin
498 + *
499 + * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
500 + * Dual licensed under the MIT and GPL licenses:
501 + * http://www.opensource.org/licenses/mit-license.php
502 + * http://www.gnu.org/licenses/gpl.html
503 + *
504 + */
505 +
506 +// TODO JsDoc
507 +
508 +/**
509 + * Create a cookie with the given key and value and other optional parameters.
510 + *
511 + * @example $.cookie('the_cookie', 'the_value');
512 + * @desc Set the value of a cookie.
513 + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
514 + * @desc Create a cookie with all available options.
515 + * @example $.cookie('the_cookie', 'the_value');
516 + * @desc Create a session cookie.
517 + * @example $.cookie('the_cookie', null);
518 + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
519 + * used when the cookie was set.
520 + *
521 + * @param String key The key of the cookie.
522 + * @param String value The value of the cookie.
523 + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
524 + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
525 + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
526 + * If set to null or omitted, the cookie will be a session cookie and will not be retained
527 + * when the the browser exits.
528 + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
529 + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
530 + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
531 + * require a secure protocol (like HTTPS).
532 + * @type undefined
533 + *
534 + * @name $.cookie
535 + * @cat Plugins/Cookie
536 + * @author Klaus Hartl/klaus.hartl@stilbuero.de
537 + */
538 +
539 +/**
540 + * Get the value of a cookie with the given key.
541 + *
542 + * @example $.cookie('the_cookie');
543 + * @desc Get the value of a cookie.
544 + *
545 + * @param String key The key of the cookie.
546 + * @return The value of the cookie.
547 + * @type String
548 + *
549 + * @name $.cookie
550 + * @cat Plugins/Cookie
551 + * @author Klaus Hartl/klaus.hartl@stilbuero.de
552 + */
553 +jQuery.cookie = function (key, value, options) {
554 +
555 + // key and at least value given, set cookie...
556 + if (arguments.length > 1 && String(value) !== "[object Object]") {
557 + options = jQuery.extend({}, options);
558 +
559 + if (value === null || value === undefined) {
560 + options.expires = -1;
561 + }
562 +
563 + if (typeof options.expires === 'number') {
564 + var days = options.expires, t = options.expires = new Date();
565 + t.setDate(t.getDate() + days);
566 + }
567 +
568 + value = String(value);
569 +
570 + return (document.cookie = [
571 + encodeURIComponent(key), '=',
572 + options.raw ? value : encodeURIComponent(value),
573 + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
574 + options.path ? '; path=' + options.path : '',
575 + options.domain ? '; domain=' + options.domain : '',
576 + options.secure ? '; secure' : ''
577 + ].join(''));
578 + }
579 +
580 + // key and possibly options given, get cookie...
581 + options = value || {};
582 + var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
583 + return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
584 +};
585 diff -up cacti-0.8.8a/include/js/jquery/jquery.dd.js.legal cacti-0.8.8a/include/js/jquery/jquery.dd.js
586 --- cacti-0.8.8a/include/js/jquery/jquery.dd.js.legal 2013-01-04 15:44:38.030416069 -0500
587 +++ cacti-0.8.8a/include/js/jquery/jquery.dd.js 2013-01-04 15:43:12.644377988 -0500
588 @@ -0,0 +1,11 @@
589 +// MSDropDown - jquery.dd.js
590 +// author: Marghoob Suleman - Search me on google
591 +// Date: 12th Aug, 2009, {18 Dec, 2010 (2.36)}
592 +// Version: 2.37.5 {date: 17 June, 2011}
593 +// Revision: 34
594 +// web: www.giftlelo.com | www.marghoobsuleman.com
595 +/*
596 +// msDropDown is free jQuery Plugin: you can redistribute it and/or modify
597 +// it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2
598 +*/
599 +;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(5($){3 1L="";3 3m=5(p,q){3 r=p;3 s=1a;3 q=$.3n({1d:4c,2q:7,3o:23,1U:6,1M:4d,3p:\'28\',1N:15,3q:\'4e\',2I:\'\',1j:\'\'},q);1a.1V=2r 3r();3 u="";3 v={};v.2J=6;v.2s=15;v.2t=1o;3 x=15;3 y={2K:\'4f\',1O:\'4g\',1H:\'4h\',29:\'4i\',1h:\'4j\',2L:\'4k\',2M:\'4l\',4m:\'4n\',2u:\'4o\',3s:\'4p\'};3 z={28:q.3p,2N:\'2N\',2O:\'2O\',2P:\'2P\',1t:\'1t\',1k:.30,2a:\'2a\',2v:\'2v\',2w:\'2w\',11:\'11\'};3 A={3t:"2x,2Q,2R,1P,2y,2z,1u,1B,2A,1Q,4q,1W,2S",18:"1C,1v,1k,4r"};1a.1R=2r 3r();3 B=$(r).18("1b");4(1w(B)=="14"||B.1c<=0){B="4s"+$.1S.3u++;$(r).2B("1b",B)};3 C=$(r).18("1j");q.1j+=(C==14)?"":C;3 D=$(r).3v();x=($(r).18("1C")>1||$(r).18("1v")==6)?6:15;4(x){q.2q=$(r).18("1C")};3 E={};3 F=0;3 G=15;3 H;3 I={};3 J=5(a){4(1w(I[a])=="14"){I[a]=1p.4t(a)}12 I[a]};3 K=5(a){12 B+y[a]};3 L=5(a){3 b=a;3 c=$(b).18("1j");12 c};3 M=5(a){3 b=$("#"+B+" 2T:11");4(b.1c>1){1D(3 i=0;i<b.1c;i++){4(a==b[i].1i){12 6}}}19 4(b.1c==1){4(b[0].1i==a){12 6}};12 15};3 N=5(a,b,c,d){3 e="";3 f=(d=="2U")?K("2M"):K("2L");3 g=(d=="2U")?f+"2V"+(b)+"2V"+(c):f+"2V"+(b);3 h="";3 i="";4(q.1N!=15){i=\' \'+q.1N+\' \'+a.3w}19{h=$(a).18("1X");h=(h.1c==0)?"":\'<3x 3y="\'+h+\'" 3z="3A" /> \'};3 j=$(a).1q();3 k=$(a).4u();3 l=($(a).18("1k")==6)?"1k":"2W";E[g]={1I:h+j,2b:k,1q:j,1i:a.1i,1b:g};3 m=L(a);4(M(a.1i)==6){e+=\'<a 3B="3C:3D(0);" 1r="\'+z.11+\' \'+l+i+\'"\'}19{e+=\'<a 3B="3C:3D(0);" 1r="\'+l+i+\'"\'};4(m!==15&&m!==14){e+=" 1j=\'"+m+"\'"};e+=\' 1b="\'+g+\'">\';e+=h+\'<1x 1r="\'+z.1t+\'">\'+j+\'</1x></a>\';12 e};3 O=5(t){3 b=t.3E();4(b.1c==0)12-1;3 a="";1D(3 i 2c E){3 c=E[i].1q.3E();4(c.3F(0,b.1c)==b){a+="#"+E[i].1b+", "}};12(a=="")?-1:a};3 P=5(){3 f=D;4(f.1c==0)12"";3 g="";3 h=K("2L");3 i=K("2M");f.2X(5(c){3 d=f[c];4(d.4v=="4w"){g+="<1y 1r=\'4x\'>";g+="<1x 1j=\'3G-4y:4z;3G-1j:4A; 4B:4C;\'>"+$(d).18("4D")+"</1x>";3 e=$(d).3v();e.2X(5(a){3 b=e[a];g+=N(b,c,a,"2U")});g+="</1y>"}19{g+=N(d,c,"","")}});12 g};3 Q=5(){3 a=K("1O");3 b=K("1h");3 c=q.1j;1Y="";1Y+=\'<1y 1b="\'+b+\'" 1r="\'+z.2P+\'"\';4(!x){1Y+=(c!="")?\' 1j="\'+c+\'"\':\'\'}19{1Y+=(c!="")?\' 1j="2C-1m:4E 4F #4G;1s:2d;1n:2Y;\'+c+\'"\':\'\'};1Y+=\'>\';12 1Y};3 R=5(){3 a=K("1H");3 b=K("2u");3 c=K("29");3 d=K("3s");3 e="";3 f="";4(J(B).1E.1c>0){e=$("#"+B+" 2T:11").1q();f=$("#"+B+" 2T:11").18("1X")};f=(f.1c==0||f==14||q.1U==15||q.1N!=15)?"":\'<3x 3y="\'+f+\'" 3z="3A" /> \';3 g=\'<1y 1b="\'+a+\'" 1r="\'+z.2N+\'"\';g+=\'>\';g+=\'<1x 1b="\'+b+\'" 1r="\'+z.2O+\'"></1x><1x 1r="\'+z.1t+\'" 1b="\'+c+\'">\'+f+\'<1x 1r="\'+z.1t+\'">\'+e+\'</1x></1x></1y>\';12 g};3 S=5(){3 c=K("1h");$("#"+c+" a.2W").1J("1P");$("#"+c+" a.2W").1e("1P",5(a){a.1Z();V(1a);21();4(!x){$("#"+c).1J("1B");X(15);3 b=(q.1U==15)?$(1a).1q():$(1a).1I();1T(b);s.2e()}})};3 T=5(){3 d=15;3 e=K("1O");3 f=K("1H");3 g=K("29");3 h=K("1h");3 i=K("2u");3 j=$("#"+B).2Z();j=j+2;3 k=q.1j;4($("#"+e).1c>0){$("#"+e).2D();d=6};3 l=\'<1y 1b="\'+e+\'" 1r="\'+z.28+\'"\';l+=(k!="")?\' 1j="\'+k+\'"\':\'\';l+=\'>\';l+=R();l+=Q();l+=P();l+="</1y>";l+="</1y>";4(d==6){3 m=K("2K");$("#"+m).31(l)}19{$("#"+B).31(l)};4(x){3 f=K("1H");$("#"+f).2f()};$("#"+e).9("2Z",j+"1z");$("#"+h).9("2Z",(j-2)+"1z");4(D.1c>q.2q){3 n=2g($("#"+h+" a:3H").9("2h-3I"))+2g($("#"+h+" a:3H").9("2h-1m"));3 o=((q.3o)*q.2q)-n;$("#"+h).9("1d",o+"1z")}19 4(x){3 o=$("#"+B).1d();$("#"+h).9("1d",o+"1z")};4(d==15){3J();W(B)};4($("#"+B).18("1k")==6){$("#"+e).9("2E",z.1k)};Z();$("#"+f).1e("1B",5(a){32(1)});$("#"+f).1e("1Q",5(a){32(0)});S();$("#"+h+" a.1k").9("2E",z.1k);4(x){$("#"+h).1e("1B",5(c){4(!v.2s){v.2s=6;$(1p).1e("1W",5(a){3 b=a.3K;v.2t=b;4(b==39||b==40){a.1Z();a.2i();33();21()};4(b==37||b==38){a.1Z();a.2i();34();21()}})}})};$("#"+h).1e("1Q",5(a){X(15);$(1p).1J("1W");v.2s=15;v.2t=1o});$("#"+f).1e("1P",5(b){X(15);4($("#"+h+":2j").1c==1){$("#"+h).1J("1B")}19{$("#"+h).1e("1B",5(a){X(6)});s.3L()}});$("#"+f).1e("1Q",5(a){X(15)});4(q.1U&&q.1N!=15){2k()}};3 U=5(a){1D(3 i 2c E){4(E[i].1i==a){12 E[i]}};12-1};3 V=5(a){3 b=K("1h");4($("#"+b+" a."+z.11).1c==1){u=$("#"+b+" a."+z.11).1q()};4(!x){$("#"+b+" a."+z.11).1K(z.11)};3 c=$("#"+b+" a."+z.11).18("1b");4(c!=14){3 d=(v.22==14||v.22==1o)?E[c].1i:v.22};4(a&&!x){$(a).1F(z.11)};4(x){3 e=v.2t;4($("#"+B).18("1v")==6){4(e==17){v.22=E[$(a).18("1b")].1i;$(a).4H(z.11)}19 4(e==16){$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);3 f=$(a).18("1b");3 g=E[f].1i;1D(3 i=35.4I(d,g);i<=35.4J(d,g);i++){$("#"+U(i).1b).1F(z.11)}}19{$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);v.22=E[$(a).18("1b")].1i}}19{$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);v.22=E[$(a).18("1b")].1i}}};3 W=5(a){3 b=a;J(b).4K=5(e){$("#"+b).1S(q)}};3 X=5(a){v.2J=a};3 Y=5(){12 v.2J};3 Z=5(){3 b=K("1O");3 c=A.3t.4L(",");1D(3 d=0;d<c.1c;d++){3 e=c[d];3 f=24(e);4(f==6){2F(e){1f"2x":$("#"+b).1e("4M",5(a){J(B).2x()});1g;1f"1P":$("#"+b).1e("1P",5(a){$("#"+B).1G("1P")});1g;1f"2y":$("#"+b).1e("2y",5(a){$("#"+B).1G("2y")});1g;1f"2z":$("#"+b).1e("2z",5(a){$("#"+B).1G("2z")});1g;1f"1u":$("#"+b).1e("1u",5(a){$("#"+B).1G("1u")});1g;1f"1B":$("#"+b).1e("1B",5(a){$("#"+B).1G("1B")});1g;1f"2A":$("#"+b).1e("2A",5(a){$("#"+B).1G("2A")});1g;1f"1Q":$("#"+b).1e("1Q",5(a){$("#"+B).1G("1Q")});1g}}}};3 3J=5(){3 a=K("2K");$("#"+B).31("<1y 1r=\'"+z.2a+"\' 1j=\'1d:3M;3N:3O;1n:36;\' 1b=\'"+a+"\'></1y>");$("#"+B).4N($("#"+a))};3 1T=5(a){3 b=K("29");$("#"+b).1I(a)};3 3a=5(w){3 a=w;3 b=K("1h");3 c=$("#"+b+" a:2j");3 d=c.1c;3 e=$("#"+b+" a:2j").1i($("#"+b+" a.11:2j"));3 f;2F(a){1f"3b":4(e<d-1){e++;f=c[e]};1g;1f"3P":4(e<d&&e>0){e--;f=c[e]};1g};4(1w(f)=="14"){12 15};$("#"+b+" a."+z.11).1K(z.11);$(f).1F(z.11);3 g=f.1b;4(!x){3 h=(q.1U==15)?E[g].1q:$("#"+g).1I();1T(h);2k(E[g].1i)};4(a=="3b"){4(2g(($("#"+g).1n().1m+$("#"+g).1d()))>=2g($("#"+b).1d())){$("#"+b).2l(($("#"+b).2l())+$("#"+g).1d()+$("#"+g).1d())}}19{4(2g(($("#"+g).1n().1m+$("#"+g).1d()))<=0){$("#"+b).2l(($("#"+b).2l()-$("#"+b).1d())-$("#"+g).1d())}}};3 33=5(){3a("3b")};3 34=5(){3a("3P")};3 2k=5(i){4(q.1N!=15){3 a=K("29");3 b=(1w(i)=="14")?J(B).1l:i;3 c=J(B).1E[b].3w;4(c.1c>0){3 d=K("1h");3 e=$("#"+d+" a."+c).18("1b");3 f=$("#"+e).9("2m-4O");3 g=$("#"+e).9("2m-1n");3 h=$("#"+e).9("2h-3Q");4(f!=14){$("#"+a).2n("."+z.1t).2B(\'1j\',"2m:"+f)};4(g!=14){$("#"+a).2n("."+z.1t).9(\'2m-1n\',g)};4(h!=14){$("#"+a).2n("."+z.1t).9(\'2h-3Q\',h)};$("#"+a).2n("."+z.1t).9(\'2m-3R\',\'4P-3R\');$("#"+a).2n("."+z.1t).9(\'2h-3I\',\'4Q\')}}};3 21=5(){3 a=K("1h");3 b=$("#"+a+" a."+z.11);4(b.1c==1){3 c=$("#"+a+" a."+z.11).1q();3 d=$("#"+a+" a."+z.11).18("1b");4(d!=14){3 e=E[d].2b;J(B).1l=E[d].1i};4(q.1U&&q.1N!=15)2k()}19 4(b.1c>1){1D(3 i=0;i<b.1c;i++){3 d=$(b[i]).18("1b");3 f=E[d].1i;J(B).1E[f].11="11"}};3 g=J(B).1l;s.1V["1l"]=g};3 24=5(a){4($("#"+B).18("4R"+a)!=14){12 6};3 b=$("#"+B).3c("4S");4(b&&b[a]){12 6};12 15};3 3S=5(){3 b=K("1h");4(24(\'2R\')==6){3 c=E[$("#"+b+" a.11").18("1b")].1q;4($.3T(u)!==$.3T(c)&&u!==""){$("#"+B).1G("2R")}};4(24(\'1u\')==6){$("#"+B).1G("1u")};4(24(\'2Q\')==6){$(1p).1e("1u",5(a){$("#"+B).2x();$("#"+B)[0].2Q();21();$(1p).1J("1u")})}};3 32=5(a){3 b=K("2u");4(a==1)$("#"+b).9({3U:\'0 4T%\'});19 $("#"+b).9({3U:\'0 0\'})};3 3V=5(){1D(3 i 2c J(B)){4(1w(J(B)[i])!=\'5\'&&J(B)[i]!==14&&J(B)[i]!==1o){s.1A(i,J(B)[i],6)}}};3 3W=5(a,b){4(U(b)!=-1){J(B)[a]=b;3 c=K("1h");$("#"+c+" a."+z.11).1K(z.11);$("#"+U(b).1b).1F(z.11);3 d=U(J(B).1l).1I;1T(d)}};3 3X=5(i,a){4(a==\'d\'){1D(3 b 2c E){4(E[b].1i==i){4U E[b];1g}}};3 c=0;1D(3 b 2c E){E[b].1i=c;c++}};3 2G=5(){3 a=K("1h");3 b=K("1O");3 c=$("#"+b).1n();3 d=$("#"+b).1d();3 e=$(3Y).1d();3 f=$(3Y).2l();3 g=$("#"+a).1d();3 h={1M:q.1M,1m:(c.1m+d)+"1z",1s:"2o"};3 i=q.3q;3 j=15;3 k=z.2w;$("#"+a).1K(z.2w);$("#"+a).1K(z.2v);4((e+f)<35.4V(g+d+c.1m)){3 l=c.1m-g;4((c.1m-g)<0){l=10};h={1M:q.1M,1m:l+"1z",1s:"2o"};i="25";j=6;k=z.2v};12{3d:j,3Z:i,9:h,2C:k}};3 3e=5(){4(s.1R["41"]!=1o){2H(s.1R["41"])(s)}};3 3f=5(){3S();4(s.1R["42"]!=1o){2H(s.1R["42"])(s)}};1a.3L=5(){4((s.26("1k",6)==6)||(s.26("1E",6).1c==0))12;3 e=K("1h");4(1L!=""&&e!=1L){$("#"+1L).43("3g");$("#"+1L).9({1M:\'0\'})};4($("#"+e).9("1s")=="2o"){u=E[$("#"+e+" a.11").18("1b")].1q;3 f="";H=$("#"+e).1d();$("#"+e+" a").25();$(1p).1e("1W",5(a){3 b=a.3K;4(b==8){a.1Z();a.2i();f=(f.1c==0)?"":f.3F(0,f.1c-1)};2F(b){1f 39:1f 40:a.1Z();a.2i();33();1g;1f 37:1f 38:a.1Z();a.2i();34();1g;1f 27:1f 13:s.2e();21();1g;44:4(b>46){f+=4W.4X(b)};3 c=O(f);4(c!=-1){$("#"+e).9({1d:\'4Y\'});$("#"+e+" a").2f();$(c).25();3 d=2G();$("#"+e).9(d.9);$("#"+e).9({1s:\'2d\'})}19{$("#"+e+" a").25();$("#"+e).9({1d:H+\'1z\'})};1g};4(24("1W")==6){J(B).4Z()}});$(1p).1e("2S",5(a){4($("#"+B).18("45")!=14){J(B).45()}});$(1p).1e("1u",5(a){4(Y()==15){s.2e()}});3 g=2G();$("#"+e).9(g.9);4(g.3d==6){$("#"+e).9({1s:\'2d\'});$("#"+e).1F(g.2C);3e()}19{$("#"+e)[g.3Z]("3g",5(){$("#"+e).1F(g.2C);3e()})};4(e!=1L){1L=e}}};1a.2e=5(){3 b=K("1h");3 c=$("#"+K("1H")).1n().1m;3 d=2G();G=15;4(d.3d==6){$("#"+b).50({1d:0,1m:c},5(){$("#"+b).9({1d:H+\'1z\',1s:\'2o\'});3f()})}19{$("#"+b).43("3g",5(a){3f();$("#"+b).9({1M:\'0\'});$("#"+b).9({1d:H+\'1z\'})})};2k();$(1p).1J("1W");$(1p).1J("2S");$(1p).1J("1u")};1a.1l=5(i){4(1w(i)=="14"){12 s.26("1l")}19{s.1A("1l",i)}};1a.51=5(a){4(1w(a)=="14"||a==6){$("."+z.2a).52("1j")}19{$("."+z.2a).2B("1j","1d:3M;3N:3O;1n:36")}};1a.1A=5(a,b,c){4(a==14||b==14)47{48:"1A 53 54?"};s.1V[a]=b;4(c!=6){2F(a){1f"1l":3W(a,b);1g;1f"1k":s.1k(b,6);1g;1f"1v":J(B)[a]=b;x=($(r).18("1C")>0||$(r).18("1v")==6)?6:15;4(x){3 d=$("#"+B).1d();3 f=K("1h");$("#"+f).9("1d",d+"1z");3 g=K("1H");$("#"+g).2f();3 f=K("1h");$("#"+f).9({1s:\'2d\',1n:\'2Y\'});S()};1g;1f"1C":J(B)[a]=b;4(b==0){J(B).1v=15};x=($(r).18("1C")>0||$(r).18("1v")==6)?6:15;4(b==0){3 g=K("1H");$("#"+g).25();3 f=K("1h");$("#"+f).9({1s:\'2o\',1n:\'36\'});3 h="";4(J(B).1l>=0){3 i=U(J(B).1l);h=i.1I;V($("#"+i.1b))};1T(h)}19{3 g=K("1H");$("#"+g).2f();3 f=K("1h");$("#"+f).9({1s:\'2d\',1n:\'2Y\'})};1g;44:55{J(B)[a]=b}56(e){};1g}}};1a.26=5(a,b){4(a==14&&b==14){12 s.1V};4(a!=14&&b==14){12(s.1V[a]!=14)?s.1V[a]:1o};4(a!=14&&b!=14){12 J(B)[a]}};1a.2j=5(a){3 b=K("1O");4(a==6){$("#"+b).25()}19 4(a==15){$("#"+b).2f()}19{12 $("#"+b).9("1s")}};1a.57=5(a,b){3 c=a;3 d=c.1q;3 e=(c.2b==14||c.2b==1o)?d:c.2b;3 f=(c["1X"]==14||c["1X"]==1o)?\'\':c["1X"];3 i=(b==14||b==1o)?J(B).1E.1c:b;J(B).1E[i]=2r 58(d,e);4(f!=\'\')J(B).1E[i]["1X"]=f;3 g=U(i);4(g!=-1){3 h=N(J(B).1E[i],i,"","");$("#"+g.1b).1I(h)}19{3 h=N(J(B).1E[i],i,"","");3 j=K("1h");$("#"+j).59(h);S()}};1a.2D=5(i){J(B).2D(i);4((U(i))!=-1){$("#"+U(i).1b).2D();3X(i,\'d\')};4(J(B).1c==0){1T("")}19{3 a=U(J(B).1l).1I;1T(a)};s.1A("1l",J(B).1l)};1a.1k=5(a,b){J(B).1k=a;3 c=K("1O");4(a==6){$("#"+c).9("2E",z.1k);s.2e()}19 4(a==15){$("#"+c).9("2E",1)};4(b!=6){s.1A("1k",a)}};1a.3h=5(){12(J(B).3h==14)?1o:J(B).3h};1a.3i=5(){4(2p.1c==1){12 J(B).3i(2p[0])}19 4(2p.1c==2){12 J(B).3i(2p[0],2p[1])}19{47{48:"5a 1i 5b 5c!"}}};1a.49=5(a){12 J(B).49(a)};1a.1v=5(a){4(1w(a)=="14"){12 s.26("1v")}19{s.1A("1v",a)}};1a.1C=5(a){4(1w(a)=="14"){12 s.26("1C")}19{s.1A("1C",a)}};1a.5d=5(a,b){s.1R[a]=b};1a.5e=5(a){2H(s.1R[a])(s)};3 4a=5(){s.1A("3j",$.1S.3j);s.1A("3k",$.1S.3k)};3 4b=5(){T();3V();4a();4(q.2I!=\'\'){2H(q.2I)(s)}};4b()};$.1S={3j:2.37,3k:"5f 5g",3u:20,5h:5(a,b){12 $(a).1S(b).3c("28")}};$.3l.3n({1S:5(b){12 1a.2X(5(){3 a=2r 3m(1a,b);$(1a).3c(\'28\',a)})}});4(1w($.3l.18)==\'14\'){$.3l.18=5(w){12 $(1a).2B(w)}}})(5i);',62,329,'|||var|if|function|true|||css||||||||||||||||||||||||||||||||||||||||||||||||||||||selected|return||undefined|false|||prop|else|this|id|length|height|bind|case|break|postChildID|index|style|disabled|selectedIndex|top|position|null|document|text|class|display|ddTitleText|mouseup|multiple|typeof|span|div|px|set|mouseover|size|for|options|addClass|trigger|postTitleID|html|unbind|removeClass|bs|zIndex|useSprite|postID|click|mouseout|onActions|msDropDown|bv|showIcon|ddProp|keydown|title|sDiv|preventDefault||bA|oldIndex||bB|show|get||dd|postTitleTextID|ddOutOfVision|value|in|block|close|hide|parseInt|padding|stopPropagation|visible|bz|scrollTop|background|find|none|arguments|visibleRows|new|keyboardAction|currentKey|postArrowID|borderTop|noBorderTop|focus|dblclick|mousedown|mousemove|attr|border|remove|opacity|switch|bH|eval|onInit|insideWindow|postElementHolder|postAID|postOPTAID|ddTitle|arrow|ddChild|blur|change|keyup|option|opt|_|enabled|each|relative|width||after|bD|bx|by|Math|absolute||||bw|next|data|opp|bI|bJ|fast|form|item|version|author|fn|bt|extend|rowHeight|mainCSS|animStyle|Object|postInputhidden|actions|counter|children|className|img|src|align|absmiddle|href|javascript|void|toLowerCase|substr|font|first|bottom|bu|keyCode|open|0px|overflow|hidden|previous|left|repeat|bC|trim|backgroundPosition|bE|bF|bG|window|ani||onOpen|onClose|slideUp|default|onkeyup||throw|message|namedItem|bK|bL|120|9999|slideDown|_msddHolder|_msdd|_title|_titletext|_child|_msa|_msopta|postInputID|_msinput|_arrow|_inp|keypress|tabindex|msdrpdd|getElementById|val|nodeName|OPTGROUP|opta|weight|bold|italic|clear|both|label|1px|solid|c3c3c3|toggleClass|min|max|refresh|split|mouseenter|appendTo|image|no|2px|on|events|100|delete|floor|String|fromCharCode|auto|onkeydown|animate|debug|removeAttr|to|what|try|catch|add|Option|append|An|is|required|addMyEvent|fireEvent|Marghoob|Suleman|create|jQuery'.split('|'),0,{}))
600 \ No newline at end of file
601 diff -up cacti-0.8.8a/include/js/jquery/jquery.dropdown.js.legal cacti-0.8.8a/include/js/jquery/jquery.dropdown.js
602 --- cacti-0.8.8a/include/js/jquery/jquery.dropdown.js.legal 2013-01-04 15:44:38.032416068 -0500
603 +++ cacti-0.8.8a/include/js/jquery/jquery.dropdown.js 2013-01-04 15:43:12.644377988 -0500
604 @@ -0,0 +1,227 @@
605 +/*
606 + +-------------------------------------------------------------------------+
607 + | Copyright (C) 2004-2013 The Cacti Group |
608 + | |
609 + | This program is free software; you can redistribute it and/or |
610 + | modify it under the terms of the GNU General Public License |
611 + | as published by the Free Software Foundation; either version 2 |
612 + | of the License, or (at your option) any later version. |
613 + | |
614 + | This program is distributed in the hope that it will be useful, |
615 + | but WITHOUT ANY WARRANTY; without even the implied warranty of |
616 + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
617 + | GNU General Public License for more details. |
618 + +-------------------------------------------------------------------------+
619 + | Cacti: The Complete RRDTool-based Graphing Solution |
620 + +-------------------------------------------------------------------------+
621 + | This code is designed, written, and maintained by the Cacti Group. See |
622 + | about.php and/or the AUTHORS file for specific developer information. |
623 + +-------------------------------------------------------------------------+
624 + | http://www.cacti.net/ |
625 + +-------------------------------------------------------------------------+
626 +*/
627 +
628 +(function($){
629 + $.fn.DropDownMenu = function(options) {
630 +
631 + var defaults = {
632 + title: false,
633 + subtitle: false,
634 + name: 'myName',
635 + maxHeight: 300,
636 + width: 'auto',
637 + timeout: 500,
638 + auto_close: 10000,
639 + html: '<h6>empty</h6>',
640 + offsetX: 0,
641 + offsetY: 0,
642 + simultaneous: false,
643 + textAlign: 'left'
644 + };
645 +
646 + var timerref = null;
647 + var menu = null;
648 + var menuHeight = 0;
649 + var options = $.extend(defaults, options);
650 + var contentHeight = 0;
651 +
652 + /* do nothing if requested menu is still loaded */
653 + if($('#' + options.name).is(":visible")) { return; }
654 +
655 + /* remove all open menus from DOM if they should not stay in front at the same time */
656 + var oldMenus = $(".cacti_dd_menu");
657 + if(options.simultaneous == false) {
658 + oldMenus.css({'overflow-y':'hidden'}).slideUp('200');
659 + oldMenus.queue(function () {
660 + oldMenus.remove();
661 + oldMenus.dequeue();
662 + });
663 + }
664 +
665 + return this.each(function() {
666 + obj = $(this);
667 + newMenu = _init_menu(obj);
668 + _open_menu(newMenu);
669 + });
670 +
671 + function _init_menu(initiator){
672 + /* create the main menu structure */
673 + $("<div id='" + options.name + "' style='display: none;' class='cacti_dd_menu ui-widget ui-corner-all'>"
674 + + "<div id='" + options.name + "_title' class='title ui-state-default ui-corner-top'><h6>" + options.title + "</h6></div>"
675 + + "<div id='" + options.name + "_back' class='back ui-state-active'></div>"
676 + + "<div id='" + options.name + "_content' class='content ui-widget-content ui-state-highlight " + ((options.subtitle !== false) ? "" : "ui-corner-bottom" ) + "'></div>"
677 + + "<div id='" + options.name + "_subtitle' class='subtitle ui-state-default ui-corner-bottom'><h6>" + options.subtitle + "</h6></div>"
678 + + "<div id='" + options.name + "_html' class='html'></div>"
679 + + "</div>").appendTo("body");
680 +
681 + /* define references to the menu and its different sections */
682 + menu = $('#' + options.name);
683 + menu_head = $('#' + options.name + '_title');
684 + menu_content = $('#' + options.name + '_content');
685 + menu_back = $('#' + options.name + '_back');
686 + menu_subhead = $('#' + options.name + '_subtitle');
687 + menu_html = $('#' + options.name + '_html');
688 +
689 + /* while div container "myName_html" holds the raw data ... */
690 + menu_html.append(options.html);
691 + i=1;
692 + menu_html.find("h6:has(div)").each(function() {
693 + var subMenu = $(this);
694 + var subMenuClass = options.name + '_' + i;
695 + var subMenuTitle = subMenu.find('a:first').html();
696 + subMenu.addClass(subMenuClass);
697 + $('.'+subMenuClass).die().live("click", function(){ _switch_layer( subMenuClass); } );
698 + subMenu.children("div").hide();
699 + subMenu.find('a:first').html('<span style="float:left; min-width:80%;">' + subMenuTitle + '</span><span class="ui-icon ui-icon-triangle-1-e" style="float:right;"></span>');
700 + i++;
701 + });
702 +
703 + /* ... "myName_content" will have the visible menu data */
704 + menu_content.append(menu_html.html());
705 +
706 + /* if necessary show title, subtitle ... */
707 + if(options.title !== false) { menu_head.show(); }
708 + if(options.subtitle !== false) { menu_subhead.show(); }
709 +
710 + /* make content visible */
711 + menu_content.show();
712 +
713 + /* reduce height to a minimum for best fit */
714 + menuHeight = (menu.outerHeight() > options.maxHeight) ? options.maxHeight : menu.outerHeight();
715 +
716 + /* set the width to a fixed value */
717 + if(!isNaN(parseInt(options.width))) {
718 + menu.css({
719 + 'min-width' : options.width + 'px',
720 + 'max-width' : options.width + 'px'
721 + });
722 + menu.width(options.width);
723 + }else {
724 + // use real width plus 15 percent
725 + var width = menu.outerWidth(true)*1.15;
726 + menu.css({
727 + 'min-width' : width + 'px',
728 + 'max-width' : width + 'px'
729 + });
730 + menu.width(width);
731 + }
732 +
733 + /* default position of the menu container */
734 + menu.css({
735 + // x-position in relation to the initiator
736 + 'left' : initiator.offset().left + options.offsetX + 'px',
737 + // y-position in relation to the initiator
738 + 'top' : initiator.offset().top + initiator.height() + options.offsetY + 'px'
739 + });
740 +
741 + /* change the orientation from right to left if width exceeds the windows size */
742 + if((initiator.offset().left + initiator.width() + options.offsetX + menu.outerWidth(true)) > $(window).width()) {
743 + menu.css({'left' : (initiator.offset().left + initiator.width() - menu.outerWidth(true)) + 'px'});
744 + }
745 +
746 + menu.css({'height':0, 'text-align':options.textAlign});
747 + menu.bind('mouseover', _cancel_timer);
748 + menu.bind('mouseout', _set_timer);
749 + return menu;
750 + }
751 +
752 +
753 + function _switch_layer(subMenuClass){
754 + if(subMenuClass == null) {
755 + var content = menu_html;
756 + menu_back.empty().hide();
757 + menu_content.height(contentHeight);
758 + }else {
759 + var content = menu_html.find('.' + subMenuClass + ' div:first');
760 + menu_back.show();
761 + }
762 +
763 + parentClass = menu_html.find('.' + subMenuClass).parents('h6').attr('class');
764 +
765 + menu_back.empty().append( menu_html.find('.' + subMenuClass + ' a:first').html() );
766 + menu_back.find('span:last').removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s');
767 + menu_back.unbind('click').click( function() { _switch_layer( parentClass); });
768 +
769 + menu_content.empty().append(content.html());
770 +
771 + /* re-calculate content height */
772 + if(subMenuClass != null) {
773 + menu_head_height = menu_head.is(":visible") ? menu_head.outerHeight() : 0;
774 + menu_back_height = menu_back.is(":visible") ? menu_back.outerHeight() : 0;
775 + menu_subhead_height = menu_subhead.is(":visible") ? menu_subhead.outerHeight() : 0;
776 +
777 + menu_content.height(menuHeight - menu_head_height - menu_back_height - menu_subhead_height);
778 + }
779 +
780 + /* return false to suppress unwanted click events*/
781 + return false;
782 + }
783 +
784 + function _set_timer(timer){
785 + timer = ( typeof(timer) != 'number' ) ? options.timeout : timer;
786 + timerref = window.setTimeout( _close_menu, timer);
787 + }
788 +
789 + function _cancel_timer() {
790 + if(timerref) {
791 + window.clearTimeout(timerref);
792 + timerref = null;
793 + }
794 + }
795 +
796 + function _close_menu(){
797 + menu = $('#' + options.name);
798 + menu.slideUp(menuHeight*3);
799 + menu.queue(function () {
800 + menu.remove();
801 + menu.dequeue();
802 + });
803 + }
804 +
805 + function _open_menu(obj){
806 + //wait until oldMenu is completey closed before opening a new one
807 + var wait = setInterval(function() {
808 + if( !oldMenus.is(":animated") ) {
809 + clearInterval(wait);
810 + obj.show().animate({height: menuHeight}, menuHeight*3);
811 +
812 + //setup contentHeight;
813 + menu_head_height = menu_head.is(":visible") ? menu_head.outerHeight() : 0;
814 + menu_back_height = menu_back.is(":visible") ? menu_back.outerHeight() : 0;
815 + menu_subhead_height = menu_subhead.is(":visible") ? menu_subhead.outerHeight() : 0;
816 +
817 + menu_content.height(menuHeight - menu_head_height - menu_back_height - menu_subhead_height);
818 +
819 + contentHeight = $('#' + options.name + '_content').height();
820 + $('#' + options.name + '_content').css({'overflow-y':'auto'});
821 +
822 + obj.find('h6').eq(0).focus();
823 + if(options.auto_close !== false) {
824 + _set_timer(options.auto_close);
825 + }
826 + }
827 + }, 200);
828 + }
829 +
830 + };
831 +})(jQuery);
832 \ No newline at end of file
833 diff -up cacti-0.8.8a/include/js/jquery/jquery.js.legal cacti-0.8.8a/include/js/jquery/jquery.js
834 --- cacti-0.8.8a/include/js/jquery/jquery.js.legal 2013-01-04 15:44:38.035416071 -0500
835 +++ cacti-0.8.8a/include/js/jquery/jquery.js 2013-01-04 15:43:12.644377988 -0500
836 @@ -0,0 +1,4 @@
837 +/*! jQuery v1.7.1 jquery.com | jquery.org/license */
838 +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
839 +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
840 +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
841 \ No newline at end of file
842 diff -up cacti-0.8.8a/include/js/jquery/jquery.jstree.js.legal cacti-0.8.8a/include/js/jquery/jquery.jstree.js
843 --- cacti-0.8.8a/include/js/jquery/jquery.jstree.js.legal 2013-01-04 15:44:38.036416073 -0500
844 +++ cacti-0.8.8a/include/js/jquery/jquery.jstree.js 2013-01-04 15:43:12.645377988 -0500
845 @@ -0,0 +1,4551 @@
846 +/*
847 + * jsTree 1.0-rc3
848 + * http://jstree.com/
849 + *
850 + * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
851 + *
852 + * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
853 + * http://www.opensource.org/licenses/mit-license.php
854 + * http://www.gnu.org/licenses/gpl.html
855 + *
856 + * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
857 + * $Revision: 236 $
858 + */
859 +
860 +/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
861 +/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
862 +
863 +"use strict";
864 +
865 +// top wrapper to prevent multiple inclusion (is this OK?)
866 +(function () { if(jQuery && jQuery.jstree) { return; }
867 + var is_ie6 = false, is_ie7 = false, is_ff2 = false;
868 +
869 +/*
870 + * jsTree core
871 + */
872 +(function ($) {
873 + // Common functions not related to jsTree
874 + // decided to move them to a `vakata` "namespace"
875 + $.vakata = {};
876 + // CSS related functions
877 + $.vakata.css = {
878 + get_css : function(rule_name, delete_flag, sheet) {
879 + rule_name = rule_name.toLowerCase();
880 + var css_rules = sheet.cssRules || sheet.rules,
881 + j = 0;
882 + do {
883 + if(css_rules.length && j > css_rules.length + 5) { return false; }
884 + if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
885 + if(delete_flag === true) {
886 + if(sheet.removeRule) { sheet.removeRule(j); }
887 + if(sheet.deleteRule) { sheet.deleteRule(j); }
888 + return true;
889 + }
890 + else { return css_rules[j]; }
891 + }
892 + }
893 + while (css_rules[++j]);
894 + return false;
895 + },
896 + add_css : function(rule_name, sheet) {
897 + if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
898 + if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
899 + return $.vakata.css.get_css(rule_name);
900 + },
901 + remove_css : function(rule_name, sheet) {
902 + return $.vakata.css.get_css(rule_name, true, sheet);
903 + },
904 + add_sheet : function(opts) {
905 + var tmp = false, is_new = true;
906 + if(opts.str) {
907 + if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
908 + if(tmp) { is_new = false; }
909 + else {
910 + tmp = document.createElement("style");
911 + tmp.setAttribute('type',"text/css");
912 + if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
913 + }
914 + if(tmp.styleSheet) {
915 + if(is_new) {
916 + document.getElementsByTagName("head")[0].appendChild(tmp);
917 + tmp.styleSheet.cssText = opts.str;
918 + }
919 + else {
920 + tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
921 + }
922 + }
923 + else {
924 + tmp.appendChild(document.createTextNode(opts.str));
925 + document.getElementsByTagName("head")[0].appendChild(tmp);
926 + }
927 + return tmp.sheet || tmp.styleSheet;
928 + }
929 + if(opts.url) {
930 + if(document.createStyleSheet) {
931 + try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
932 + }
933 + else {
934 + tmp = document.createElement('link');
935 + tmp.rel = 'stylesheet';
936 + tmp.type = 'text/css';
937 + tmp.media = "all";
938 + tmp.href = opts.url;
939 + document.getElementsByTagName("head")[0].appendChild(tmp);
940 + return tmp.styleSheet;
941 + }
942 + }
943 + }
944 + };
945 +
946 + // private variables
947 + var instances = [], // instance array (used by $.jstree.reference/create/focused)
948 + focused_instance = -1, // the index in the instance array of the currently focused instance
949 + plugins = {}, // list of included plugins
950 + prepared_move = {}; // for the move_node function
951 +
952 + // jQuery plugin wrapper (thanks to jquery UI widget function)
953 + $.fn.jstree = function (settings) {
954 + var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
955 + args = Array.prototype.slice.call(arguments, 1),
956 + returnValue = this;
957 +
958 + // if a method call execute the method on all selected instances
959 + if(isMethodCall) {
960 + if(settings.substring(0, 1) == '_') { return returnValue; }
961 + this.each(function() {
962 + var instance = instances[$.data(this, "jstree_instance_id")],
963 + methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
964 + if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
965 + });
966 + }
967 + else {
968 + this.each(function() {
969 + // extend settings and allow for multiple hashes and $.data
970 + var instance_id = $.data(this, "jstree_instance_id"),
971 + a = [],
972 + b = settings ? $.extend({}, true, settings) : {},
973 + c = $(this),
974 + s = false,
975 + t = [];
976 + a = a.concat(args);
977 + if(c.data("jstree")) { a.push(c.data("jstree")); }
978 + b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
979 +
980 + // if an instance already exists, destroy it first
981 + if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
982 + // push a new empty object to the instances array
983 + instance_id = parseInt(instances.push({}),10) - 1;
984 + // store the jstree instance id to the container element
985 + $.data(this, "jstree_instance_id", instance_id);
986 + // clean up all plugins
987 + b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
988 + b.plugins.unshift("core");
989 + // only unique plugins
990 + b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
991 +
992 + // extend defaults with passed data
993 + s = $.extend(true, {}, $.jstree.defaults, b);
994 + s.plugins = b.plugins;
995 + $.each(plugins, function (i, val) {
996 + if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
997 + else { t.push(i); }
998 + });
999 + s.plugins = t;
1000 +
1001 + // push the new object to the instances array (at the same time set the default classes to the container) and init
1002 + instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
1003 + // init all activated plugins for this instance
1004 + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
1005 + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
1006 + // initialize the instance
1007 + setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
1008 + });
1009 + }
1010 + // return the jquery selection (or if it was a method call that returned a value - the returned value)
1011 + return returnValue;
1012 + };
1013 + // object to store exposed functions and objects
1014 + $.jstree = {
1015 + defaults : {
1016 + plugins : []
1017 + },
1018 + _focused : function () { return instances[focused_instance] || null; },
1019 + _reference : function (needle) {
1020 + // get by instance id
1021 + if(instances[needle]) { return instances[needle]; }
1022 + // get by DOM (if still no luck - return null
1023 + var o = $(needle);
1024 + if(!o.length && typeof needle === "string") { o = $("#" + needle); }
1025 + if(!o.length) { return null; }
1026 + return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
1027 + },
1028 + _instance : function (index, container, settings) {
1029 + // for plugins to store data in
1030 + this.data = { core : {} };
1031 + this.get_settings = function () { return $.extend(true, {}, settings); };
1032 + this._get_settings = function () { return settings; };
1033 + this.get_index = function () { return index; };
1034 + this.get_container = function () { return container; };
1035 + this.get_container_ul = function () { return container.children("ul:eq(0)"); };
1036 + this._set_settings = function (s) {
1037 + settings = $.extend(true, {}, settings, s);
1038 + };
1039 + },
1040 + _fn : { },
1041 + plugin : function (pname, pdata) {
1042 + pdata = $.extend({}, {
1043 + __init : $.noop,
1044 + __destroy : $.noop,
1045 + _fn : {},
1046 + defaults : false
1047 + }, pdata);
1048 + plugins[pname] = pdata;
1049 +
1050 + $.jstree.defaults[pname] = pdata.defaults;
1051 + $.each(pdata._fn, function (i, val) {
1052 + val.plugin = pname;
1053 + val.old = $.jstree._fn[i];
1054 + $.jstree._fn[i] = function () {
1055 + var rslt,
1056 + func = val,
1057 + args = Array.prototype.slice.call(arguments),
1058 + evnt = new $.Event("before.jstree"),
1059 + rlbk = false;
1060 +
1061 + if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
1062 +
1063 + // Check if function belongs to the included plugins of this instance
1064 + do {
1065 + if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
1066 + func = func.old;
1067 + } while(func);
1068 + if(!func) { return; }
1069 +
1070 + // context and function to trigger events, then finally call the function
1071 + if(i.indexOf("_") === 0) {
1072 + rslt = func.apply(this, args);
1073 + }
1074 + else {
1075 + rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
1076 + if(rslt === false) { return; }
1077 + if(typeof rslt !== "undefined") { args = rslt; }
1078 +
1079 + rslt = func.apply(
1080 + $.extend({}, this, {
1081 + __callback : function (data) {
1082 + this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
1083 + },
1084 + __rollback : function () {
1085 + rlbk = this.get_rollback();
1086 + return rlbk;
1087 + },
1088 + __call_old : function (replace_arguments) {
1089 + return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
1090 + }
1091 + }), args);
1092 + }
1093 +
1094 + // return the result
1095 + return rslt;
1096 + };
1097 + $.jstree._fn[i].old = val.old;
1098 + $.jstree._fn[i].plugin = pname;
1099 + });
1100 + },
1101 + rollback : function (rb) {
1102 + if(rb) {
1103 + if(!$.isArray(rb)) { rb = [ rb ]; }
1104 + $.each(rb, function (i, val) {
1105 + instances[val.i].set_rollback(val.h, val.d);
1106 + });
1107 + }
1108 + }
1109 + };
1110 + // set the prototype for all instances
1111 + $.jstree._fn = $.jstree._instance.prototype = {};
1112 +
1113 + // load the css when DOM is ready
1114 + $(function() {
1115 + // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
1116 + var u = navigator.userAgent.toLowerCase(),
1117 + v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
1118 + css_string = '' +
1119 + '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
1120 + '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
1121 + '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
1122 + '.jstree > ul > li { margin-left:0px; } ' +
1123 + '.jstree-rtl > ul > li { margin-right:0px; } ' +
1124 + '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
1125 + '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
1126 + '.jstree a:focus { outline: none; } ' +
1127 + '.jstree a > ins { height:16px; width:16px; } ' +
1128 + '.jstree a > .jstree-icon { margin-right:3px; } ' +
1129 + '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
1130 + 'li.jstree-open > ul { display:block; } ' +
1131 + 'li.jstree-closed > ul { display:none; } ';
1132 + // Correct IE 6 (does not support the > CSS selector)
1133 + if(/msie/.test(u) && parseInt(v, 10) == 6) {
1134 + is_ie6 = true;
1135 +
1136 + // fix image flicker and lack of caching
1137 + try {
1138 + document.execCommand("BackgroundImageCache", false, true);
1139 + } catch (err) { }
1140 +
1141 + css_string += '' +
1142 + '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
1143 + '.jstree li li { margin-left:18px; } ' +
1144 + '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
1145 + 'li.jstree-open ul { display:block; } ' +
1146 + 'li.jstree-closed ul { display:none !important; } ' +
1147 + '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
1148 + '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
1149 + '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
1150 + }
1151 + // Correct IE 7 (shifts anchor nodes onhover)
1152 + if(/msie/.test(u) && parseInt(v, 10) == 7) {
1153 + is_ie7 = true;
1154 + css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
1155 + }
1156 + // correct ff2 lack of display:inline-block
1157 + if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
1158 + is_ff2 = true;
1159 + css_string += '' +
1160 + '.jstree ins { display:-moz-inline-box; } ' +
1161 + '.jstree li { line-height:12px; } ' + // WHY??
1162 + '.jstree a { display:-moz-inline-box; } ' +
1163 + '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
1164 + /* this shouldn't be here as it is theme specific */
1165 + }
1166 + // the default stylesheet
1167 + $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
1168 + });
1169 +
1170 + // core functions (open, close, create, update, delete)
1171 + $.jstree.plugin("core", {
1172 + __init : function () {
1173 + this.data.core.locked = false;
1174 + this.data.core.to_open = this.get_settings().core.initially_open;
1175 + this.data.core.to_load = this.get_settings().core.initially_load;
1176 + },
1177 + defaults : {
1178 + html_titles : false,
1179 + animation : 500,
1180 + initially_open : [],
1181 + initially_load : [],
1182 + open_parents : true,
1183 + notify_plugins : true,
1184 + rtl : false,
1185 + load_open : false,
1186 + strings : {
1187 + loading : "Loading ...",
1188 + new_node : "New node",
1189 + multiple_selection : "Multiple selection"
1190 + }
1191 + },
1192 + _fn : {
1193 + init : function () {
1194 + this.set_focus();
1195 + if(this._get_settings().core.rtl) {
1196 + this.get_container().addClass("jstree-rtl").css("direction", "rtl");
1197 + }
1198 + this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_string("loading") + "</a></li></ul>");
1199 + this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
1200 +
1201 + this.get_container()
1202 + .delegate("li > ins", "click.jstree", $.proxy(function (event) {
1203 + var trgt = $(event.target);
1204 + // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
1205 + this.toggle_node(trgt);
1206 + }, this))
1207 + .bind("mousedown.jstree", $.proxy(function () {
1208 + this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
1209 + }, this))
1210 + .bind("dblclick.jstree", function (event) {
1211 + var sel;
1212 + if(document.selection && document.selection.empty) { document.selection.empty(); }
1213 + else {
1214 + if(window.getSelection) {
1215 + sel = window.getSelection();
1216 + try {
1217 + sel.removeAllRanges();
1218 + sel.collapse();
1219 + } catch (err) { }
1220 + }
1221 + }
1222 + });
1223 + if(this._get_settings().core.notify_plugins) {
1224 + this.get_container()
1225 + .bind("load_node.jstree", $.proxy(function (e, data) {
1226 + var o = this._get_node(data.rslt.obj),
1227 + t = this;
1228 + if(o === -1) { o = this.get_container_ul(); }
1229 + if(!o.length) { return; }
1230 + o.find("li").each(function () {
1231 + var th = $(this);
1232 + if(th.data("jstree")) {
1233 + $.each(th.data("jstree"), function (plugin, values) {
1234 + if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
1235 + t["_" + plugin + "_notify"].call(t, th, values);
1236 + }
1237 + });
1238 + }
1239 + });
1240 + }, this));
1241 + }
1242 + if(this._get_settings().core.load_open) {
1243 + this.get_container()
1244 + .bind("load_node.jstree", $.proxy(function (e, data) {
1245 + var o = this._get_node(data.rslt.obj),
1246 + t = this;
1247 + if(o === -1) { o = this.get_container_ul(); }
1248 + if(!o.length) { return; }
1249 + o.find("li.jstree-open:not(:has(ul))").each(function () {
1250 + t.load_node(this, $.noop, $.noop);
1251 + });
1252 + }, this));
1253 + }
1254 + this.__callback();
1255 + this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
1256 + },
1257 + destroy : function () {
1258 + var i,
1259 + n = this.get_index(),
1260 + s = this._get_settings(),
1261 + _this = this;
1262 +
1263 + $.each(s.plugins, function (i, val) {
1264 + try { plugins[val].__destroy.apply(_this); } catch(err) { }
1265 + });
1266 + this.__callback();
1267 + // set focus to another instance if this one is focused
1268 + if(this.is_focused()) {
1269 + for(i in instances) {
1270 + if(instances.hasOwnProperty(i) && i != n) {
1271 + instances[i].set_focus();
1272 + break;
1273 + }
1274 + }
1275 + }
1276 + // if no other instance found
1277 + if(n === focused_instance) { focused_instance = -1; }
1278 + // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
1279 + this.get_container()
1280 + .unbind(".jstree")
1281 + .undelegate(".jstree")
1282 + .removeData("jstree_instance_id")
1283 + .find("[class^='jstree']")
1284 + .andSelf()
1285 + .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
1286 + $(document)
1287 + .unbind(".jstree-" + n)
1288 + .undelegate(".jstree-" + n);
1289 + // remove the actual data
1290 + instances[n] = null;
1291 + delete instances[n];
1292 + },
1293 +
1294 + _core_notify : function (n, data) {
1295 + if(data.opened) {
1296 + this.open_node(n, false, true);
1297 + }
1298 + },
1299 +
1300 + lock : function () {
1301 + this.data.core.locked = true;
1302 + this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
1303 + this.__callback({});
1304 + },
1305 + unlock : function () {
1306 + this.data.core.locked = false;
1307 + this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
1308 + this.__callback({});
1309 + },
1310 + is_locked : function () { return this.data.core.locked; },
1311 + save_opened : function () {
1312 + var _this = this;
1313 + this.data.core.to_open = [];
1314 + this.get_container_ul().find("li.jstree-open").each(function () {
1315 + if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
1316 + });
1317 + this.__callback(_this.data.core.to_open);
1318 + },
1319 + save_loaded : function () { },
1320 + reload_nodes : function (is_callback) {
1321 + var _this = this,
1322 + done = true,
1323 + current = [],
1324 + remaining = [];
1325 + if(!is_callback) {
1326 + this.data.core.reopen = false;
1327 + this.data.core.refreshing = true;
1328 + this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
1329 + this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
1330 + if(this.data.core.to_open.length) {
1331 + this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
1332 + }
1333 + }
1334 + if(this.data.core.to_load.length) {
1335 + $.each(this.data.core.to_load, function (i, val) {
1336 + if(val == "#") { return true; }
1337 + if($(val).length) { current.push(val); }
1338 + else { remaining.push(val); }
1339 + });
1340 + if(current.length) {
1341 + this.data.core.to_load = remaining;
1342 + $.each(current, function (i, val) {
1343 + if(!_this._is_loaded(val)) {
1344 + _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
1345 + done = false;
1346 + }
1347 + });
1348 + }
1349 + }
1350 + if(this.data.core.to_open.length) {
1351 + $.each(this.data.core.to_open, function (i, val) {
1352 + _this.open_node(val, false, true);
1353 + });
1354 + }
1355 + if(done) {
1356 + // TODO: find a more elegant approach to syncronizing returning requests
1357 + if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
1358 + this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
1359 + this.data.core.refreshing = false;
1360 + this.reopen();
1361 + }
1362 + },
1363 + reopen : function () {
1364 + var _this = this;
1365 + if(this.data.core.to_open.length) {
1366 + $.each(this.data.core.to_open, function (i, val) {
1367 + _this.open_node(val, false, true);
1368 + });
1369 + }
1370 + this.__callback({});
1371 + },
1372 + refresh : function (obj) {
1373 + var _this = this;
1374 + this.save_opened();
1375 + if(!obj) { obj = -1; }
1376 + obj = this._get_node(obj);
1377 + if(!obj) { obj = -1; }
1378 + if(obj !== -1) { obj.children("UL").remove(); }
1379 + else { this.get_container_ul().empty(); }
1380 + this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
1381 + },
1382 + // Dummy function to fire after the first load (so that there is a jstree.loaded event)
1383 + loaded : function () {
1384 + this.__callback();
1385 + },
1386 + // deal with focus
1387 + set_focus : function () {
1388 + if(this.is_focused()) { return; }
1389 + var f = $.jstree._focused();
1390 + if(f) { f.unset_focus(); }
1391 +
1392 + this.get_container().addClass("jstree-focused");
1393 + focused_instance = this.get_index();
1394 + this.__callback();
1395 + },
1396 + is_focused : function () {
1397 + return focused_instance == this.get_index();
1398 + },
1399 + unset_focus : function () {
1400 + if(this.is_focused()) {
1401 + this.get_container().removeClass("jstree-focused");
1402 + focused_instance = -1;
1403 + }
1404 + this.__callback();
1405 + },
1406 +
1407 + // traverse
1408 + _get_node : function (obj) {
1409 + var $obj = $(obj, this.get_container());
1410 + if($obj.is(".jstree") || obj == -1) { return -1; }
1411 + $obj = $obj.closest("li", this.get_container());
1412 + return $obj.length ? $obj : false;
1413 + },
1414 + _get_next : function (obj, strict) {
1415 + obj = this._get_node(obj);
1416 + if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
1417 + if(!obj.length) { return false; }
1418 + if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
1419 +
1420 + if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
1421 + else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
1422 + else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
1423 + },
1424 + _get_prev : function (obj, strict) {
1425 + obj = this._get_node(obj);
1426 + if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
1427 + if(!obj.length) { return false; }
1428 + if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
1429 +
1430 + if(obj.prev("li").length) {
1431 + obj = obj.prev("li").eq(0);
1432 + while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
1433 + return obj;
1434 + }
1435 + else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
1436 + },
1437 + _get_parent : function (obj) {
1438 + obj = this._get_node(obj);
1439 + if(obj == -1 || !obj.length) { return false; }
1440 + var o = obj.parentsUntil(".jstree", "li:eq(0)");
1441 + return o.length ? o : -1;
1442 + },
1443 + _get_children : function (obj) {
1444 + obj = this._get_node(obj);
1445 + if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
1446 + if(!obj.length) { return false; }
1447 + return obj.children("ul:eq(0)").children("li");
1448 + },
1449 + get_path : function (obj, id_mode) {
1450 + var p = [],
1451 + _this = this;
1452 + obj = this._get_node(obj);
1453 + if(obj === -1 || !obj || !obj.length) { return false; }
1454 + obj.parentsUntil(".jstree", "li").each(function () {
1455 + p.push( id_mode ? this.id : _this.get_text(this) );
1456 + });
1457 + p.reverse();
1458 + p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
1459 + return p;
1460 + },
1461 +
1462 + // string functions
1463 + _get_string : function (key) {
1464 + return this._get_settings().core.strings[key] || key;
1465 + },
1466 +
1467 + is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
1468 + is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
1469 + is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
1470 + correct_state : function (obj) {
1471 + obj = this._get_node(obj);
1472 + if(!obj || obj === -1) { return false; }
1473 + obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
1474 + this.__callback({ "obj" : obj });
1475 + },
1476 + // open/close
1477 + open_node : function (obj, callback, skip_animation) {
1478 + obj = this._get_node(obj);
1479 + if(!obj.length) { return false; }
1480 + if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
1481 + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
1482 + t = this;
1483 + if(!this._is_loaded(obj)) {
1484 + obj.children("a").addClass("jstree-loading");
1485 + this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
1486 + }
1487 + else {
1488 + if(this._get_settings().core.open_parents) {
1489 + obj.parentsUntil(".jstree",".jstree-closed").each(function () {
1490 + t.open_node(this, false, true);
1491 + });
1492 + }
1493 + if(s) { obj.children("ul").css("display","none"); }
1494 + obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
1495 + if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
1496 + else { t.after_open(obj); }
1497 + this.__callback({ "obj" : obj });
1498 + if(callback) { callback.call(); }
1499 + }
1500 + },
1501 + after_open : function (obj) { this.__callback({ "obj" : obj }); },
1502 + close_node : function (obj, skip_animation) {
1503 + obj = this._get_node(obj);
1504 + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
1505 + t = this;
1506 + if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
1507 + if(s) { obj.children("ul").attr("style","display:block !important"); }
1508 + obj.removeClass("jstree-open").addClass("jstree-closed");
1509 + if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
1510 + else { t.after_close(obj); }
1511 + this.__callback({ "obj" : obj });
1512 + },
1513 + after_close : function (obj) { this.__callback({ "obj" : obj }); },
1514 + toggle_node : function (obj) {
1515 + obj = this._get_node(obj);
1516 + if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
1517 + if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
1518 + },
1519 + open_all : function (obj, do_animation, original_obj) {
1520 + obj = obj ? this._get_node(obj) : -1;
1521 + if(!obj || obj === -1) { obj = this.get_container_ul(); }
1522 + if(original_obj) {
1523 + obj = obj.find("li.jstree-closed");
1524 + }
1525 + else {
1526 + original_obj = obj;
1527 + if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
1528 + else { obj = obj.find("li.jstree-closed"); }
1529 + }
1530 + var _this = this;
1531 + obj.each(function () {
1532 + var __this = this;
1533 + if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
1534 + else { _this.open_node(this, false, !do_animation); }
1535 + });
1536 + // so that callback is fired AFTER all nodes are open
1537 + if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
1538 + },
1539 + close_all : function (obj, do_animation) {
1540 + var _this = this;
1541 + obj = obj ? this._get_node(obj) : this.get_container();
1542 + if(!obj || obj === -1) { obj = this.get_container_ul(); }
1543 + obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
1544 + this.__callback({ "obj" : obj });
1545 + },
1546 + clean_node : function (obj) {
1547 + obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
1548 + obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
1549 + obj.removeClass("jstree-last")
1550 + .filter("li:last-child").addClass("jstree-last").end()
1551 + .filter(":has(li)")
1552 + .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
1553 + obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
1554 + this.__callback({ "obj" : obj });
1555 + },
1556 + // rollback
1557 + get_rollback : function () {
1558 + this.__callback();
1559 + return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
1560 + },
1561 + set_rollback : function (html, data) {
1562 + this.get_container().empty().append(html);
1563 + this.data = data;
1564 + this.__callback();
1565 + },
1566 + // Dummy functions to be overwritten by any datastore plugin included
1567 + load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
1568 + _is_loaded : function (obj) { return true; },
1569 +
1570 + // Basic operations: create
1571 + create_node : function (obj, position, js, callback, is_loaded) {
1572 + obj = this._get_node(obj);
1573 + position = typeof position === "undefined" ? "last" : position;
1574 + var d = $("<li />"),
1575 + s = this._get_settings().core,
1576 + tmp;
1577 +
1578 + if(obj !== -1 && !obj.length) { return false; }
1579 + if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
1580 +
1581 + this.__rollback();
1582 +
1583 + if(typeof js === "string") { js = { "data" : js }; }
1584 + if(!js) { js = {}; }
1585 + if(js.attr) { d.attr(js.attr); }
1586 + if(js.metadata) { d.data(js.metadata); }
1587 + if(js.state) { d.addClass("jstree-" + js.state); }
1588 + if(!js.data) { js.data = this._get_string("new_node"); }
1589 + if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
1590 + $.each(js.data, function (i, m) {
1591 + tmp = $("<a />");
1592 + if($.isFunction(m)) { m = m.call(this, js); }
1593 + if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
1594 + else {
1595 + if(!m.attr) { m.attr = {}; }
1596 + if(!m.attr.href) { m.attr.href = '#'; }
1597 + tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
1598 + if(m.language) { tmp.addClass(m.language); }
1599 + }
1600 + tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
1601 + if(!m.icon && js.icon) { m.icon = js.icon; }
1602 + if(m.icon) {
1603 + if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
1604 + else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
1605 + }
1606 + d.append(tmp);
1607 + });
1608 + d.prepend("<ins class='jstree-icon'>&#160;</ins>");
1609 + if(obj === -1) {
1610 + obj = this.get_container();
1611 + if(position === "before") { position = "first"; }
1612 + if(position === "after") { position = "last"; }
1613 + }
1614 + switch(position) {
1615 + case "before": obj.before(d); tmp = this._get_parent(obj); break;
1616 + case "after" : obj.after(d); tmp = this._get_parent(obj); break;
1617 + case "inside":
1618 + case "first" :
1619 + if(!obj.children("ul").length) { obj.append("<ul />"); }
1620 + obj.children("ul").prepend(d);
1621 + tmp = obj;
1622 + break;
1623 + case "last":
1624 + if(!obj.children("ul").length) { obj.append("<ul />"); }
1625 + obj.children("ul").append(d);
1626 + tmp = obj;
1627 + break;
1628 + default:
1629 + if(!obj.children("ul").length) { obj.append("<ul />"); }
1630 + if(!position) { position = 0; }
1631 + tmp = obj.children("ul").children("li").eq(position);
1632 + if(tmp.length) { tmp.before(d); }
1633 + else { obj.children("ul").append(d); }
1634 + tmp = obj;
1635 + break;
1636 + }
1637 + if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
1638 + this.clean_node(tmp);
1639 + this.__callback({ "obj" : d, "parent" : tmp });
1640 + if(callback) { callback.call(this, d); }
1641 + return d;
1642 + },
1643 + // Basic operations: rename (deal with text)
1644 + get_text : function (obj) {
1645 + obj = this._get_node(obj);
1646 + if(!obj.length) { return false; }
1647 + var s = this._get_settings().core.html_titles;
1648 + obj = obj.children("a:eq(0)");
1649 + if(s) {
1650 + obj = obj.clone();
1651 + obj.children("INS").remove();
1652 + return obj.html();
1653 + }
1654 + else {
1655 + obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
1656 + return obj.nodeValue;
1657 + }
1658 + },
1659 + set_text : function (obj, val) {
1660 + obj = this._get_node(obj);
1661 + if(!obj.length) { return false; }
1662 + obj = obj.children("a:eq(0)");
1663 + if(this._get_settings().core.html_titles) {
1664 + var tmp = obj.children("INS").clone();
1665 + obj.html(val).prepend(tmp);
1666 + this.__callback({ "obj" : obj, "name" : val });
1667 + return true;
1668 + }
1669 + else {
1670 + obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
1671 + this.__callback({ "obj" : obj, "name" : val });
1672 + return (obj.nodeValue = val);
1673 + }
1674 + },
1675 + rename_node : function (obj, val) {
1676 + obj = this._get_node(obj);
1677 + this.__rollback();
1678 + if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
1679 + },
1680 + // Basic operations: deleting nodes
1681 + delete_node : function (obj) {
1682 + obj = this._get_node(obj);
1683 + if(!obj.length) { return false; }
1684 + this.__rollback();
1685 + var p = this._get_parent(obj), prev = $([]), t = this;
1686 + obj.each(function () {
1687 + prev = prev.add(t._get_prev(this));
1688 + });
1689 + obj = obj.detach();
1690 + if(p !== -1 && p.find("> ul > li").length === 0) {
1691 + p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
1692 + }
1693 + this.clean_node(p);
1694 + this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
1695 + return obj;
1696 + },
1697 + prepare_move : function (o, r, pos, cb, is_cb) {
1698 + var p = {};
1699 +
1700 + p.ot = $.jstree._reference(o) || this;
1701 + p.o = p.ot._get_node(o);
1702 + p.r = r === - 1 ? -1 : this._get_node(r);
1703 + p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
1704 + if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
1705 + this.__callback(prepared_move);
1706 + if(cb) { cb.call(this, prepared_move); }
1707 + return;
1708 + }
1709 + p.ot = $.jstree._reference(p.o) || this;
1710 + p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
1711 + if(p.r === -1 || !p.r) {
1712 + p.cr = -1;
1713 + switch(p.p) {
1714 + case "first":
1715 + case "before":
1716 + case "inside":
1717 + p.cp = 0;
1718 + break;
1719 + case "after":
1720 + case "last":
1721 + p.cp = p.rt.get_container().find(" > ul > li").length;
1722 + break;
1723 + default:
1724 + p.cp = p.p;
1725 + break;
1726 + }
1727 + }
1728 + else {
1729 + if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
1730 + return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
1731 + }
1732 + switch(p.p) {
1733 + case "before":
1734 + p.cp = p.r.index();
1735 + p.cr = p.rt._get_parent(p.r);
1736 + break;
1737 + case "after":
1738 + p.cp = p.r.index() + 1;
1739 + p.cr = p.rt._get_parent(p.r);
1740 + break;
1741 + case "inside":
1742 + case "first":
1743 + p.cp = 0;
1744 + p.cr = p.r;
1745 + break;
1746 + case "last":
1747 + p.cp = p.r.find(" > ul > li").length;
1748 + p.cr = p.r;
1749 + break;
1750 + default:
1751 + p.cp = p.p;
1752 + p.cr = p.r;
1753 + break;
1754 + }
1755 + }
1756 + p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
1757 + p.op = p.ot._get_parent(p.o);
1758 + p.cop = p.o.index();
1759 + if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
1760 + if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
1761 + //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
1762 + p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
1763 + prepared_move = p;
1764 + this.__callback(prepared_move);
1765 + if(cb) { cb.call(this, prepared_move); }
1766 + },
1767 + check_move : function () {
1768 + var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
1769 + if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
1770 + if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
1771 + obj.o.each(function () {
1772 + if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
1773 + });
1774 + return ret;
1775 + },
1776 + move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
1777 + if(!is_prepared) {
1778 + return this.prepare_move(obj, ref, position, function (p) {
1779 + this.move_node(p, false, false, is_copy, true, skip_check);
1780 + });
1781 + }
1782 + if(is_copy) {
1783 + prepared_move.cy = true;
1784 + }
1785 + if(!skip_check && !this.check_move()) { return false; }
1786 +
1787 + this.__rollback();
1788 + var o = false;
1789 + if(is_copy) {
1790 + o = obj.o.clone(true);
1791 + o.find("*[id]").andSelf().each(function () {
1792 + if(this.id) { this.id = "copy_" + this.id; }
1793 + });
1794 + }
1795 + else { o = obj.o; }
1796 +
1797 + if(obj.or.length) { obj.or.before(o); }
1798 + else {
1799 + if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
1800 + obj.np.children("ul:eq(0)").append(o);
1801 + }
1802 +
1803 + try {
1804 + obj.ot.clean_node(obj.op);
1805 + obj.rt.clean_node(obj.np);
1806 + if(!obj.op.find("> ul > li").length) {
1807 + obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
1808 + }
1809 + } catch (e) { }
1810 +
1811 + if(is_copy) {
1812 + prepared_move.cy = true;
1813 + prepared_move.oc = o;
1814 + }
1815 + this.__callback(prepared_move);
1816 + return prepared_move;
1817 + },
1818 + _get_move : function () { return prepared_move; }
1819 + }
1820 + });
1821 +})(jQuery);
1822 +//*/
1823 +
1824 +/*
1825 + * jsTree ui plugin
1826 + * This plugins handles selecting/deselecting/hovering/dehovering nodes
1827 + */
1828 +(function ($) {
1829 + var scrollbar_width, e1, e2;
1830 + $(function() {
1831 + if (/msie/.test(navigator.userAgent.toLowerCase())) {
1832 + e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
1833 + e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
1834 + scrollbar_width = e1.width() - e2.width();
1835 + e1.add(e2).remove();
1836 + }
1837 + else {
1838 + e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
1839 + .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
1840 + scrollbar_width = 100 - e1.width();
1841 + e1.parent().remove();
1842 + }
1843 + });
1844 + $.jstree.plugin("ui", {
1845 + __init : function () {
1846 + this.data.ui.selected = $();
1847 + this.data.ui.last_selected = false;
1848 + this.data.ui.hovered = null;
1849 + this.data.ui.to_select = this.get_settings().ui.initially_select;
1850 +
1851 + this.get_container()
1852 + .delegate("a", "click.jstree", $.proxy(function (event) {
1853 + event.preventDefault();
1854 + event.currentTarget.blur();
1855 + if(!$(event.currentTarget).hasClass("jstree-loading")) {
1856 + this.select_node(event.currentTarget, true, event);
1857 + }
1858 + }, this))
1859 + .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
1860 + if(!$(event.currentTarget).hasClass("jstree-loading")) {
1861 + this.hover_node(event.target);
1862 + }
1863 + }, this))
1864 + .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
1865 + if(!$(event.currentTarget).hasClass("jstree-loading")) {
1866 + this.dehover_node(event.target);
1867 + }
1868 + }, this))
1869 + .bind("reopen.jstree", $.proxy(function () {
1870 + this.reselect();
1871 + }, this))
1872 + .bind("get_rollback.jstree", $.proxy(function () {
1873 + this.dehover_node();
1874 + this.save_selected();
1875 + }, this))
1876 + .bind("set_rollback.jstree", $.proxy(function () {
1877 + this.reselect();
1878 + }, this))
1879 + .bind("close_node.jstree", $.proxy(function (event, data) {
1880 + var s = this._get_settings().ui,
1881 + obj = this._get_node(data.rslt.obj),
1882 + clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
1883 + _this = this;
1884 + if(s.selected_parent_close === false || !clk.length) { return; }
1885 + clk.each(function () {
1886 + _this.deselect_node(this);
1887 + if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
1888 + });
1889 + }, this))
1890 + .bind("delete_node.jstree", $.proxy(function (event, data) {
1891 + var s = this._get_settings().ui.select_prev_on_delete,
1892 + obj = this._get_node(data.rslt.obj),
1893 + clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
1894 + _this = this;
1895 + clk.each(function () { _this.deselect_node(this); });
1896 + if(s && clk.length) {
1897 + data.rslt.prev.each(function () {
1898 + if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
1899 + });
1900 + }
1901 + }, this))
1902 + .bind("move_node.jstree", $.proxy(function (event, data) {
1903 + if(data.rslt.cy) {
1904 + data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
1905 + }
1906 + }, this));
1907 + },
1908 + defaults : {
1909 + select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
1910 + select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
1911 + select_range_modifier : "shift",
1912 + selected_parent_close : "select_parent", // false, "deselect", "select_parent"
1913 + selected_parent_open : true,
1914 + select_prev_on_delete : true,
1915 + disable_selecting_children : false,
1916 + initially_select : []
1917 + },
1918 + _fn : {
1919 + _get_node : function (obj, allow_multiple) {
1920 + if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
1921 + var $obj = $(obj, this.get_container());
1922 + if($obj.is(".jstree") || obj == -1) { return -1; }
1923 + $obj = $obj.closest("li", this.get_container());
1924 + return $obj.length ? $obj : false;
1925 + },
1926 + _ui_notify : function (n, data) {
1927 + if(data.selected) {
1928 + this.select_node(n, false);
1929 + }
1930 + },
1931 + save_selected : function () {
1932 + var _this = this;
1933 + this.data.ui.to_select = [];
1934 + this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
1935 + this.__callback(this.data.ui.to_select);
1936 + },
1937 + reselect : function () {
1938 + var _this = this,
1939 + s = this.data.ui.to_select;
1940 + s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
1941 + // this.deselect_all(); WHY deselect, breaks plugin state notifier?
1942 + $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
1943 + this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
1944 + this.__callback();
1945 + },
1946 + refresh : function (obj) {
1947 + this.save_selected();
1948 + return this.__call_old();
1949 + },
1950 + hover_node : function (obj) {
1951 + obj = this._get_node(obj);
1952 + if(!obj.length) { return false; }
1953 + //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
1954 + if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
1955 + this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
1956 + this._fix_scroll(obj);
1957 + this.__callback({ "obj" : obj });
1958 + },
1959 + dehover_node : function () {
1960 + var obj = this.data.ui.hovered, p;
1961 + if(!obj || !obj.length) { return false; }
1962 + p = obj.children("a").removeClass("jstree-hovered").parent();
1963 + if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
1964 + this.__callback({ "obj" : obj });
1965 + },
1966 + select_node : function (obj, check, e) {
1967 + obj = this._get_node(obj);
1968 + if(obj == -1 || !obj || !obj.length) { return false; }
1969 + var s = this._get_settings().ui,
1970 + is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
1971 + is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
1972 + is_selected = this.is_selected(obj),
1973 + proceed = true,
1974 + t = this;
1975 + if(check) {
1976 + if(s.disable_selecting_children && is_multiple &&
1977 + (
1978 + (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
1979 + (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
1980 + )
1981 + ) {
1982 + return false;
1983 + }
1984 + proceed = false;
1985 + switch(!0) {
1986 + case (is_range):
1987 + this.data.ui.last_selected.addClass("jstree-last-selected");
1988 + obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
1989 + if(s.select_limit == -1 || obj.length < s.select_limit) {
1990 + this.data.ui.last_selected.removeClass("jstree-last-selected");
1991 + this.data.ui.selected.each(function () {
1992 + if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
1993 + });
1994 + is_selected = false;
1995 + proceed = true;
1996 + }
1997 + else {
1998 + proceed = false;
1999 + }
2000 + break;
2001 + case (is_selected && !is_multiple):
2002 + this.deselect_all();
2003 + is_selected = false;
2004 + proceed = true;
2005 + break;
2006 + case (!is_selected && !is_multiple):
2007 + if(s.select_limit == -1 || s.select_limit > 0) {
2008 + this.deselect_all();
2009 + proceed = true;
2010 + }
2011 + break;
2012 + case (is_selected && is_multiple):
2013 + this.deselect_node(obj);
2014 + break;
2015 + case (!is_selected && is_multiple):
2016 + if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
2017 + proceed = true;
2018 + }
2019 + break;
2020 + }
2021 + }
2022 + if(proceed && !is_selected) {
2023 + if(!is_range) { this.data.ui.last_selected = obj; }
2024 + obj.children("a").addClass("jstree-clicked");
2025 + if(s.selected_parent_open) {
2026 + obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
2027 + }
2028 + this.data.ui.selected = this.data.ui.selected.add(obj);
2029 + this._fix_scroll(obj.eq(0));
2030 + this.__callback({ "obj" : obj, "e" : e });
2031 + }
2032 + },
2033 + _fix_scroll : function (obj) {
2034 + var c = this.get_container()[0], t;
2035 + if(c.scrollHeight > c.offsetHeight) {
2036 + obj = this._get_node(obj);
2037 + if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
2038 + t = obj.offset().top - this.get_container().offset().top;
2039 + if(t < 0) {
2040 + c.scrollTop = c.scrollTop + t - 1;
2041 + }
2042 + if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
2043 + c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
2044 + }
2045 + }
2046 + },
2047 + deselect_node : function (obj) {
2048 + obj = this._get_node(obj);
2049 + if(!obj.length) { return false; }
2050 + if(this.is_selected(obj)) {
2051 + obj.children("a").removeClass("jstree-clicked");
2052 + this.data.ui.selected = this.data.ui.selected.not(obj);
2053 + if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
2054 + this.__callback({ "obj" : obj });
2055 + }
2056 + },
2057 + toggle_select : function (obj) {
2058 + obj = this._get_node(obj);
2059 + if(!obj.length) { return false; }
2060 + if(this.is_selected(obj)) { this.deselect_node(obj); }
2061 + else { this.select_node(obj); }
2062 + },
2063 + is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
2064 + get_selected : function (context) {
2065 + return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
2066 + },
2067 + deselect_all : function (context) {
2068 + var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
2069 + ret.children("a.jstree-clicked").removeClass("jstree-clicked");
2070 + this.data.ui.selected = $([]);
2071 + this.data.ui.last_selected = false;
2072 + this.__callback({ "obj" : ret });
2073 + }
2074 + }
2075 + });
2076 + // include the selection plugin by default
2077 + $.jstree.defaults.plugins.push("ui");
2078 +})(jQuery);
2079 +//*/
2080 +
2081 +/*
2082 + * jsTree CRRM plugin
2083 + * Handles creating/renaming/removing/moving nodes by user interaction.
2084 + */
2085 +(function ($) {
2086 + $.jstree.plugin("crrm", {
2087 + __init : function () {
2088 + this.get_container()
2089 + .bind("move_node.jstree", $.proxy(function (e, data) {
2090 + if(this._get_settings().crrm.move.open_onmove) {
2091 + var t = this;
2092 + data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
2093 + t.open_node(this, false, true);
2094 + });
2095 + }
2096 + }, this));
2097 + },
2098 + defaults : {
2099 + input_width_limit : 200,
2100 + move : {
2101 + always_copy : false, // false, true or "multitree"
2102 + open_onmove : true,
2103 + default_position : "last",
2104 + check_move : function (m) { return true; }
2105 + }
2106 + },
2107 + _fn : {
2108 + _show_input : function (obj, callback) {
2109 + obj = this._get_node(obj);
2110 + var rtl = this._get_settings().core.rtl,
2111 + w = this._get_settings().crrm.input_width_limit,
2112 + w1 = obj.children("ins").width(),
2113 + w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
2114 + t = this.get_text(obj),
2115 + h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
2116 + h2 = obj.css("position","relative").append(
2117 + $("<input />", {
2118 + "value" : t,
2119 + "class" : "jstree-rename-input",
2120 + // "size" : t.length,
2121 + "css" : {
2122 + "padding" : "0",
2123 + "border" : "1px solid silver",
2124 + "position" : "absolute",
2125 + "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
2126 + "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
2127 + "top" : "0px",
2128 + "height" : (this.data.core.li_height - 2) + "px",
2129 + "lineHeight" : (this.data.core.li_height - 2) + "px",
2130 + "width" : "150px" // will be set a bit further down
2131 + },
2132 + "blur" : $.proxy(function () {
2133 + var i = obj.children(".jstree-rename-input"),
2134 + v = i.val();
2135 + if(v === "") { v = t; }
2136 + h1.remove();
2137 + i.remove(); // rollback purposes
2138 + this.set_text(obj,t); // rollback purposes
2139 + this.rename_node(obj, v);
2140 + callback.call(this, obj, v, t);
2141 + obj.css("position","");
2142 + }, this),
2143 + "keyup" : function (event) {
2144 + var key = event.keyCode || event.which;
2145 + if(key == 27) { this.value = t; this.blur(); return; }
2146 + else if(key == 13) { this.blur(); return; }
2147 + else {
2148 + h2.width(Math.min(h1.text("pW" + this.value).width(),w));
2149 + }
2150 + },
2151 + "keypress" : function(event) {
2152 + var key = event.keyCode || event.which;
2153 + if(key == 13) { return false; }
2154 + }
2155 + })
2156 + ).children(".jstree-rename-input");
2157 + this.set_text(obj, "");
2158 + h1.css({
2159 + fontFamily : h2.css('fontFamily') || '',
2160 + fontSize : h2.css('fontSize') || '',
2161 + fontWeight : h2.css('fontWeight') || '',
2162 + fontStyle : h2.css('fontStyle') || '',
2163 + fontStretch : h2.css('fontStretch') || '',
2164 + fontVariant : h2.css('fontVariant') || '',
2165 + letterSpacing : h2.css('letterSpacing') || '',
2166 + wordSpacing : h2.css('wordSpacing') || ''
2167 + });
2168 + h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
2169 + },
2170 + rename : function (obj) {
2171 + obj = this._get_node(obj);
2172 + this.__rollback();
2173 + var f = this.__callback;
2174 + this._show_input(obj, function (obj, new_name, old_name) {
2175 + f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
2176 + });
2177 + },
2178 + create : function (obj, position, js, callback, skip_rename) {
2179 + var t, _this = this;
2180 + obj = this._get_node(obj);
2181 + if(!obj) { obj = -1; }
2182 + this.__rollback();
2183 + t = this.create_node(obj, position, js, function (t) {
2184 + var p = this._get_parent(t),
2185 + pos = $(t).index();
2186 + if(callback) { callback.call(this, t); }
2187 + if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
2188 + if(!skip_rename) {
2189 + this._show_input(t, function (obj, new_name, old_name) {
2190 + _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
2191 + });
2192 + }
2193 + else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
2194 + });
2195 + return t;
2196 + },
2197 + remove : function (obj) {
2198 + obj = this._get_node(obj, true);
2199 + var p = this._get_parent(obj), prev = this._get_prev(obj);
2200 + this.__rollback();
2201 + obj = this.delete_node(obj);
2202 + if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
2203 + },
2204 + check_move : function () {
2205 + if(!this.__call_old()) { return false; }
2206 + var s = this._get_settings().crrm.move;
2207 + if(!s.check_move.call(this, this._get_move())) { return false; }
2208 + return true;
2209 + },
2210 + move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
2211 + var s = this._get_settings().crrm.move;
2212 + if(!is_prepared) {
2213 + if(typeof position === "undefined") { position = s.default_position; }
2214 + if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
2215 + return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
2216 + }
2217 + // if the move is already prepared
2218 + if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
2219 + is_copy = true;
2220 + }
2221 + this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
2222 + },
2223 +
2224 + cut : function (obj) {
2225 + obj = this._get_node(obj, true);
2226 + if(!obj || !obj.length) { return false; }
2227 + this.data.crrm.cp_nodes = false;
2228 + this.data.crrm.ct_nodes = obj;
2229 + this.__callback({ "obj" : obj });
2230 + },
2231 + copy : function (obj) {
2232 + obj = this._get_node(obj, true);
2233 + if(!obj || !obj.length) { return false; }
2234 + this.data.crrm.ct_nodes = false;
2235 + this.data.crrm.cp_nodes = obj;
2236 + this.__callback({ "obj" : obj });
2237 + },
2238 + paste : function (obj) {
2239 + obj = this._get_node(obj);
2240 + if(!obj || !obj.length) { return false; }
2241 + var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
2242 + if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
2243 + if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
2244 + if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
2245 + this.__callback({ "obj" : obj, "nodes" : nodes });
2246 + }
2247 + }
2248 + });
2249 + // include the crr plugin by default
2250 + // $.jstree.defaults.plugins.push("crrm");
2251 +})(jQuery);
2252 +//*/
2253 +
2254 +/*
2255 + * jsTree themes plugin
2256 + * Handles loading and setting themes, as well as detecting path to themes, etc.
2257 + */
2258 +(function ($) {
2259 + var themes_loaded = [];
2260 + // this variable stores the path to the themes folder - if left as false - it will be autodetected
2261 + $.jstree._themes = false;
2262 + $.jstree.plugin("themes", {
2263 + __init : function () {
2264 + this.get_container()
2265 + .bind("init.jstree", $.proxy(function () {
2266 + var s = this._get_settings().themes;
2267 + this.data.themes.dots = s.dots;
2268 + this.data.themes.icons = s.icons;
2269 + this.set_theme(s.theme, s.url);
2270 + }, this))
2271 + .bind("loaded.jstree", $.proxy(function () {
2272 + // bound here too, as simple HTML tree's won't honor dots & icons otherwise
2273 + if(!this.data.themes.dots) { this.hide_dots(); }
2274 + else { this.show_dots(); }
2275 + if(!this.data.themes.icons) { this.hide_icons(); }
2276 + else { this.show_icons(); }
2277 + }, this));
2278 + },
2279 + defaults : {
2280 + theme : "default",
2281 + url : false,
2282 + dots : true,
2283 + icons : true
2284 + },
2285 + _fn : {
2286 + set_theme : function (theme_name, theme_url) {
2287 + if(!theme_name) { return false; }
2288 + if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
2289 + if($.inArray(theme_url, themes_loaded) == -1) {
2290 + $.vakata.css.add_sheet({ "url" : theme_url });
2291 + themes_loaded.push(theme_url);
2292 + }
2293 + if(this.data.themes.theme != theme_name) {
2294 + this.get_container().removeClass('jstree-' + this.data.themes.theme);
2295 + this.data.themes.theme = theme_name;
2296 + }
2297 + this.get_container().addClass('jstree-' + theme_name);
2298 + if(!this.data.themes.dots) { this.hide_dots(); }
2299 + else { this.show_dots(); }
2300 + if(!this.data.themes.icons) { this.hide_icons(); }
2301 + else { this.show_icons(); }
2302 + this.__callback();
2303 + },
2304 + get_theme : function () { return this.data.themes.theme; },
2305 +
2306 + show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
2307 + hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
2308 + toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
2309 +
2310 + show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
2311 + hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
2312 + toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
2313 + }
2314 + });
2315 + // autodetect themes path
2316 + $(function () {
2317 + if($.jstree._themes === false) {
2318 + $("script").each(function () {
2319 + if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
2320 + $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
2321 + return false;
2322 + }
2323 + });
2324 + }
2325 + if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
2326 + });
2327 + // include the themes plugin by default
2328 + $.jstree.defaults.plugins.push("themes");
2329 +})(jQuery);
2330 +//*/
2331 +
2332 +/*
2333 + * jsTree hotkeys plugin
2334 + * Enables keyboard navigation for all tree instances
2335 + * Depends on the jstree ui & jquery hotkeys plugins
2336 + */
2337 +(function ($) {
2338 + var bound = [];
2339 + function exec(i, event) {
2340 + var f = $.jstree._focused(), tmp;
2341 + if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
2342 + tmp = f._get_settings().hotkeys[i];
2343 + if(tmp) { return tmp.call(f, event); }
2344 + }
2345 + }
2346 + $.jstree.plugin("hotkeys", {
2347 + __init : function () {
2348 + if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
2349 + if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
2350 + $.each(this._get_settings().hotkeys, function (i, v) {
2351 + if(v !== false && $.inArray(i, bound) == -1) {
2352 + $(document).bind("keydown", i, function (event) { return exec(i, event); });
2353 + bound.push(i);
2354 + }
2355 + });
2356 + this.get_container()
2357 + .bind("lock.jstree", $.proxy(function () {
2358 + if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
2359 + }, this))
2360 + .bind("unlock.jstree", $.proxy(function () {
2361 + if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
2362 + }, this));
2363 + this.enable_hotkeys();
2364 + },
2365 + defaults : {
2366 + "up" : function () {
2367 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2368 + this.hover_node(this._get_prev(o));
2369 + return false;
2370 + },
2371 + "ctrl+up" : function () {
2372 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2373 + this.hover_node(this._get_prev(o));
2374 + return false;
2375 + },
2376 + "shift+up" : function () {
2377 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2378 + this.hover_node(this._get_prev(o));
2379 + return false;
2380 + },
2381 + "down" : function () {
2382 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2383 + this.hover_node(this._get_next(o));
2384 + return false;
2385 + },
2386 + "ctrl+down" : function () {
2387 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2388 + this.hover_node(this._get_next(o));
2389 + return false;
2390 + },
2391 + "shift+down" : function () {
2392 + var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
2393 + this.hover_node(this._get_next(o));
2394 + return false;
2395 + },
2396 + "left" : function () {
2397 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2398 + if(o) {
2399 + if(o.hasClass("jstree-open")) { this.close_node(o); }
2400 + else { this.hover_node(this._get_prev(o)); }
2401 + }
2402 + return false;
2403 + },
2404 + "ctrl+left" : function () {
2405 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2406 + if(o) {
2407 + if(o.hasClass("jstree-open")) { this.close_node(o); }
2408 + else { this.hover_node(this._get_prev(o)); }
2409 + }
2410 + return false;
2411 + },
2412 + "shift+left" : function () {
2413 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2414 + if(o) {
2415 + if(o.hasClass("jstree-open")) { this.close_node(o); }
2416 + else { this.hover_node(this._get_prev(o)); }
2417 + }
2418 + return false;
2419 + },
2420 + "right" : function () {
2421 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2422 + if(o && o.length) {
2423 + if(o.hasClass("jstree-closed")) { this.open_node(o); }
2424 + else { this.hover_node(this._get_next(o)); }
2425 + }
2426 + return false;
2427 + },
2428 + "ctrl+right" : function () {
2429 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2430 + if(o && o.length) {
2431 + if(o.hasClass("jstree-closed")) { this.open_node(o); }
2432 + else { this.hover_node(this._get_next(o)); }
2433 + }
2434 + return false;
2435 + },
2436 + "shift+right" : function () {
2437 + var o = this.data.ui.hovered || this.data.ui.last_selected;
2438 + if(o && o.length) {
2439 + if(o.hasClass("jstree-closed")) { this.open_node(o); }
2440 + else { this.hover_node(this._get_next(o)); }
2441 + }
2442 + return false;
2443 + },
2444 + "space" : function () {
2445 + if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
2446 + return false;
2447 + },
2448 + "ctrl+space" : function (event) {
2449 + event.type = "click";
2450 + if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
2451 + return false;
2452 + },
2453 + "shift+space" : function (event) {
2454 + event.type = "click";
2455 + if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
2456 + return false;
2457 + },
2458 + "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
2459 + "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
2460 + },
2461 + _fn : {
2462 + enable_hotkeys : function () {
2463 + this.data.hotkeys.enabled = true;
2464 + },
2465 + disable_hotkeys : function () {
2466 + this.data.hotkeys.enabled = false;
2467 + }
2468 + }
2469 + });
2470 +})(jQuery);
2471 +//*/
2472 +
2473 +/*
2474 + * jsTree JSON plugin
2475 + * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
2476 + */
2477 +(function ($) {
2478 + $.jstree.plugin("json_data", {
2479 + __init : function() {
2480 + var s = this._get_settings().json_data;
2481 + if(s.progressive_unload) {
2482 + this.get_container().bind("after_close.jstree", function (e, data) {
2483 + data.rslt.obj.children("ul").remove();
2484 + });
2485 + }
2486 + },
2487 + defaults : {
2488 + // `data` can be a function:
2489 + // * accepts two arguments - node being loaded and a callback to pass the result to
2490 + // * will be executed in the current tree's scope & ajax won't be supported
2491 + data : false,
2492 + ajax : false,
2493 + correct_state : true,
2494 + progressive_render : false,
2495 + progressive_unload : false
2496 + },
2497 + _fn : {
2498 + load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
2499 + _is_loaded : function (obj) {
2500 + var s = this._get_settings().json_data;
2501 + obj = this._get_node(obj);
2502 + return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
2503 + },
2504 + refresh : function (obj) {
2505 + obj = this._get_node(obj);
2506 + var s = this._get_settings().json_data;
2507 + if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
2508 + obj.removeData("jstree_children");
2509 + }
2510 + return this.__call_old();
2511 + },
2512 + load_node_json : function (obj, s_call, e_call) {
2513 + var s = this.get_settings().json_data, d,
2514 + error_func = function () {},
2515 + success_func = function () {};
2516 + obj = this._get_node(obj);
2517 +
2518 + if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
2519 + d = this._parse_json(obj.data("jstree_children"), obj);
2520 + if(d) {
2521 + obj.append(d);
2522 + if(!s.progressive_unload) { obj.removeData("jstree_children"); }
2523 + }
2524 + this.clean_node(obj);
2525 + if(s_call) { s_call.call(this); }
2526 + return;
2527 + }
2528 +
2529 + if(obj && obj !== -1) {
2530 + if(obj.data("jstree_is_loading")) { return; }
2531 + else { obj.data("jstree_is_loading",true); }
2532 + }
2533 + switch(!0) {
2534 + case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
2535 + // function option added here for easier model integration (also supporting async - see callback)
2536 + case ($.isFunction(s.data)):
2537 + s.data.call(this, obj, $.proxy(function (d) {
2538 + d = this._parse_json(d, obj);
2539 + if(!d) {
2540 + if(obj === -1 || !obj) {
2541 + if(s.correct_state) { this.get_container().children("ul").empty(); }
2542 + }
2543 + else {
2544 + obj.children("a.jstree-loading").removeClass("jstree-loading");
2545 + obj.removeData("jstree_is_loading");
2546 + if(s.correct_state) { this.correct_state(obj); }
2547 + }
2548 + if(e_call) { e_call.call(this); }
2549 + }
2550 + else {
2551 + if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
2552 + else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
2553 + this.clean_node(obj);
2554 + if(s_call) { s_call.call(this); }
2555 + }
2556 + }, this));
2557 + break;
2558 + case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
2559 + if(!obj || obj == -1) {
2560 + d = this._parse_json(s.data, obj);
2561 + if(d) {
2562 + this.get_container().children("ul").empty().append(d.children());
2563 + this.clean_node();
2564 + }
2565 + else {
2566 + if(s.correct_state) { this.get_container().children("ul").empty(); }
2567 + }
2568 + }
2569 + if(s_call) { s_call.call(this); }
2570 + break;
2571 + case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
2572 + error_func = function (x, t, e) {
2573 + var ef = this.get_settings().json_data.ajax.error;
2574 + if(ef) { ef.call(this, x, t, e); }
2575 + if(obj != -1 && obj.length) {
2576 + obj.children("a.jstree-loading").removeClass("jstree-loading");
2577 + obj.removeData("jstree_is_loading");
2578 + if(t === "success" && s.correct_state) { this.correct_state(obj); }
2579 + }
2580 + else {
2581 + if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
2582 + }
2583 + if(e_call) { e_call.call(this); }
2584 + };
2585 + success_func = function (d, t, x) {
2586 + var sf = this.get_settings().json_data.ajax.success;
2587 + if(sf) { d = sf.call(this,d,t,x) || d; }
2588 + if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
2589 + return error_func.call(this, x, t, "");
2590 + }
2591 + d = this._parse_json(d, obj);
2592 + if(d) {
2593 + if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
2594 + else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
2595 + this.clean_node(obj);
2596 + if(s_call) { s_call.call(this); }
2597 + }
2598 + else {
2599 + if(obj === -1 || !obj) {
2600 + if(s.correct_state) {
2601 + this.get_container().children("ul").empty();
2602 + if(s_call) { s_call.call(this); }
2603 + }
2604 + }
2605 + else {
2606 + obj.children("a.jstree-loading").removeClass("jstree-loading");
2607 + obj.removeData("jstree_is_loading");
2608 + if(s.correct_state) {
2609 + this.correct_state(obj);
2610 + if(s_call) { s_call.call(this); }
2611 + }
2612 + }
2613 + }
2614 + };
2615 + s.ajax.context = this;
2616 + s.ajax.error = error_func;
2617 + s.ajax.success = success_func;
2618 + if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
2619 + if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
2620 + if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
2621 + $.ajax(s.ajax);
2622 + break;
2623 + }
2624 + },
2625 + _parse_json : function (js, obj, is_callback) {
2626 + var d = false,
2627 + p = this._get_settings(),
2628 + s = p.json_data,
2629 + t = p.core.html_titles,
2630 + tmp, i, j, ul1, ul2;
2631 +
2632 + if(!js) { return d; }
2633 + if(s.progressive_unload && obj && obj !== -1) {
2634 + obj.data("jstree_children", d);
2635 + }
2636 + if($.isArray(js)) {
2637 + d = $();
2638 + if(!js.length) { return false; }
2639 + for(i = 0, j = js.length; i < j; i++) {
2640 + tmp = this._parse_json(js[i], obj, true);
2641 + if(tmp.length) { d = d.add(tmp); }
2642 + }
2643 + }
2644 + else {
2645 + if(typeof js == "string") { js = { data : js }; }
2646 + if(!js.data && js.data !== "") { return d; }
2647 + d = $("<li />");
2648 + if(js.attr) { d.attr(js.attr); }
2649 + if(js.metadata) { d.data(js.metadata); }
2650 + if(js.state) { d.addClass("jstree-" + js.state); }
2651 + if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
2652 + $.each(js.data, function (i, m) {
2653 + tmp = $("<a />");
2654 + if($.isFunction(m)) { m = m.call(this, js); }
2655 + if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
2656 + else {
2657 + if(!m.attr) { m.attr = {}; }
2658 + if(!m.attr.href) { m.attr.href = '#'; }
2659 + tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
2660 + if(m.language) { tmp.addClass(m.language); }
2661 + }
2662 + tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
2663 + if(!m.icon && js.icon) { m.icon = js.icon; }
2664 + if(m.icon) {
2665 + if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
2666 + else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
2667 + }
2668 + d.append(tmp);
2669 + });
2670 + d.prepend("<ins class='jstree-icon'>&#160;</ins>");
2671 + if(js.children) {
2672 + if(s.progressive_render && js.state !== "open") {
2673 + d.addClass("jstree-closed").data("jstree_children", js.children);
2674 + }
2675 + else {
2676 + if(s.progressive_unload) { d.data("jstree_children", js.children); }
2677 + if($.isArray(js.children) && js.children.length) {
2678 + tmp = this._parse_json(js.children, obj, true);
2679 + if(tmp.length) {
2680 + ul2 = $("<ul />");
2681 + ul2.append(tmp);
2682 + d.append(ul2);
2683 + }
2684 + }
2685 + }
2686 + }
2687 + }
2688 + if(!is_callback) {
2689 + ul1 = $("<ul />");
2690 + ul1.append(d);
2691 + d = ul1;
2692 + }
2693 + return d;
2694 + },
2695 + get_json : function (obj, li_attr, a_attr, is_callback) {
2696 + var result = [],
2697 + s = this._get_settings(),
2698 + _this = this,
2699 + tmp1, tmp2, li, a, t, lang;
2700 + obj = this._get_node(obj);
2701 + if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
2702 + li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
2703 + if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
2704 + a_attr = $.isArray(a_attr) ? a_attr : [ ];
2705 +
2706 + obj.each(function () {
2707 + li = $(this);
2708 + tmp1 = { data : [] };
2709 + if(li_attr.length) { tmp1.attr = { }; }
2710 + $.each(li_attr, function (i, v) {
2711 + tmp2 = li.attr(v);
2712 + if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
2713 + tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
2714 + }
2715 + });
2716 + if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
2717 + if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
2718 + if(li.data()) { tmp1.metadata = li.data(); }
2719 + a = li.children("a");
2720 + a.each(function () {
2721 + t = $(this);
2722 + if(
2723 + a_attr.length ||
2724 + $.inArray("languages", s.plugins) !== -1 ||
2725 + t.children("ins").get(0).style.backgroundImage.length ||
2726 + (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
2727 + ) {
2728 + lang = false;
2729 + if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
2730 + $.each(s.languages, function (l, lv) {
2731 + if(t.hasClass(lv)) {
2732 + lang = lv;
2733 + return false;
2734 + }
2735 + });
2736 + }
2737 + tmp2 = { attr : { }, title : _this.get_text(t, lang) };
2738 + $.each(a_attr, function (k, z) {
2739 + tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
2740 + });
2741 + if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
2742 + $.each(s.languages, function (k, z) {
2743 + if(t.hasClass(z)) { tmp2.language = z; return true; }
2744 + });
2745 + }
2746 + if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
2747 + tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
2748 + }
2749 + if(t.children("ins").get(0).style.backgroundImage.length) {
2750 + tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
2751 + }
2752 + }
2753 + else {
2754 + tmp2 = _this.get_text(t);
2755 + }
2756 + if(a.length > 1) { tmp1.data.push(tmp2); }
2757 + else { tmp1.data = tmp2; }
2758 + });
2759 + li = li.find("> ul > li");
2760 + if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
2761 + result.push(tmp1);
2762 + });
2763 + return result;
2764 + }
2765 + }
2766 + });
2767 +})(jQuery);
2768 +//*/
2769 +
2770 +/*
2771 + * jsTree languages plugin
2772 + * Adds support for multiple language versions in one tree
2773 + * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
2774 + * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
2775 + */
2776 +(function ($) {
2777 + $.jstree.plugin("languages", {
2778 + __init : function () { this._load_css(); },
2779 + defaults : [],
2780 + _fn : {
2781 + set_lang : function (i) {
2782 + var langs = this._get_settings().languages,
2783 + st = false,
2784 + selector = ".jstree-" + this.get_index() + ' a';
2785 + if(!$.isArray(langs) || langs.length === 0) { return false; }
2786 + if($.inArray(i,langs) == -1) {
2787 + if(!!langs[i]) { i = langs[i]; }
2788 + else { return false; }
2789 + }
2790 + if(i == this.data.languages.current_language) { return true; }
2791 + st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
2792 + if(st !== false) { st.style.display = "none"; }
2793 + st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
2794 + if(st !== false) { st.style.display = ""; }
2795 + this.data.languages.current_language = i;
2796 + this.__callback(i);
2797 + return true;
2798 + },
2799 + get_lang : function () {
2800 + return this.data.languages.current_language;
2801 + },
2802 + _get_string : function (key, lang) {
2803 + var langs = this._get_settings().languages,
2804 + s = this._get_settings().core.strings;
2805 + if($.isArray(langs) && langs.length) {
2806 + lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
2807 + }
2808 + if(s[lang] && s[lang][key]) { return s[lang][key]; }
2809 + if(s[key]) { return s[key]; }
2810 + return key;
2811 + },
2812 + get_text : function (obj, lang) {
2813 + obj = this._get_node(obj) || this.data.ui.last_selected;
2814 + if(!obj.size()) { return false; }
2815 + var langs = this._get_settings().languages,
2816 + s = this._get_settings().core.html_titles;
2817 + if($.isArray(langs) && langs.length) {
2818 + lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
2819 + obj = obj.children("a." + lang);
2820 + }
2821 + else { obj = obj.children("a:eq(0)"); }
2822 + if(s) {
2823 + obj = obj.clone();
2824 + obj.children("INS").remove();
2825 + return obj.html();
2826 + }
2827 + else {
2828 + obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
2829 + return obj.nodeValue;
2830 + }
2831 + },
2832 + set_text : function (obj, val, lang) {
2833 + obj = this._get_node(obj) || this.data.ui.last_selected;
2834 + if(!obj.size()) { return false; }
2835 + var langs = this._get_settings().languages,
2836 + s = this._get_settings().core.html_titles,
2837 + tmp;
2838 + if($.isArray(langs) && langs.length) {
2839 + lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
2840 + obj = obj.children("a." + lang);
2841 + }
2842 + else { obj = obj.children("a:eq(0)"); }
2843 + if(s) {
2844 + tmp = obj.children("INS").clone();
2845 + obj.html(val).prepend(tmp);
2846 + this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
2847 + return true;
2848 + }
2849 + else {
2850 + obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
2851 + this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
2852 + return (obj.nodeValue = val);
2853 + }
2854 + },
2855 + _load_css : function () {
2856 + var langs = this._get_settings().languages,
2857 + str = "/* languages css */",
2858 + selector = ".jstree-" + this.get_index() + ' a',
2859 + ln;
2860 + if($.isArray(langs) && langs.length) {
2861 + this.data.languages.current_language = langs[0];
2862 + for(ln = 0; ln < langs.length; ln++) {
2863 + str += selector + "." + langs[ln] + " {";
2864 + if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
2865 + str += " } ";
2866 + }
2867 + this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
2868 + }
2869 + },
2870 + create_node : function (obj, position, js, callback) {
2871 + var t = this.__call_old(true, obj, position, js, function (t) {
2872 + var langs = this._get_settings().languages,
2873 + a = t.children("a"),
2874 + ln;
2875 + if($.isArray(langs) && langs.length) {
2876 + for(ln = 0; ln < langs.length; ln++) {
2877 + if(!a.is("." + langs[ln])) {
2878 + t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
2879 + }
2880 + }
2881 + a.not("." + langs.join(", .")).remove();
2882 + }
2883 + if(callback) { callback.call(this, t); }
2884 + });
2885 + return t;
2886 + }
2887 + }
2888 + });
2889 +})(jQuery);
2890 +//*/
2891 +
2892 +/*
2893 + * jsTree cookies plugin
2894 + * Stores the currently opened/selected nodes in a cookie and then restores them
2895 + * Depends on the jquery.cookie plugin
2896 + */
2897 +(function ($) {
2898 + $.jstree.plugin("cookies", {
2899 + __init : function () {
2900 + if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
2901 +
2902 + var s = this._get_settings().cookies,
2903 + tmp;
2904 + if(!!s.save_loaded) {
2905 + tmp = $.cookie(s.save_loaded);
2906 + if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
2907 + }
2908 + if(!!s.save_opened) {
2909 + tmp = $.cookie(s.save_opened);
2910 + if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
2911 + }
2912 + if(!!s.save_selected) {
2913 + tmp = $.cookie(s.save_selected);
2914 + if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
2915 + }
2916 + this.get_container()
2917 + .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
2918 + this.get_container()
2919 + .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
2920 + if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
2921 + }, this));
2922 + }, this));
2923 + },
2924 + defaults : {
2925 + save_loaded : "jstree_load",
2926 + save_opened : "jstree_open",
2927 + save_selected : "jstree_select",
2928 + auto_save : true,
2929 + cookie_options : {}
2930 + },
2931 + _fn : {
2932 + save_cookie : function (c) {
2933 + if(this.data.core.refreshing) { return; }
2934 + var s = this._get_settings().cookies;
2935 + if(!c) { // if called manually and not by event
2936 + if(s.save_loaded) {
2937 + this.save_loaded();
2938 + $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
2939 + }
2940 + if(s.save_opened) {
2941 + this.save_opened();
2942 + $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
2943 + }
2944 + if(s.save_selected && this.data.ui) {
2945 + this.save_selected();
2946 + $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
2947 + }
2948 + return;
2949 + }
2950 + switch(c) {
2951 + case "open_node":
2952 + case "close_node":
2953 + if(!!s.save_opened) {
2954 + this.save_opened();
2955 + $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
2956 + }
2957 + if(!!s.save_loaded) {
2958 + this.save_loaded();
2959 + $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
2960 + }
2961 + break;
2962 + case "select_node":
2963 + case "deselect_node":
2964 + if(!!s.save_selected && this.data.ui) {
2965 + this.save_selected();
2966 + $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
2967 + }
2968 + break;
2969 + }
2970 + }
2971 + }
2972 + });
2973 + // include cookies by default
2974 + // $.jstree.defaults.plugins.push("cookies");
2975 +})(jQuery);
2976 +//*/
2977 +
2978 +/*
2979 + * jsTree sort plugin
2980 + * Sorts items alphabetically (or using any other function)
2981 + */
2982 +(function ($) {
2983 + $.jstree.plugin("sort", {
2984 + __init : function () {
2985 + this.get_container()
2986 + .bind("load_node.jstree", $.proxy(function (e, data) {
2987 + var obj = this._get_node(data.rslt.obj);
2988 + obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
2989 + this.sort(obj);
2990 + }, this))
2991 + .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
2992 + this.sort(data.rslt.obj.parent());
2993 + }, this))
2994 + .bind("move_node.jstree", $.proxy(function (e, data) {
2995 + var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
2996 + this.sort(m.children("ul"));
2997 + }, this));
2998 + },
2999 + defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
3000 + _fn : {
3001 + sort : function (obj) {
3002 + var s = this._get_settings().sort,
3003 + t = this;
3004 + obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
3005 + obj.find("> li > ul").each(function() { t.sort($(this)); });
3006 + this.clean_node(obj);
3007 + }
3008 + }
3009 + });
3010 +})(jQuery);
3011 +//*/
3012 +
3013 +/*
3014 + * jsTree DND plugin
3015 + * Drag and drop plugin for moving/copying nodes
3016 + */
3017 +(function ($) {
3018 + var o = false,
3019 + r = false,
3020 + m = false,
3021 + ml = false,
3022 + sli = false,
3023 + sti = false,
3024 + dir1 = false,
3025 + dir2 = false,
3026 + last_pos = false;
3027 + $.vakata.dnd = {
3028 + is_down : false,
3029 + is_drag : false,
3030 + helper : false,
3031 + scroll_spd : 10,
3032 + init_x : 0,
3033 + init_y : 0,
3034 + threshold : 5,
3035 + helper_left : 5,
3036 + helper_top : 10,
3037 + user_data : {},
3038 +
3039 + drag_start : function (e, data, html) {
3040 + if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
3041 + try {
3042 + e.currentTarget.unselectable = "on";
3043 + e.currentTarget.onselectstart = function() { return false; };
3044 + if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
3045 + } catch(err) { }
3046 + $.vakata.dnd.init_x = e.pageX;
3047 + $.vakata.dnd.init_y = e.pageY;
3048 + $.vakata.dnd.user_data = data;
3049 + $.vakata.dnd.is_down = true;
3050 + $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
3051 + $(document).bind("mousemove", $.vakata.dnd.drag);
3052 + $(document).bind("mouseup", $.vakata.dnd.drag_stop);
3053 + return false;
3054 + },
3055 + drag : function (e) {
3056 + if(!$.vakata.dnd.is_down) { return; }
3057 + if(!$.vakata.dnd.is_drag) {
3058 + if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
3059 + $.vakata.dnd.helper.appendTo("body");
3060 + $.vakata.dnd.is_drag = true;
3061 + $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
3062 + }
3063 + else { return; }
3064 + }
3065 +
3066 + // maybe use a scrolling parent element instead of document?
3067 + if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
3068 + var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
3069 + if(e.pageY - t < 20) {
3070 + if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
3071 + if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
3072 + }
3073 + else {
3074 + if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
3075 + }
3076 + if($(window).height() - (e.pageY - t) < 20) {
3077 + if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
3078 + if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
3079 + }
3080 + else {
3081 + if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
3082 + }
3083 +
3084 + if(e.pageX - l < 20) {
3085 + if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
3086 + if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
3087 + }
3088 + else {
3089 + if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
3090 + }
3091 + if($(window).width() - (e.pageX - l) < 20) {
3092 + if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
3093 + if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
3094 + }
3095 + else {
3096 + if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
3097 + }
3098 + }
3099 +
3100 + $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
3101 + $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
3102 + },
3103 + drag_stop : function (e) {
3104 + if(sli) { clearInterval(sli); }
3105 + if(sti) { clearInterval(sti); }
3106 + $(document).unbind("mousemove", $.vakata.dnd.drag);
3107 + $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
3108 + $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
3109 + $.vakata.dnd.helper.remove();
3110 + $.vakata.dnd.init_x = 0;
3111 + $.vakata.dnd.init_y = 0;
3112 + $.vakata.dnd.user_data = {};
3113 + $.vakata.dnd.is_down = false;
3114 + $.vakata.dnd.is_drag = false;
3115 + }
3116 + };
3117 + $(function() {
3118 + var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
3119 + $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
3120 + });
3121 +
3122 + $.jstree.plugin("dnd", {
3123 + __init : function () {
3124 + this.data.dnd = {
3125 + active : false,
3126 + after : false,
3127 + inside : false,
3128 + before : false,
3129 + off : false,
3130 + prepared : false,
3131 + w : 0,
3132 + to1 : false,
3133 + to2 : false,
3134 + cof : false,
3135 + cw : false,
3136 + ch : false,
3137 + i1 : false,
3138 + i2 : false,
3139 + mto : false
3140 + };
3141 + this.get_container()
3142 + .bind("mouseenter.jstree", $.proxy(function (e) {
3143 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3144 + if(this.data.themes) {
3145 + m.attr("class", "jstree-" + this.data.themes.theme);
3146 + if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
3147 + $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
3148 + }
3149 + //if($(e.currentTarget).find("> ul > li").length === 0) {
3150 + if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
3151 + var tr = $.jstree._reference(e.target), dc;
3152 + if(tr.data.dnd.foreign) {
3153 + dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
3154 + if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
3155 + $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
3156 + }
3157 + }
3158 + else {
3159 + tr.prepare_move(o, tr.get_container(), "last");
3160 + if(tr.check_move()) {
3161 + $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
3162 + }
3163 + }
3164 + }
3165 + }
3166 + }, this))
3167 + .bind("mouseup.jstree", $.proxy(function (e) {
3168 + //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
3169 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
3170 + var tr = $.jstree._reference(e.currentTarget), dc;
3171 + if(tr.data.dnd.foreign) {
3172 + dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
3173 + if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
3174 + tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
3175 + }
3176 + }
3177 + else {
3178 + tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
3179 + }
3180 + }
3181 + }, this))
3182 + .bind("mouseleave.jstree", $.proxy(function (e) {
3183 + if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
3184 + return false;
3185 + }
3186 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3187 + if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
3188 + if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
3189 + if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
3190 + if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
3191 + if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
3192 + $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
3193 + }
3194 + }
3195 + }, this))
3196 + .bind("mousemove.jstree", $.proxy(function (e) {
3197 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3198 + var cnt = this.get_container()[0];
3199 +
3200 + // Horizontal scroll
3201 + if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
3202 + if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
3203 + this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
3204 + }
3205 + else if(e.pageX - 24 < this.data.dnd.cof.left) {
3206 + if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
3207 + this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
3208 + }
3209 + else {
3210 + if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
3211 + }
3212 +
3213 + // Vertical scroll
3214 + if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
3215 + if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
3216 + this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
3217 + }
3218 + else if(e.pageY - 24 < this.data.dnd.cof.top) {
3219 + if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
3220 + this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
3221 + }
3222 + else {
3223 + if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
3224 + }
3225 +
3226 + }
3227 + }, this))
3228 + .bind("scroll.jstree", $.proxy(function (e) {
3229 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
3230 + m.hide();
3231 + ml.hide();
3232 + }
3233 + }, this))
3234 + .delegate("a", "mousedown.jstree", $.proxy(function (e) {
3235 + if(e.which === 1) {
3236 + this.start_drag(e.currentTarget, e);
3237 + return false;
3238 + }
3239 + }, this))
3240 + .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
3241 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3242 + this.dnd_enter(e.currentTarget);
3243 + }
3244 + }, this))
3245 + .delegate("a", "mousemove.jstree", $.proxy(function (e) {
3246 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3247 + if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
3248 + this.dnd_enter(e.currentTarget);
3249 + }
3250 + if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
3251 + this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
3252 + if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
3253 + this.dnd_show();
3254 + }
3255 + }, this))
3256 + .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
3257 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3258 + if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
3259 + return false;
3260 + }
3261 + if(m) { m.hide(); }
3262 + if(ml) { ml.hide(); }
3263 + /*
3264 + var ec = $(e.currentTarget).closest("li"),
3265 + er = $(e.relatedTarget).closest("li");
3266 + if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
3267 + if(m) { m.hide(); }
3268 + if(ml) { ml.hide(); }
3269 + }
3270 + */
3271 + this.data.dnd.mto = setTimeout(
3272 + (function (t) { return function () { t.dnd_leave(e); }; })(this),
3273 + 0);
3274 + }
3275 + }, this))
3276 + .delegate("a", "mouseup.jstree", $.proxy(function (e) {
3277 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
3278 + this.dnd_finish(e);
3279 + }
3280 + }, this));
3281 +
3282 + $(document)
3283 + .bind("drag_stop.vakata", $.proxy(function () {
3284 + if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
3285 + if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
3286 + if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
3287 + if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
3288 + this.data.dnd.after = false;
3289 + this.data.dnd.before = false;
3290 + this.data.dnd.inside = false;
3291 + this.data.dnd.off = false;
3292 + this.data.dnd.prepared = false;
3293 + this.data.dnd.w = false;
3294 + this.data.dnd.to1 = false;
3295 + this.data.dnd.to2 = false;
3296 + this.data.dnd.i1 = false;
3297 + this.data.dnd.i2 = false;
3298 + this.data.dnd.active = false;
3299 + this.data.dnd.foreign = false;
3300 + if(m) { m.css({ "top" : "-2000px" }); }
3301 + if(ml) { ml.css({ "top" : "-2000px" }); }
3302 + }, this))
3303 + .bind("drag_start.vakata", $.proxy(function (e, data) {
3304 + if(data.data.jstree) {
3305 + var et = $(data.event.target);
3306 + if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
3307 + this.dnd_enter(et);
3308 + }
3309 + }
3310 + }, this));
3311 + /*
3312 + .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
3313 + if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
3314 + var h = $.vakata.dnd.helper.children("ins");
3315 + if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
3316 + h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
3317 + }
3318 + else {
3319 + h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
3320 + }
3321 + }
3322 + }, this)); */
3323 +
3324 +
3325 +
3326 + var s = this._get_settings().dnd;
3327 + if(s.drag_target) {
3328 + $(document)
3329 + .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
3330 + o = e.target;
3331 + $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
3332 + if(this.data.themes) {
3333 + if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
3334 + if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
3335 + $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
3336 + }
3337 + $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
3338 + var cnt = this.get_container();
3339 + this.data.dnd.cof = cnt.offset();
3340 + this.data.dnd.cw = parseInt(cnt.width(),10);
3341 + this.data.dnd.ch = parseInt(cnt.height(),10);
3342 + this.data.dnd.foreign = true;
3343 + e.preventDefault();
3344 + }, this));
3345 + }
3346 + if(s.drop_target) {
3347 + $(document)
3348 + .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
3349 + if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
3350 + $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
3351 + }
3352 + }, this))
3353 + .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
3354 + if(this.data.dnd.active) {
3355 + $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
3356 + }
3357 + }, this))
3358 + .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
3359 + if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
3360 + this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
3361 + }
3362 + }, this));
3363 + }
3364 + },
3365 + defaults : {
3366 + copy_modifier : "ctrl",
3367 + check_timeout : 100,
3368 + open_timeout : 500,
3369 + drop_target : ".jstree-drop",
3370 + drop_check : function (data) { return true; },
3371 + drop_finish : $.noop,
3372 + drag_target : ".jstree-draggable",
3373 + drag_finish : $.noop,
3374 + drag_check : function (data) { return { after : false, before : false, inside : true }; }
3375 + },
3376 + _fn : {
3377 + dnd_prepare : function () {
3378 + if(!r || !r.length) { return; }
3379 + this.data.dnd.off = r.offset();
3380 + if(this._get_settings().core.rtl) {
3381 + this.data.dnd.off.right = this.data.dnd.off.left + r.width();
3382 + }
3383 + if(this.data.dnd.foreign) {
3384 + var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
3385 + this.data.dnd.after = a.after;
3386 + this.data.dnd.before = a.before;
3387 + this.data.dnd.inside = a.inside;
3388 + this.data.dnd.prepared = true;
3389 + return this.dnd_show();
3390 + }
3391 + this.prepare_move(o, r, "before");
3392 + this.data.dnd.before = this.check_move();
3393 + this.prepare_move(o, r, "after");
3394 + this.data.dnd.after = this.check_move();
3395 + if(this._is_loaded(r)) {
3396 + this.prepare_move(o, r, "inside");
3397 + this.data.dnd.inside = this.check_move();
3398 + }
3399 + else {
3400 + this.data.dnd.inside = false;
3401 + }
3402 + this.data.dnd.prepared = true;
3403 + return this.dnd_show();
3404 + },
3405 + dnd_show : function () {
3406 + if(!this.data.dnd.prepared) { return; }
3407 + var o = ["before","inside","after"],
3408 + r = false,
3409 + rtl = this._get_settings().core.rtl,
3410 + pos;
3411 + if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
3412 + else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
3413 + o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
3414 + }
3415 + else { o = ["after","inside","before"]; }
3416 + $.each(o, $.proxy(function (i, val) {
3417 + if(this.data.dnd[val]) {
3418 + $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
3419 + r = val;
3420 + return false;
3421 + }
3422 + }, this));
3423 + if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
3424 +
3425 + pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
3426 + switch(r) {
3427 + case "before":
3428 + m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
3429 + if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
3430 + break;
3431 + case "after":
3432 + m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
3433 + if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
3434 + break;
3435 + case "inside":
3436 + m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
3437 + if(ml) { ml.hide(); }
3438 + break;
3439 + default:
3440 + m.hide();
3441 + if(ml) { ml.hide(); }
3442 + break;
3443 + }
3444 + last_pos = r;
3445 + return r;
3446 + },
3447 + dnd_open : function () {
3448 + this.data.dnd.to2 = false;
3449 + this.open_node(r, $.proxy(this.dnd_prepare,this), true);
3450 + },
3451 + dnd_finish : function (e) {
3452 + if(this.data.dnd.foreign) {
3453 + if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
3454 + this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
3455 + }
3456 + }
3457 + else {
3458 + this.dnd_prepare();
3459 + this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
3460 + }
3461 + o = false;
3462 + r = false;
3463 + m.hide();
3464 + if(ml) { ml.hide(); }
3465 + },
3466 + dnd_enter : function (obj) {
3467 + if(this.data.dnd.mto) {
3468 + clearTimeout(this.data.dnd.mto);
3469 + this.data.dnd.mto = false;
3470 + }
3471 + var s = this._get_settings().dnd;
3472 + this.data.dnd.prepared = false;
3473 + r = this._get_node(obj);
3474 + if(s.check_timeout) {
3475 + // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
3476 + if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
3477 + this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
3478 + }
3479 + else {
3480 + this.dnd_prepare();
3481 + }
3482 + if(s.open_timeout) {
3483 + if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
3484 + if(r && r.length && r.hasClass("jstree-closed")) {
3485 + // if the node is closed - open it, then recalculate
3486 + this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
3487 + }
3488 + }
3489 + else {
3490 + if(r && r.length && r.hasClass("jstree-closed")) {
3491 + this.dnd_open();
3492 + }
3493 + }
3494 + },
3495 + dnd_leave : function (e) {
3496 + this.data.dnd.after = false;
3497 + this.data.dnd.before = false;
3498 + this.data.dnd.inside = false;
3499 + $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
3500 + m.hide();
3501 + if(ml) { ml.hide(); }
3502 + if(r && r[0] === e.target.parentNode) {
3503 + if(this.data.dnd.to1) {
3504 + clearTimeout(this.data.dnd.to1);
3505 + this.data.dnd.to1 = false;
3506 + }
3507 + if(this.data.dnd.to2) {
3508 + clearTimeout(this.data.dnd.to2);
3509 + this.data.dnd.to2 = false;
3510 + }
3511 + }
3512 + },
3513 + start_drag : function (obj, e) {
3514 + o = this._get_node(obj);
3515 + if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
3516 + var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
3517 + cnt = this.get_container();
3518 + if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"); }
3519 + $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
3520 + if(this.data.themes) {
3521 + if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
3522 + if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
3523 + $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
3524 + }
3525 + this.data.dnd.cof = cnt.offset();
3526 + this.data.dnd.cw = parseInt(cnt.width(),10);
3527 + this.data.dnd.ch = parseInt(cnt.height(),10);
3528 + this.data.dnd.active = true;
3529 + }
3530 + }
3531 + });
3532 + $(function() {
3533 + var css_string = '' +
3534 + '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
3535 + ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
3536 + '} ' +
3537 + '#vakata-dragged .jstree-ok { background:green; } ' +
3538 + '#vakata-dragged .jstree-invalid { background:red; } ' +
3539 + '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
3540 + '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
3541 + ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
3542 + ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
3543 + '}' +
3544 + '';
3545 + $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
3546 + m = $("<div />").attr({ id : "jstree-marker" }).hide().html("&raquo;")
3547 + .bind("mouseleave mouseenter", function (e) {
3548 + m.hide();
3549 + ml.hide();
3550 + e.preventDefault();
3551 + e.stopImmediatePropagation();
3552 + return false;
3553 + })
3554 + .appendTo("body");
3555 + ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
3556 + .bind("mouseup", function (e) {
3557 + if(r && r.length) {
3558 + r.children("a").trigger(e);
3559 + e.preventDefault();
3560 + e.stopImmediatePropagation();
3561 + return false;
3562 + }
3563 + })
3564 + .bind("mouseleave", function (e) {
3565 + var rt = $(e.relatedTarget);
3566 + if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
3567 + if(r && r.length) {
3568 + r.children("a").trigger(e);
3569 + m.hide();
3570 + ml.hide();
3571 + e.preventDefault();
3572 + e.stopImmediatePropagation();
3573 + return false;
3574 + }
3575 + }
3576 + })
3577 + .appendTo("body");
3578 + $(document).bind("drag_start.vakata", function (e, data) {
3579 + if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
3580 + });
3581 + $(document).bind("drag_stop.vakata", function (e, data) {
3582 + if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
3583 + });
3584 + });
3585 +})(jQuery);
3586 +//*/
3587 +
3588 +/*
3589 + * jsTree checkbox plugin
3590 + * Inserts checkboxes in front of every node
3591 + * Depends on the ui plugin
3592 + * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
3593 + */
3594 +(function ($) {
3595 + $.jstree.plugin("checkbox", {
3596 + __init : function () {
3597 + this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
3598 + if(this.data.ui && this.data.checkbox.noui) {
3599 + this.select_node = this.deselect_node = this.deselect_all = $.noop;
3600 + this.get_selected = this.get_checked;
3601 + }
3602 +
3603 + this.get_container()
3604 + .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
3605 + this._prepare_checkboxes(data.rslt.obj);
3606 + }, this))
3607 + .bind("loaded.jstree", $.proxy(function (e) {
3608 + this._prepare_checkboxes();
3609 + }, this))
3610 + .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
3611 + e.preventDefault();
3612 + if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
3613 + else { this.check_node(e.target); }
3614 + if(this.data.ui && this.data.checkbox.noui) {
3615 + this.save_selected();
3616 + if(this.data.cookies) { this.save_cookie("select_node"); }
3617 + }
3618 + else {
3619 + e.stopImmediatePropagation();
3620 + return false;
3621 + }
3622 + }, this));
3623 + },
3624 + defaults : {
3625 + override_ui : false,
3626 + two_state : false,
3627 + real_checkboxes : false,
3628 + checked_parent_open : true,
3629 + real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
3630 + },
3631 + __destroy : function () {
3632 + this.get_container()
3633 + .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
3634 + .find("ins.jstree-checkbox").remove();
3635 + },
3636 + _fn : {
3637 + _checkbox_notify : function (n, data) {
3638 + if(data.checked) {
3639 + this.check_node(n, false);
3640 + }
3641 + },
3642 + _prepare_checkboxes : function (obj) {
3643 + obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
3644 + if(obj === false) { return; } // added for removing root nodes
3645 + var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
3646 + obj.each(function () {
3647 + t = $(this);
3648 + c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
3649 + t.find("li").andSelf().each(function () {
3650 + var $t = $(this), nm;
3651 + $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
3652 + if(rc) {
3653 + if(!$t.children(":checkbox").length) {
3654 + nm = rcn.call(_this, $t);
3655 + $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
3656 + }
3657 + else {
3658 + $t.children(":checkbox").addClass("jstree-real-checkbox");
3659 + }
3660 + }
3661 + if(!ts) {
3662 + if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
3663 + $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
3664 + }
3665 + }
3666 + else {
3667 + if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
3668 + $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
3669 + }
3670 + }
3671 + });
3672 + });
3673 + if(!ts) {
3674 + obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
3675 + }
3676 + },
3677 + change_state : function (obj, state) {
3678 + obj = this._get_node(obj);
3679 + var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
3680 + if(!obj || obj === -1) { return false; }
3681 + state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
3682 + if(this._get_settings().checkbox.two_state) {
3683 + if(state) {
3684 + obj.removeClass("jstree-checked").addClass("jstree-unchecked");
3685 + if(rc) { obj.children(":checkbox").prop("checked", false); }
3686 + }
3687 + else {
3688 + obj.removeClass("jstree-unchecked").addClass("jstree-checked");
3689 + if(rc) { obj.children(":checkbox").prop("checked", true); }
3690 + }
3691 + }
3692 + else {
3693 + if(state) {
3694 + coll = obj.find("li").andSelf();
3695 + if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
3696 + coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
3697 + if(rc) { coll.children(":checkbox").prop("checked", false); }
3698 + }
3699 + else {
3700 + coll = obj.find("li").andSelf();
3701 + if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
3702 + coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
3703 + if(rc) { coll.children(":checkbox").prop("checked", true); }
3704 + if(this.data.ui) { this.data.ui.last_selected = obj; }
3705 + this.data.checkbox.last_selected = obj;
3706 + }
3707 + obj.parentsUntil(".jstree", "li").each(function () {
3708 + var $this = $(this);
3709 + if(state) {
3710 + if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
3711 + $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
3712 + if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
3713 + return false;
3714 + }
3715 + else {
3716 + $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
3717 + if(rc) { $this.children(":checkbox").prop("checked", false); }
3718 + }
3719 + }
3720 + else {
3721 + if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
3722 + $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
3723 + if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
3724 + return false;
3725 + }
3726 + else {
3727 + $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
3728 + if(rc) { $this.children(":checkbox").prop("checked", true); }
3729 + }
3730 + }
3731 + });
3732 + }
3733 + if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
3734 + this.__callback(obj);
3735 + return true;
3736 + },
3737 + check_node : function (obj) {
3738 + if(this.change_state(obj, false)) {
3739 + obj = this._get_node(obj);
3740 + if(this._get_settings().checkbox.checked_parent_open) {
3741 + var t = this;
3742 + obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
3743 + }
3744 + this.__callback({ "obj" : obj });
3745 + }
3746 + },
3747 + uncheck_node : function (obj) {
3748 + if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
3749 + },
3750 + check_all : function () {
3751 + var _this = this,
3752 + coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
3753 + coll.each(function () {
3754 + _this.change_state(this, false);
3755 + });
3756 + this.__callback();
3757 + },
3758 + uncheck_all : function () {
3759 + var _this = this,
3760 + coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
3761 + coll.each(function () {
3762 + _this.change_state(this, true);
3763 + });
3764 + this.__callback();
3765 + },
3766 +
3767 + is_checked : function(obj) {
3768 + obj = this._get_node(obj);
3769 + return obj.length ? obj.is(".jstree-checked") : false;
3770 + },
3771 + get_checked : function (obj, get_all) {
3772 + obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
3773 + return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
3774 + },
3775 + get_unchecked : function (obj, get_all) {
3776 + obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
3777 + return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
3778 + },
3779 +
3780 + show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
3781 + hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
3782 +
3783 + _repair_state : function (obj) {
3784 + obj = this._get_node(obj);
3785 + if(!obj.length) { return; }
3786 + if(this._get_settings().checkbox.two_state) {
3787 + obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
3788 + return;
3789 + }
3790 + var rc = this._get_settings().checkbox.real_checkboxes,
3791 + a = obj.find("> ul > .jstree-checked").length,
3792 + b = obj.find("> ul > .jstree-undetermined").length,
3793 + c = obj.find("> ul > li").length;
3794 + if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
3795 + else if(a === 0 && b === 0) { this.change_state(obj, true); }
3796 + else if(a === c) { this.change_state(obj, false); }
3797 + else {
3798 + obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
3799 + if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
3800 + }
3801 + },
3802 + reselect : function () {
3803 + if(this.data.ui && this.data.checkbox.noui) {
3804 + var _this = this,
3805 + s = this.data.ui.to_select;
3806 + s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
3807 + this.deselect_all();
3808 + $.each(s, function (i, val) { _this.check_node(val); });
3809 + this.__callback();
3810 + }
3811 + else {
3812 + this.__call_old();
3813 + }
3814 + },
3815 + save_loaded : function () {
3816 + var _this = this;
3817 + this.data.core.to_load = [];
3818 + this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
3819 + if(this.id) { _this.data.core.to_load.push("#" + this.id); }
3820 + });
3821 + }
3822 + }
3823 + });
3824 + $(function() {
3825 + var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
3826 + $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
3827 + });
3828 +})(jQuery);
3829 +//*/
3830 +
3831 +/*
3832 + * jsTree XML plugin
3833 + * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
3834 + */
3835 +(function ($) {
3836 + $.vakata.xslt = function (xml, xsl, callback) {
3837 + var rs = "", xm, xs, processor, support;
3838 + // TODO: IE9 no XSLTProcessor, no document.recalc
3839 + if(document.recalc) {
3840 + xm = document.createElement('xml');
3841 + xs = document.createElement('xml');
3842 + xm.innerHTML = xml;
3843 + xs.innerHTML = xsl;
3844 + $("body").append(xm).append(xs);
3845 + setTimeout( (function (xm, xs, callback) {
3846 + return function () {
3847 + callback.call(null, xm.transformNode(xs.XMLDocument));
3848 + setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
3849 + };
3850 + })(xm, xs, callback), 100);
3851 + return true;
3852 + }
3853 + if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
3854 + xml = new DOMParser().parseFromString(xml, "text/xml");
3855 + xsl = new DOMParser().parseFromString(xsl, "text/xml");
3856 + // alert(xml.transformNode());
3857 + // callback.call(null, new XMLSerializer().serializeToString(rs));
3858 +
3859 + }
3860 + if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
3861 + processor = new XSLTProcessor();
3862 + support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
3863 + if(!support) { return false; }
3864 + xml = new DOMParser().parseFromString(xml, "text/xml");
3865 + xsl = new DOMParser().parseFromString(xsl, "text/xml");
3866 + if($.isFunction(processor.transformDocument)) {
3867 + rs = document.implementation.createDocument("", "", null);
3868 + processor.transformDocument(xml, xsl, rs, null);
3869 + callback.call(null, new XMLSerializer().serializeToString(rs));
3870 + return true;
3871 + }
3872 + else {
3873 + processor.importStylesheet(xsl);
3874 + rs = processor.transformToFragment(xml, document);
3875 + callback.call(null, $("<div />").append(rs).html());
3876 + return true;
3877 + }
3878 + }
3879 + return false;
3880 + };
3881 + var xsl = {
3882 + 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
3883 + '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
3884 + '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
3885 + '<xsl:template match="/">' +
3886 + ' <xsl:call-template name="nodes">' +
3887 + ' <xsl:with-param name="node" select="/root" />' +
3888 + ' </xsl:call-template>' +
3889 + '</xsl:template>' +
3890 + '<xsl:template name="nodes">' +
3891 + ' <xsl:param name="node" />' +
3892 + ' <ul>' +
3893 + ' <xsl:for-each select="$node/item">' +
3894 + ' <xsl:variable name="children" select="count(./item) &gt; 0" />' +
3895 + ' <li>' +
3896 + ' <xsl:attribute name="class">' +
3897 + ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
3898 + ' <xsl:choose>' +
3899 + ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
3900 + ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
3901 + ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
3902 + ' </xsl:choose>' +
3903 + ' <xsl:value-of select="@class" />' +
3904 + ' </xsl:attribute>' +
3905 + ' <xsl:for-each select="@*">' +
3906 + ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
3907 + ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
3908 + ' </xsl:if>' +
3909 + ' </xsl:for-each>' +
3910 + ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
3911 + ' <xsl:for-each select="content/name">' +
3912 + ' <a>' +
3913 + ' <xsl:attribute name="href">' +
3914 + ' <xsl:choose>' +
3915 + ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
3916 + ' <xsl:otherwise>#</xsl:otherwise>' +
3917 + ' </xsl:choose>' +
3918 + ' </xsl:attribute>' +
3919 + ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
3920 + ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
3921 + ' <xsl:for-each select="@*">' +
3922 + ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
3923 + ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
3924 + ' </xsl:if>' +
3925 + ' </xsl:for-each>' +
3926 + ' <ins>' +
3927 + ' <xsl:attribute name="class">jstree-icon ' +
3928 + ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
3929 + ' </xsl:attribute>' +
3930 + ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
3931 + ' <xsl:text>&#xa0;</xsl:text>' +
3932 + ' </ins>' +
3933 + ' <xsl:copy-of select="./child::node()" />' +
3934 + ' </a>' +
3935 + ' </xsl:for-each>' +
3936 + ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
3937 + ' </li>' +
3938 + ' </xsl:for-each>' +
3939 + ' </ul>' +
3940 + '</xsl:template>' +
3941 + '</xsl:stylesheet>',
3942 +
3943 + 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
3944 + '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
3945 + '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
3946 + '<xsl:template match="/">' +
3947 + ' <ul>' +
3948 + ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
3949 + ' <xsl:call-template name="nodes">' +
3950 + ' <xsl:with-param name="node" select="." />' +
3951 + ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
3952 + ' </xsl:call-template>' +
3953 + ' </xsl:for-each>' +
3954 + ' </ul>' +
3955 + '</xsl:template>' +
3956 + '<xsl:template name="nodes">' +
3957 + ' <xsl:param name="node" />' +
3958 + ' <xsl:param name="is_last" />' +
3959 + ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' +
3960 + ' <li>' +
3961 + ' <xsl:attribute name="class">' +
3962 + ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
3963 + ' <xsl:choose>' +
3964 + ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
3965 + ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
3966 + ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
3967 + ' </xsl:choose>' +
3968 + ' <xsl:value-of select="@class" />' +
3969 + ' </xsl:attribute>' +
3970 + ' <xsl:for-each select="@*">' +
3971 + ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
3972 + ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
3973 + ' </xsl:if>' +
3974 + ' </xsl:for-each>' +
3975 + ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
3976 + ' <xsl:for-each select="content/name">' +
3977 + ' <a>' +
3978 + ' <xsl:attribute name="href">' +
3979 + ' <xsl:choose>' +
3980 + ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
3981 + ' <xsl:otherwise>#</xsl:otherwise>' +
3982 + ' </xsl:choose>' +
3983 + ' </xsl:attribute>' +
3984 + ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
3985 + ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
3986 + ' <xsl:for-each select="@*">' +
3987 + ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
3988 + ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
3989 + ' </xsl:if>' +
3990 + ' </xsl:for-each>' +
3991 + ' <ins>' +
3992 + ' <xsl:attribute name="class">jstree-icon ' +
3993 + ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
3994 + ' </xsl:attribute>' +
3995 + ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
3996 + ' <xsl:text>&#xa0;</xsl:text>' +
3997 + ' </ins>' +
3998 + ' <xsl:copy-of select="./child::node()" />' +
3999 + ' </a>' +
4000 + ' </xsl:for-each>' +
4001 + ' <xsl:if test="$children">' +
4002 + ' <ul>' +
4003 + ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
4004 + ' <xsl:call-template name="nodes">' +
4005 + ' <xsl:with-param name="node" select="." />' +
4006 + ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
4007 + ' </xsl:call-template>' +
4008 + ' </xsl:for-each>' +
4009 + ' </ul>' +
4010 + ' </xsl:if>' +
4011 + ' </li>' +
4012 + '</xsl:template>' +
4013 + '</xsl:stylesheet>'
4014 + },
4015 + escape_xml = function(string) {
4016 + return string
4017 + .toString()
4018 + .replace(/&/g, '&amp;')
4019 + .replace(/</g, '&lt;')
4020 + .replace(/>/g, '&gt;')
4021 + .replace(/"/g, '&quot;')
4022 + .replace(/'/g, '&apos;');
4023 + };
4024 + $.jstree.plugin("xml_data", {
4025 + defaults : {
4026 + data : false,
4027 + ajax : false,
4028 + xsl : "flat",
4029 + clean_node : false,
4030 + correct_state : true,
4031 + get_skip_empty : false,
4032 + get_include_preamble : true
4033 + },
4034 + _fn : {
4035 + load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
4036 + _is_loaded : function (obj) {
4037 + var s = this._get_settings().xml_data;
4038 + obj = this._get_node(obj);
4039 + return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
4040 + },
4041 + load_node_xml : function (obj, s_call, e_call) {
4042 + var s = this.get_settings().xml_data,
4043 + error_func = function () {},
4044 + success_func = function () {};
4045 +
4046 + obj = this._get_node(obj);
4047 + if(obj && obj !== -1) {
4048 + if(obj.data("jstree_is_loading")) { return; }
4049 + else { obj.data("jstree_is_loading",true); }
4050 + }
4051 + switch(!0) {
4052 + case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
4053 + case ($.isFunction(s.data)):
4054 + s.data.call(this, obj, $.proxy(function (d) {
4055 + this.parse_xml(d, $.proxy(function (d) {
4056 + if(d) {
4057 + d = d.replace(/ ?xmlns="[^"]*"/ig, "");
4058 + if(d.length > 10) {
4059 + d = $(d);
4060 + if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
4061 + else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
4062 + if(s.clean_node) { this.clean_node(obj); }
4063 + if(s_call) { s_call.call(this); }
4064 + }
4065 + else {
4066 + if(obj && obj !== -1) {
4067 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4068 + obj.removeData("jstree_is_loading");
4069 + if(s.correct_state) {
4070 + this.correct_state(obj);
4071 + if(s_call) { s_call.call(this); }
4072 + }
4073 + }
4074 + else {
4075 + if(s.correct_state) {
4076 + this.get_container().children("ul").empty();
4077 + if(s_call) { s_call.call(this); }
4078 + }
4079 + }
4080 + }
4081 + }
4082 + }, this));
4083 + }, this));
4084 + break;
4085 + case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
4086 + if(!obj || obj == -1) {
4087 + this.parse_xml(s.data, $.proxy(function (d) {
4088 + if(d) {
4089 + d = d.replace(/ ?xmlns="[^"]*"/ig, "");
4090 + if(d.length > 10) {
4091 + d = $(d);
4092 + this.get_container().children("ul").empty().append(d.children());
4093 + if(s.clean_node) { this.clean_node(obj); }
4094 + if(s_call) { s_call.call(this); }
4095 + }
4096 + }
4097 + else {
4098 + if(s.correct_state) {
4099 + this.get_container().children("ul").empty();
4100 + if(s_call) { s_call.call(this); }
4101 + }
4102 + }
4103 + }, this));
4104 + }
4105 + break;
4106 + case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
4107 + error_func = function (x, t, e) {
4108 + var ef = this.get_settings().xml_data.ajax.error;
4109 + if(ef) { ef.call(this, x, t, e); }
4110 + if(obj !== -1 && obj.length) {
4111 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4112 + obj.removeData("jstree_is_loading");
4113 + if(t === "success" && s.correct_state) { this.correct_state(obj); }
4114 + }
4115 + else {
4116 + if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
4117 + }
4118 + if(e_call) { e_call.call(this); }
4119 + };
4120 + success_func = function (d, t, x) {
4121 + d = x.responseText;
4122 + var sf = this.get_settings().xml_data.ajax.success;
4123 + if(sf) { d = sf.call(this,d,t,x) || d; }
4124 + if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
4125 + return error_func.call(this, x, t, "");
4126 + }
4127 + this.parse_xml(d, $.proxy(function (d) {
4128 + if(d) {
4129 + d = d.replace(/ ?xmlns="[^"]*"/ig, "");
4130 + if(d.length > 10) {
4131 + d = $(d);
4132 + if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
4133 + else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
4134 + if(s.clean_node) { this.clean_node(obj); }
4135 + if(s_call) { s_call.call(this); }
4136 + }
4137 + else {
4138 + if(obj && obj !== -1) {
4139 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4140 + obj.removeData("jstree_is_loading");
4141 + if(s.correct_state) {
4142 + this.correct_state(obj);
4143 + if(s_call) { s_call.call(this); }
4144 + }
4145 + }
4146 + else {
4147 + if(s.correct_state) {
4148 + this.get_container().children("ul").empty();
4149 + if(s_call) { s_call.call(this); }
4150 + }
4151 + }
4152 + }
4153 + }
4154 + }, this));
4155 + };
4156 + s.ajax.context = this;
4157 + s.ajax.error = error_func;
4158 + s.ajax.success = success_func;
4159 + if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
4160 + if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
4161 + if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
4162 + $.ajax(s.ajax);
4163 + break;
4164 + }
4165 + },
4166 + parse_xml : function (xml, callback) {
4167 + var s = this._get_settings().xml_data;
4168 + $.vakata.xslt(xml, xsl[s.xsl], callback);
4169 + },
4170 + get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
4171 + var result = "",
4172 + s = this._get_settings(),
4173 + _this = this,
4174 + tmp1, tmp2, li, a, lang;
4175 + if(!tp) { tp = "flat"; }
4176 + if(!is_callback) { is_callback = 0; }
4177 + obj = this._get_node(obj);
4178 + if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
4179 + li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
4180 + if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
4181 +
4182 + a_attr = $.isArray(a_attr) ? a_attr : [ ];
4183 +
4184 + if(!is_callback) {
4185 + if(s.xml_data.get_include_preamble) {
4186 + result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
4187 + }
4188 + result += "<root>";
4189 + }
4190 + obj.each(function () {
4191 + result += "<item";
4192 + li = $(this);
4193 + $.each(li_attr, function (i, v) {
4194 + var t = li.attr(v);
4195 + if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
4196 + result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
4197 + }
4198 + });
4199 + if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
4200 + if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
4201 + if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
4202 + result += ">";
4203 + result += "<content>";
4204 + a = li.children("a");
4205 + a.each(function () {
4206 + tmp1 = $(this);
4207 + lang = false;
4208 + result += "<name";
4209 + if($.inArray("languages", s.plugins) !== -1) {
4210 + $.each(s.languages, function (k, z) {
4211 + if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
4212 + });
4213 + }
4214 + if(a_attr.length) {
4215 + $.each(a_attr, function (k, z) {
4216 + var t = tmp1.attr(z);
4217 + if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
4218 + result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
4219 + }
4220 + });
4221 + }
4222 + if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
4223 + result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
4224 + }
4225 + if(tmp1.children("ins").get(0).style.backgroundImage.length) {
4226 + result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
4227 + }
4228 + result += ">";
4229 + result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
4230 + result += "</name>";
4231 + });
4232 + result += "</content>";
4233 + tmp2 = li[0].id || true;
4234 + li = li.find("> ul > li");
4235 + if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
4236 + else { tmp2 = ""; }
4237 + if(tp == "nest") { result += tmp2; }
4238 + result += "</item>";
4239 + if(tp == "flat") { result += tmp2; }
4240 + });
4241 + if(!is_callback) { result += "</root>"; }
4242 + return result;
4243 + }
4244 + }
4245 + });
4246 +})(jQuery);
4247 +//*/
4248 +
4249 +/*
4250 + * jsTree search plugin
4251 + * Enables both sync and async search on the tree
4252 + * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
4253 + */
4254 +(function ($) {
4255 + $.expr[':'].jstree_contains = function(a,i,m){
4256 + return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
4257 + };
4258 + $.expr[':'].jstree_title_contains = function(a,i,m) {
4259 + return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
4260 + };
4261 + $.jstree.plugin("search", {
4262 + __init : function () {
4263 + this.data.search.str = "";
4264 + this.data.search.result = $();
4265 + if(this._get_settings().search.show_only_matches) {
4266 + this.get_container()
4267 + .bind("search.jstree", function (e, data) {
4268 + $(this).children("ul").find("li").hide().removeClass("jstree-last");
4269 + data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
4270 + .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
4271 + })
4272 + .bind("clear_search.jstree", function () {
4273 + $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
4274 + });
4275 + }
4276 + },
4277 + defaults : {
4278 + ajax : false,
4279 + search_method : "jstree_contains", // for case insensitive - jstree_contains
4280 + show_only_matches : false
4281 + },
4282 + _fn : {
4283 + search : function (str, skip_async) {
4284 + if($.trim(str) === "") { this.clear_search(); return; }
4285 + var s = this.get_settings().search,
4286 + t = this,
4287 + error_func = function () { },
4288 + success_func = function () { };
4289 + this.data.search.str = str;
4290 +
4291 + if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
4292 + this.search.supress_callback = true;
4293 + error_func = function () { };
4294 + success_func = function (d, t, x) {
4295 + var sf = this.get_settings().search.ajax.success;
4296 + if(sf) { d = sf.call(this,d,t,x) || d; }
4297 + this.data.search.to_open = d;
4298 + this._search_open();
4299 + };
4300 + s.ajax.context = this;
4301 + s.ajax.error = error_func;
4302 + s.ajax.success = success_func;
4303 + if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
4304 + if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
4305 + if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
4306 + if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
4307 + $.ajax(s.ajax);
4308 + return;
4309 + }
4310 + if(this.data.search.result.length) { this.clear_search(); }
4311 + this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
4312 + this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
4313 + t.open_node(this, false, true);
4314 + });
4315 + this.__callback({ nodes : this.data.search.result, str : str });
4316 + },
4317 + clear_search : function (str) {
4318 + this.data.search.result.removeClass("jstree-search");
4319 + this.__callback(this.data.search.result);
4320 + this.data.search.result = $();
4321 + },
4322 + _search_open : function (is_callback) {
4323 + var _this = this,
4324 + done = true,
4325 + current = [],
4326 + remaining = [];
4327 + if(this.data.search.to_open.length) {
4328 + $.each(this.data.search.to_open, function (i, val) {
4329 + if(val == "#") { return true; }
4330 + if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
4331 + else { remaining.push(val); }
4332 + });
4333 + if(current.length) {
4334 + this.data.search.to_open = remaining;
4335 + $.each(current, function (i, val) {
4336 + _this.open_node(val, function () { _this._search_open(true); });
4337 + });
4338 + done = false;
4339 + }
4340 + }
4341 + if(done) { this.search(this.data.search.str, true); }
4342 + }
4343 + }
4344 + });
4345 +})(jQuery);
4346 +//*/
4347 +
4348 +/*
4349 + * jsTree contextmenu plugin
4350 + */
4351 +(function ($) {
4352 + $.vakata.context = {
4353 + hide_on_mouseleave : false,
4354 +
4355 + cnt : $("<div id='vakata-contextmenu' />"),
4356 + vis : false,
4357 + tgt : false,
4358 + par : false,
4359 + func : false,
4360 + data : false,
4361 + rtl : false,
4362 + show : function (s, t, x, y, d, p, rtl) {
4363 + $.vakata.context.rtl = !!rtl;
4364 + var html = $.vakata.context.parse(s), h, w;
4365 + if(!html) { return; }
4366 + $.vakata.context.vis = true;
4367 + $.vakata.context.tgt = t;
4368 + $.vakata.context.par = p || t || null;
4369 + $.vakata.context.data = d || null;
4370 + $.vakata.context.cnt
4371 + .html(html)
4372 + .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
4373 +
4374 + if($.vakata.context.hide_on_mouseleave) {
4375 + $.vakata.context.cnt
4376 + .one("mouseleave", function(e) { $.vakata.context.hide(); });
4377 + }
4378 +
4379 + h = $.vakata.context.cnt.height();
4380 + w = $.vakata.context.cnt.width();
4381 + if(x + w > $(document).width()) {
4382 + x = $(document).width() - (w + 5);
4383 + $.vakata.context.cnt.find("li > ul").addClass("right");
4384 + }
4385 + if(y + h > $(document).height()) {
4386 + y = y - (h + t[0].offsetHeight);
4387 + $.vakata.context.cnt.find("li > ul").addClass("bottom");
4388 + }
4389 +
4390 + $.vakata.context.cnt
4391 + .css({ "left" : x, "top" : y })
4392 + .find("li:has(ul)")
4393 + .bind("mouseenter", function (e) {
4394 + var w = $(document).width(),
4395 + h = $(document).height(),
4396 + ul = $(this).children("ul").show();
4397 + if(w !== $(document).width()) { ul.toggleClass("right"); }
4398 + if(h !== $(document).height()) { ul.toggleClass("bottom"); }
4399 + })
4400 + .bind("mouseleave", function (e) {
4401 + $(this).children("ul").hide();
4402 + })
4403 + .end()
4404 + .css({ "visibility" : "visible" })
4405 + .show();
4406 + $(document).triggerHandler("context_show.vakata");
4407 + },
4408 + hide : function () {
4409 + $.vakata.context.vis = false;
4410 + $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
4411 + $(document).triggerHandler("context_hide.vakata");
4412 + },
4413 + parse : function (s, is_callback) {
4414 + if(!s) { return false; }
4415 + var str = "",
4416 + tmp = false,
4417 + was_sep = true;
4418 + if(!is_callback) { $.vakata.context.func = {}; }
4419 + str += "<ul>";
4420 + $.each(s, function (i, val) {
4421 + if(!val) { return true; }
4422 + $.vakata.context.func[i] = val.action;
4423 + if(!was_sep && val.separator_before) {
4424 + str += "<li class='vakata-separator vakata-separator-before'></li>";
4425 + }
4426 + was_sep = false;
4427 + str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
4428 + if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
4429 + if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
4430 + str += ">&#160;</ins><a href='#' rel='" + i + "'>";
4431 + if(val.submenu) {
4432 + str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>&raquo;</span>";
4433 + }
4434 + str += val.label + "</a>";
4435 + if(val.submenu) {
4436 + tmp = $.vakata.context.parse(val.submenu, true);
4437 + if(tmp) { str += tmp; }
4438 + }
4439 + str += "</li>";
4440 + if(val.separator_after) {
4441 + str += "<li class='vakata-separator vakata-separator-after'></li>";
4442 + was_sep = true;
4443 + }
4444 + });
4445 + str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
4446 + str += "</ul>";
4447 + $(document).triggerHandler("context_parse.vakata");
4448 + return str.length > 10 ? str : false;
4449 + },
4450 + exec : function (i) {
4451 + if($.isFunction($.vakata.context.func[i])) {
4452 + // if is string - eval and call it!
4453 + $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
4454 + return true;
4455 + }
4456 + else { return false; }
4457 + }
4458 + };
4459 + $(function () {
4460 + var css_string = '' +
4461 + '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
4462 + '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
4463 + '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
4464 + '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
4465 + '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
4466 + '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
4467 + '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
4468 + '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
4469 + '#vakata-contextmenu .right { right:100%; left:auto; } ' +
4470 + '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
4471 + '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
4472 + $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
4473 + $.vakata.context.cnt
4474 + .delegate("a","click", function (e) { e.preventDefault(); })
4475 + .delegate("a","mouseup", function (e) {
4476 + if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
4477 + $.vakata.context.hide();
4478 + }
4479 + else { $(this).blur(); }
4480 + })
4481 + .delegate("a","mouseover", function () {
4482 + $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
4483 + })
4484 + .appendTo("body");
4485 + $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
4486 + if(typeof $.hotkeys !== "undefined") {
4487 + $(document)
4488 + .bind("keydown", "up", function (e) {
4489 + if($.vakata.context.vis) {
4490 + var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
4491 + if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
4492 + o.addClass("vakata-hover");
4493 + e.stopImmediatePropagation();
4494 + e.preventDefault();
4495 + }
4496 + })
4497 + .bind("keydown", "down", function (e) {
4498 + if($.vakata.context.vis) {
4499 + var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
4500 + if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
4501 + o.addClass("vakata-hover");
4502 + e.stopImmediatePropagation();
4503 + e.preventDefault();
4504 + }
4505 + })
4506 + .bind("keydown", "right", function (e) {
4507 + if($.vakata.context.vis) {
4508 + $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
4509 + e.stopImmediatePropagation();
4510 + e.preventDefault();
4511 + }
4512 + })
4513 + .bind("keydown", "left", function (e) {
4514 + if($.vakata.context.vis) {
4515 + $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
4516 + e.stopImmediatePropagation();
4517 + e.preventDefault();
4518 + }
4519 + })
4520 + .bind("keydown", "esc", function (e) {
4521 + $.vakata.context.hide();
4522 + e.preventDefault();
4523 + })
4524 + .bind("keydown", "space", function (e) {
4525 + $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
4526 + e.preventDefault();
4527 + });
4528 + }
4529 + });
4530 +
4531 + $.jstree.plugin("contextmenu", {
4532 + __init : function () {
4533 + this.get_container()
4534 + .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
4535 + e.preventDefault();
4536 + if(!$(e.currentTarget).hasClass("jstree-loading")) {
4537 + this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
4538 + }
4539 + }, this))
4540 + .delegate("a", "click.jstree", $.proxy(function (e) {
4541 + if(this.data.contextmenu) {
4542 + $.vakata.context.hide();
4543 + }
4544 + }, this))
4545 + .bind("destroy.jstree", $.proxy(function () {
4546 + // TODO: move this to descruct method
4547 + if(this.data.contextmenu) {
4548 + $.vakata.context.hide();
4549 + }
4550 + }, this));
4551 + $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
4552 + },
4553 + defaults : {
4554 + select_node : false, // requires UI plugin
4555 + show_at_node : true,
4556 + items : { // Could be a function that should return an object like this one
4557 + "create" : {
4558 + "separator_before" : false,
4559 + "separator_after" : true,
4560 + "label" : "Create",
4561 + "action" : function (obj) { this.create(obj); }
4562 + },
4563 + "rename" : {
4564 + "separator_before" : false,
4565 + "separator_after" : false,
4566 + "label" : "Rename",
4567 + "action" : function (obj) { this.rename(obj); }
4568 + },
4569 + "remove" : {
4570 + "separator_before" : false,
4571 + "icon" : false,
4572 + "separator_after" : false,
4573 + "label" : "Delete",
4574 + "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
4575 + },
4576 + "ccp" : {
4577 + "separator_before" : true,
4578 + "icon" : false,
4579 + "separator_after" : false,
4580 + "label" : "Edit",
4581 + "action" : false,
4582 + "submenu" : {
4583 + "cut" : {
4584 + "separator_before" : false,
4585 + "separator_after" : false,
4586 + "label" : "Cut",
4587 + "action" : function (obj) { this.cut(obj); }
4588 + },
4589 + "copy" : {
4590 + "separator_before" : false,
4591 + "icon" : false,
4592 + "separator_after" : false,
4593 + "label" : "Copy",
4594 + "action" : function (obj) { this.copy(obj); }
4595 + },
4596 + "paste" : {
4597 + "separator_before" : false,
4598 + "icon" : false,
4599 + "separator_after" : false,
4600 + "label" : "Paste",
4601 + "action" : function (obj) { this.paste(obj); }
4602 + }
4603 + }
4604 + }
4605 + }
4606 + },
4607 + _fn : {
4608 + show_contextmenu : function (obj, x, y) {
4609 + obj = this._get_node(obj);
4610 + var s = this.get_settings().contextmenu,
4611 + a = obj.children("a:visible:eq(0)"),
4612 + o = false,
4613 + i = false;
4614 + if(s.select_node && this.data.ui && !this.is_selected(obj)) {
4615 + this.deselect_all();
4616 + this.select_node(obj, true);
4617 + }
4618 + if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
4619 + o = a.offset();
4620 + x = o.left;
4621 + y = o.top + this.data.core.li_height;
4622 + }
4623 + i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
4624 + if($.isFunction(i)) { i = i.call(this, obj); }
4625 + this.data.contextmenu = true;
4626 + $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
4627 + if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
4628 + }
4629 + }
4630 + });
4631 +})(jQuery);
4632 +//*/
4633 +
4634 +/*
4635 + * jsTree types plugin
4636 + * Adds support types of nodes
4637 + * You can set an attribute on each li node, that represents its type.
4638 + * According to the type setting the node may get custom icon/validation rules
4639 + */
4640 +(function ($) {
4641 + $.jstree.plugin("types", {
4642 + __init : function () {
4643 + var s = this._get_settings().types;
4644 + this.data.types.attach_to = [];
4645 + this.get_container()
4646 + .bind("init.jstree", $.proxy(function () {
4647 + var types = s.types,
4648 + attr = s.type_attr,
4649 + icons_css = "",
4650 + _this = this;
4651 +
4652 + $.each(types, function (i, tp) {
4653 + $.each(tp, function (k, v) {
4654 + if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
4655 + });
4656 + if(!tp.icon) { return true; }
4657 + if( tp.icon.image || tp.icon.position) {
4658 + if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
4659 + else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
4660 + if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
4661 + if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
4662 + else { icons_css += ' background-position:0 0; '; }
4663 + icons_css += '} ';
4664 + }
4665 + });
4666 + if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
4667 + }, this))
4668 + .bind("before.jstree", $.proxy(function (e, data) {
4669 + var s, t,
4670 + o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
4671 + d = o && o !== -1 && o.length ? o.data("jstree") : false;
4672 + if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
4673 + if($.inArray(data.func, this.data.types.attach_to) !== -1) {
4674 + if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
4675 + s = this._get_settings().types.types;
4676 + t = this._get_type(data.args[0]);
4677 + if(
4678 + (
4679 + (s[t] && typeof s[t][data.func] !== "undefined") ||
4680 + (s["default"] && typeof s["default"][data.func] !== "undefined")
4681 + ) && this._check(data.func, data.args[0]) === false
4682 + ) {
4683 + e.stopImmediatePropagation();
4684 + return false;
4685 + }
4686 + }
4687 + }, this));
4688 + if(is_ie6) {
4689 + this.get_container()
4690 + .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
4691 + var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
4692 + c = false,
4693 + s = this._get_settings().types;
4694 + $.each(s.types, function (i, tp) {
4695 + if(tp.icon && (tp.icon.image || tp.icon.position)) {
4696 + c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
4697 + if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
4698 + c.css("backgroundPosition", tp.icon.position || "0 0");
4699 + }
4700 + });
4701 + }, this));
4702 + }
4703 + },
4704 + defaults : {
4705 + // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
4706 + max_children : -1,
4707 + // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
4708 + max_depth : -1,
4709 + // defines valid node types for the root nodes
4710 + valid_children : "all",
4711 +
4712 + // whether to use $.data
4713 + use_data : false,
4714 + // where is the type stores (the rel attribute of the LI element)
4715 + type_attr : "rel",
4716 + // a list of types
4717 + types : {
4718 + // the default type
4719 + "default" : {
4720 + "max_children" : -1,
4721 + "max_depth" : -1,
4722 + "valid_children": "all"
4723 +
4724 + // Bound functions - you can bind any other function here (using boolean or function)
4725 + //"select_node" : true
4726 + }
4727 + }
4728 + },
4729 + _fn : {
4730 + _types_notify : function (n, data) {
4731 + if(data.type && this._get_settings().types.use_data) {
4732 + this.set_type(data.type, n);
4733 + }
4734 + },
4735 + _get_type : function (obj) {
4736 + obj = this._get_node(obj);
4737 + return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
4738 + },
4739 + set_type : function (str, obj) {
4740 + obj = this._get_node(obj);
4741 + var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
4742 + if(ret) { this.__callback({ obj : obj, type : str}); }
4743 + return ret;
4744 + },
4745 + _check : function (rule, obj, opts) {
4746 + obj = this._get_node(obj);
4747 + var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
4748 + if(obj === -1) {
4749 + if(!!s[rule]) { v = s[rule]; }
4750 + else { return; }
4751 + }
4752 + else {
4753 + if(t === false) { return; }
4754 + data = s.use_data ? obj.data("jstree") : false;
4755 + if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
4756 + else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
4757 + else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
4758 + }
4759 + if($.isFunction(v)) { v = v.call(this, obj); }
4760 + if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
4761 + // also include the node itself - otherwise if root node it is not checked
4762 + obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
4763 + // check if current depth already exceeds global tree depth
4764 + if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
4765 + d = (i === 0) ? v : _this._check(rule, this, false);
4766 + // check if current node max depth is already matched or exceeded
4767 + if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
4768 + // otherwise - set the max depth to the current value minus current depth
4769 + if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
4770 + // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
4771 + if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
4772 + });
4773 + }
4774 + return v;
4775 + },
4776 + check_move : function () {
4777 + if(!this.__call_old()) { return false; }
4778 + var m = this._get_move(),
4779 + s = m.rt._get_settings().types,
4780 + mc = m.rt._check("max_children", m.cr),
4781 + md = m.rt._check("max_depth", m.cr),
4782 + vc = m.rt._check("valid_children", m.cr),
4783 + ch = 0, d = 1, t;
4784 +
4785 + if(vc === "none") { return false; }
4786 + if($.isArray(vc) && m.ot && m.ot._get_type) {
4787 + m.o.each(function () {
4788 + if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
4789 + });
4790 + if(d === false) { return false; }
4791 + }
4792 + if(s.max_children !== -2 && mc !== -1) {
4793 + ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
4794 + if(ch + m.o.length > mc) { return false; }
4795 + }
4796 + if(s.max_depth !== -2 && md !== -1) {
4797 + d = 0;
4798 + if(md === 0) { return false; }
4799 + if(typeof m.o.d === "undefined") {
4800 + // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
4801 + t = m.o;
4802 + while(t.length > 0) {
4803 + t = t.find("> ul > li");
4804 + d ++;
4805 + }
4806 + m.o.d = d;
4807 + }
4808 + if(md - m.o.d < 0) { return false; }
4809 + }
4810 + return true;
4811 + },
4812 + create_node : function (obj, position, js, callback, is_loaded, skip_check) {
4813 + if(!skip_check && (is_loaded || this._is_loaded(obj))) {
4814 + var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
4815 + s = this._get_settings().types,
4816 + mc = this._check("max_children", p),
4817 + md = this._check("max_depth", p),
4818 + vc = this._check("valid_children", p),
4819 + ch;
4820 + if(typeof js === "string") { js = { data : js }; }
4821 + if(!js) { js = {}; }
4822 + if(vc === "none") { return false; }
4823 + if($.isArray(vc)) {
4824 + if(!js.attr || !js.attr[s.type_attr]) {
4825 + if(!js.attr) { js.attr = {}; }
4826 + js.attr[s.type_attr] = vc[0];
4827 + }
4828 + else {
4829 + if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
4830 + }
4831 + }
4832 + if(s.max_children !== -2 && mc !== -1) {
4833 + ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
4834 + if(ch + 1 > mc) { return false; }
4835 + }
4836 + if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
4837 + }
4838 + return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
4839 + }
4840 + }
4841 + });
4842 +})(jQuery);
4843 +//*/
4844 +
4845 +/*
4846 + * jsTree HTML plugin
4847 + * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
4848 + */
4849 +(function ($) {
4850 + $.jstree.plugin("html_data", {
4851 + __init : function () {
4852 + // this used to use html() and clean the whitespace, but this way any attached data was lost
4853 + this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
4854 + // remove white space from LI node - otherwise nodes appear a bit to the right
4855 + this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
4856 + },
4857 + defaults : {
4858 + data : false,
4859 + ajax : false,
4860 + correct_state : true
4861 + },
4862 + _fn : {
4863 + load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
4864 + _is_loaded : function (obj) {
4865 + obj = this._get_node(obj);
4866 + return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
4867 + },
4868 + load_node_html : function (obj, s_call, e_call) {
4869 + var d,
4870 + s = this.get_settings().html_data,
4871 + error_func = function () {},
4872 + success_func = function () {};
4873 + obj = this._get_node(obj);
4874 + if(obj && obj !== -1) {
4875 + if(obj.data("jstree_is_loading")) { return; }
4876 + else { obj.data("jstree_is_loading",true); }
4877 + }
4878 + switch(!0) {
4879 + case ($.isFunction(s.data)):
4880 + s.data.call(this, obj, $.proxy(function (d) {
4881 + if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
4882 + d = $(d);
4883 + if(!d.is("ul")) { d = $("<ul />").append(d); }
4884 + if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
4885 + else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
4886 + this.clean_node(obj);
4887 + if(s_call) { s_call.call(this); }
4888 + }
4889 + else {
4890 + if(obj && obj !== -1) {
4891 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4892 + obj.removeData("jstree_is_loading");
4893 + if(s.correct_state) {
4894 + this.correct_state(obj);
4895 + if(s_call) { s_call.call(this); }
4896 + }
4897 + }
4898 + else {
4899 + if(s.correct_state) {
4900 + this.get_container().children("ul").empty();
4901 + if(s_call) { s_call.call(this); }
4902 + }
4903 + }
4904 + }
4905 + }, this));
4906 + break;
4907 + case (!s.data && !s.ajax):
4908 + if(!obj || obj == -1) {
4909 + this.get_container()
4910 + .children("ul").empty()
4911 + .append(this.data.html_data.original_container_html)
4912 + .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
4913 + .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
4914 + this.clean_node();
4915 + }
4916 + if(s_call) { s_call.call(this); }
4917 + break;
4918 + case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
4919 + if(!obj || obj == -1) {
4920 + d = $(s.data);
4921 + if(!d.is("ul")) { d = $("<ul />").append(d); }
4922 + this.get_container()
4923 + .children("ul").empty().append(d.children())
4924 + .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
4925 + .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
4926 + this.clean_node();
4927 + }
4928 + if(s_call) { s_call.call(this); }
4929 + break;
4930 + case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
4931 + obj = this._get_node(obj);
4932 + error_func = function (x, t, e) {
4933 + var ef = this.get_settings().html_data.ajax.error;
4934 + if(ef) { ef.call(this, x, t, e); }
4935 + if(obj != -1 && obj.length) {
4936 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4937 + obj.removeData("jstree_is_loading");
4938 + if(t === "success" && s.correct_state) { this.correct_state(obj); }
4939 + }
4940 + else {
4941 + if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
4942 + }
4943 + if(e_call) { e_call.call(this); }
4944 + };
4945 + success_func = function (d, t, x) {
4946 + var sf = this.get_settings().html_data.ajax.success;
4947 + if(sf) { d = sf.call(this,d,t,x) || d; }
4948 + if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
4949 + return error_func.call(this, x, t, "");
4950 + }
4951 + if(d) {
4952 + d = $(d);
4953 + if(!d.is("ul")) { d = $("<ul />").append(d); }
4954 + if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
4955 + else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
4956 + this.clean_node(obj);
4957 + if(s_call) { s_call.call(this); }
4958 + }
4959 + else {
4960 + if(obj && obj !== -1) {
4961 + obj.children("a.jstree-loading").removeClass("jstree-loading");
4962 + obj.removeData("jstree_is_loading");
4963 + if(s.correct_state) {
4964 + this.correct_state(obj);
4965 + if(s_call) { s_call.call(this); }
4966 + }
4967 + }
4968 + else {
4969 + if(s.correct_state) {
4970 + this.get_container().children("ul").empty();
4971 + if(s_call) { s_call.call(this); }
4972 + }
4973 + }
4974 + }
4975 + };
4976 + s.ajax.context = this;
4977 + s.ajax.error = error_func;
4978 + s.ajax.success = success_func;
4979 + if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
4980 + if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
4981 + if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
4982 + $.ajax(s.ajax);
4983 + break;
4984 + }
4985 + }
4986 + }
4987 + });
4988 + // include the HTML data plugin by default
4989 + $.jstree.defaults.plugins.push("html_data");
4990 +})(jQuery);
4991 +//*/
4992 +
4993 +/*
4994 + * jsTree themeroller plugin
4995 + * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
4996 + */
4997 +(function ($) {
4998 + $.jstree.plugin("themeroller", {
4999 + __init : function () {
5000 + var s = this._get_settings().themeroller;
5001 + this.get_container()
5002 + .addClass("ui-widget-content")
5003 + .addClass("jstree-themeroller")
5004 + .delegate("a","mouseenter.jstree", function (e) {
5005 + if(!$(e.currentTarget).hasClass("jstree-loading")) {
5006 + $(this).addClass(s.item_h);
5007 + }
5008 + })
5009 + .delegate("a","mouseleave.jstree", function () {
5010 + $(this).removeClass(s.item_h);
5011 + })
5012 + .bind("init.jstree", $.proxy(function (e, data) {
5013 + data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
5014 + this._themeroller(data.inst.get_container().find("> ul > li"));
5015 + }, this))
5016 + .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
5017 + this._themeroller(data.rslt.obj);
5018 + }, this))
5019 + .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
5020 + this._themeroller();
5021 + }, this))
5022 + .bind("close_node.jstree", $.proxy(function (e, data) {
5023 + this._themeroller(data.rslt.obj);
5024 + }, this))
5025 + .bind("delete_node.jstree", $.proxy(function (e, data) {
5026 + this._themeroller(data.rslt.parent);
5027 + }, this))
5028 + .bind("correct_state.jstree", $.proxy(function (e, data) {
5029 + data.rslt.obj
5030 + .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
5031 + .find("> a > ins.ui-icon")
5032 + .filter(function() {
5033 + return this.className.toString()
5034 + .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
5035 + .indexOf("ui-icon-") === -1;
5036 + }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
5037 + }, this))
5038 + .bind("select_node.jstree", $.proxy(function (e, data) {
5039 + data.rslt.obj.children("a").addClass(s.item_a);
5040 + }, this))
5041 + .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
5042 + this.get_container()
5043 + .find("a." + s.item_a).removeClass(s.item_a).end()
5044 + .find("a.jstree-clicked").addClass(s.item_a);
5045 + }, this))
5046 + .bind("dehover_node.jstree", $.proxy(function (e, data) {
5047 + data.rslt.obj.children("a").removeClass(s.item_h);
5048 + }, this))
5049 + .bind("hover_node.jstree", $.proxy(function (e, data) {
5050 + this.get_container()
5051 + .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
5052 + data.rslt.obj.children("a").addClass(s.item_h);
5053 + }, this))
5054 + .bind("move_node.jstree", $.proxy(function (e, data) {
5055 + this._themeroller(data.rslt.o);
5056 + this._themeroller(data.rslt.op);
5057 + }, this));
5058 + },
5059 + __destroy : function () {
5060 + var s = this._get_settings().themeroller,
5061 + c = [ "ui-icon" ];
5062 + $.each(s, function (i, v) {
5063 + v = v.split(" ");
5064 + if(v.length) { c = c.concat(v); }
5065 + });
5066 + this.get_container()
5067 + .removeClass("ui-widget-content")
5068 + .find("." + c.join(", .")).removeClass(c.join(" "));
5069 + },
5070 + _fn : {
5071 + _themeroller : function (obj) {
5072 + var s = this._get_settings().themeroller;
5073 + obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
5074 + obj
5075 + .find("li.jstree-closed")
5076 + .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
5077 + .children("a").addClass(s.item)
5078 + .children("ins.jstree-icon").addClass("ui-icon")
5079 + .filter(function() {
5080 + return this.className.toString()
5081 + .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
5082 + .indexOf("ui-icon-") === -1;
5083 + }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
5084 + .end()
5085 + .end()
5086 + .end()
5087 + .end()
5088 + .find("li.jstree-open")
5089 + .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
5090 + .children("a").addClass(s.item)
5091 + .children("ins.jstree-icon").addClass("ui-icon")
5092 + .filter(function() {
5093 + return this.className.toString()
5094 + .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
5095 + .indexOf("ui-icon-") === -1;
5096 + }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
5097 + .end()
5098 + .end()
5099 + .end()
5100 + .end()
5101 + .find("li.jstree-leaf")
5102 + .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
5103 + .children("a").addClass(s.item)
5104 + .children("ins.jstree-icon").addClass("ui-icon")
5105 + .filter(function() {
5106 + return this.className.toString()
5107 + .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
5108 + .indexOf("ui-icon-") === -1;
5109 + }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
5110 + }
5111 + },
5112 + defaults : {
5113 + "opened" : "ui-icon-triangle-1-se",
5114 + "closed" : "ui-icon-triangle-1-e",
5115 + "item" : "ui-state-default",
5116 + "item_h" : "ui-state-hover",
5117 + "item_a" : "ui-state-active",
5118 + "item_open" : "ui-icon-folder-open",
5119 + "item_clsd" : "ui-icon-folder-collapsed",
5120 + "item_leaf" : "ui-icon-document"
5121 + }
5122 + });
5123 + $(function() {
5124 + var css_string = '' +
5125 + '.jstree-themeroller .ui-icon { overflow:visible; } ' +
5126 + '.jstree-themeroller a { padding:0 2px; } ' +
5127 + '.jstree-themeroller .jstree-no-icon { display:none; }';
5128 + $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
5129 + });
5130 +})(jQuery);
5131 +//*/
5132 +
5133 +/*
5134 + * jsTree unique plugin
5135 + * Forces different names amongst siblings (still a bit experimental)
5136 + * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
5137 + */
5138 +(function ($) {
5139 + $.jstree.plugin("unique", {
5140 + __init : function () {
5141 + this.get_container()
5142 + .bind("before.jstree", $.proxy(function (e, data) {
5143 + var nms = [], res = true, p, t;
5144 + if(data.func == "move_node") {
5145 + // obj, ref, position, is_copy, is_prepared, skip_check
5146 + if(data.args[4] === true) {
5147 + if(data.args[0].o && data.args[0].o.length) {
5148 + data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
5149 + res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
5150 + }
5151 + }
5152 + }
5153 + if(data.func == "create_node") {
5154 + // obj, position, js, callback, is_loaded
5155 + if(data.args[4] || this._is_loaded(data.args[0])) {
5156 + p = this._get_node(data.args[0]);
5157 + if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
5158 + p = this._get_parent(data.args[0]);
5159 + if(!p || p === -1) { p = this.get_container(); }
5160 + }
5161 + if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
5162 + else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
5163 + else { nms.push(data.args[2].data); }
5164 + res = this._check_unique(nms, p.find("> ul > li"), "create_node");
5165 + }
5166 + }
5167 + if(data.func == "rename_node") {
5168 + // obj, val
5169 + nms.push(data.args[1]);
5170 + t = this._get_node(data.args[0]);
5171 + p = this._get_parent(t);
5172 + if(!p || p === -1) { p = this.get_container(); }
5173 + res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
5174 + }
5175 + if(!res) {
5176 + e.stopPropagation();
5177 + return false;
5178 + }
5179 + }, this));
5180 + },
5181 + defaults : {
5182 + error_callback : $.noop
5183 + },
5184 + _fn : {
5185 + _check_unique : function (nms, p, func) {
5186 + var cnms = [];
5187 + p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
5188 + if(!cnms.length || !nms.length) { return true; }
5189 + cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
5190 + if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
5191 + this._get_settings().unique.error_callback.call(null, nms, p, func);
5192 + return false;
5193 + }
5194 + return true;
5195 + },
5196 + check_move : function () {
5197 + if(!this.__call_old()) { return false; }
5198 + var p = this._get_move(), nms = [];
5199 + if(p.o && p.o.length) {
5200 + p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
5201 + return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
5202 + }
5203 + return true;
5204 + }
5205 + }
5206 + });
5207 +})(jQuery);
5208 +//*/
5209 +
5210 +/*
5211 + * jsTree wholerow plugin
5212 + * Makes select and hover work on the entire width of the node
5213 + * MAY BE HEAVY IN LARGE DOM
5214 + */
5215 +(function ($) {
5216 + $.jstree.plugin("wholerow", {
5217 + __init : function () {
5218 + if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
5219 + this.data.wholerow.html = false;
5220 + this.data.wholerow.to = false;
5221 + this.get_container()
5222 + .bind("init.jstree", $.proxy(function (e, data) {
5223 + this._get_settings().core.animation = 0;
5224 + }, this))
5225 + .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
5226 + this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
5227 + }, this))
5228 + .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
5229 + if(this.data.to) { clearTimeout(this.data.to); }
5230 + this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
5231 + }, this))
5232 + .bind("deselect_all.jstree", $.proxy(function (e, data) {
5233 + this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
5234 + }, this))
5235 + .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
5236 + data.rslt.obj.each(function () {
5237 + var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
5238 + // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
5239 + ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
5240 + });
5241 + }, this))
5242 + .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
5243 + this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
5244 + if(e.type === "hover_node") {
5245 + var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
5246 + // ref.children("a").addClass("jstree-hovered");
5247 + ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
5248 + }
5249 + }, this))
5250 + .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
5251 + var n = $(e.currentTarget);
5252 + if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
5253 + n.closest("li").children("a:visible:eq(0)").click();
5254 + e.stopImmediatePropagation();
5255 + })
5256 + .delegate("li", "mouseover.jstree", $.proxy(function (e) {
5257 + e.stopImmediatePropagation();
5258 + if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
5259 + this.hover_node(e.currentTarget);
5260 + return false;
5261 + }, this))
5262 + .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
5263 + if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
5264 + this.dehover_node(e.currentTarget);
5265 + }, this));
5266 + if(is_ie7 || is_ie6) {
5267 + $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
5268 + }
5269 + },
5270 + defaults : {
5271 + },
5272 + __destroy : function () {
5273 + this.get_container().children(".jstree-wholerow").remove();
5274 + this.get_container().find(".jstree-wholerow-span").remove();
5275 + },
5276 + _fn : {
5277 + _prepare_wholerow_span : function (obj) {
5278 + obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
5279 + if(obj === false) { return; } // added for removing root nodes
5280 + obj.each(function () {
5281 + $(this).find("li").andSelf().each(function () {
5282 + var $t = $(this);
5283 + if($t.children(".jstree-wholerow-span").length) { return true; }
5284 + $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
5285 + });
5286 + });
5287 + },
5288 + _prepare_wholerow_ul : function () {
5289 + var o = this.get_container().children("ul").eq(0), h = o.html();
5290 + o.addClass("jstree-wholerow-real");
5291 + if(this.data.wholerow.last_html !== h) {
5292 + this.data.wholerow.last_html = h;
5293 + this.get_container().children(".jstree-wholerow").remove();
5294 + this.get_container().append(
5295 + o.clone().removeClass("jstree-wholerow-real")
5296 + .wrapAll("<div class='jstree-wholerow' />").parent()
5297 + .width(o.parent()[0].scrollWidth)
5298 + .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
5299 + .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
5300 + );
5301 + }
5302 + }
5303 + }
5304 + });
5305 + $(function() {
5306 + var css_string = '' +
5307 + '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
5308 + '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
5309 + '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
5310 + '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
5311 + '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
5312 + '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
5313 + '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
5314 + '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
5315 + '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
5316 + '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
5317 + if(is_ff2) {
5318 + css_string += '' +
5319 + '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
5320 + '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
5321 + }
5322 + if(is_ie7 || is_ie6) {
5323 + css_string += '' +
5324 + '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
5325 + '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
5326 + }
5327 + $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
5328 + });
5329 +})(jQuery);
5330 +//*/
5331 +
5332 +/*
5333 +* jsTree model plugin
5334 +* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
5335 +*/
5336 +(function ($) {
5337 + var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
5338 + validateInterface = function(obj, inter) {
5339 + var valid = true;
5340 + obj = obj || {};
5341 + inter = [].concat(inter);
5342 + $.each(inter, function (i, v) {
5343 + if(!$.isFunction(obj[v])) { valid = false; return false; }
5344 + });
5345 + return valid;
5346 + };
5347 + $.jstree.plugin("model", {
5348 + __init : function () {
5349 + if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
5350 + this._get_settings().json_data.data = function (n, b) {
5351 + var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
5352 + if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
5353 + if(this._get_settings().model.async) {
5354 + obj.getChildren($.proxy(function (data) {
5355 + this.model_done(data, b);
5356 + }, this));
5357 + }
5358 + else {
5359 + this.model_done(obj.getChildren(), b);
5360 + }
5361 + };
5362 + },
5363 + defaults : {
5364 + object : false,
5365 + id_prefix : false,
5366 + async : false
5367 + },
5368 + _fn : {
5369 + model_done : function (data, callback) {
5370 + var ret = [],
5371 + s = this._get_settings(),
5372 + _this = this;
5373 +
5374 + if(!$.isArray(data)) { data = [data]; }
5375 + $.each(data, function (i, nd) {
5376 + var r = nd.getProps() || {};
5377 + r.attr = nd.getAttr() || {};
5378 + if(nd.getChildrenCount()) { r.state = "closed"; }
5379 + r.data = nd.getName();
5380 + if(!$.isArray(r.data)) { r.data = [r.data]; }
5381 + if(_this.data.types && $.isFunction(nd.getType)) {
5382 + r.attr[s.types.type_attr] = nd.getType();
5383 + }
5384 + if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
5385 + if(!r.metadata) { r.metadata = { }; }
5386 + r.metadata.jstree_model = nd;
5387 + ret.push(r);
5388 + });
5389 + callback.call(null, ret);
5390 + }
5391 + }
5392 + });
5393 +})(jQuery);
5394 +//*/
5395 +
5396 +})();
5397 \ No newline at end of file
5398 diff -up cacti-0.8.8a/include/js/jquery/jquery.tablednd.js.legal cacti-0.8.8a/include/js/jquery/jquery.tablednd.js
5399 --- cacti-0.8.8a/include/js/jquery/jquery.tablednd.js.legal 2013-01-04 15:44:38.038416075 -0500
5400 +++ cacti-0.8.8a/include/js/jquery/jquery.tablednd.js 2013-01-04 15:43:12.645377988 -0500
5401 @@ -0,0 +1,382 @@
5402 +/**
5403 + * TableDnD plug-in for JQuery, allows you to drag and drop table rows
5404 + * You can set up various options to control how the system will work
5405 + * Copyright (c) Denis Howlett <denish@isocra.com>
5406 + * Licensed like jQuery, see http://docs.jquery.com/License.
5407 + *
5408 + * Configuration options:
5409 + *
5410 + * onDragStyle
5411 + * This is the style that is assigned to the row during drag. There are limitations to the styles that can be
5412 + * associated with a row (such as you can't assign a border--well you can, but it won't be
5413 + * displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as
5414 + * a map (as used in the jQuery css(...) function).
5415 + * onDropStyle
5416 + * This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations
5417 + * to what you can do. Also this replaces the original style, so again consider using onDragClass which
5418 + * is simply added and then removed on drop.
5419 + * onDragClass
5420 + * This class is added for the duration of the drag and then removed when the row is dropped. It is more
5421 + * flexible than using onDragStyle since it can be inherited by the row cells and other content. The default
5422 + * is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your
5423 + * stylesheet.
5424 + * onDrop
5425 + * Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table
5426 + * and the row that was dropped. You can work out the new order of the rows by using
5427 + * table.rows.
5428 + * onDragStart
5429 + * Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the
5430 + * table and the row which the user has started to drag.
5431 + * onAllowDrop
5432 + * Pass a function that will be called as a row is over another row. If the function returns true, allow
5433 + * dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under
5434 + * the cursor. It returns a boolean: true allows the drop, false doesn't allow it.
5435 + * scrollAmount
5436 + * This is the number of pixels to scroll if the user moves the mouse cursor to the top or bottom of the
5437 + * window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2,
5438 + * FF3 beta
5439 + * dragHandle
5440 + * This is the name of a class that you assign to one or more cells in each row that is draggable. If you
5441 + * specify this class, then you are responsible for setting cursor: move in the CSS and only these cells
5442 + * will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where
5443 + * the whole row is draggable.
5444 + *
5445 + * Other ways to control behaviour:
5446 + *
5447 + * Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows
5448 + * that you don't want to be draggable.
5449 + *
5450 + * Inside the onDrop method you can also call $.tableDnD.serialize() this returns a string of the form
5451 + * <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have
5452 + * an ID as must all the rows.
5453 + *
5454 + * Other methods:
5455 + *
5456 + * $("...").tableDnDUpdate()
5457 + * Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells).
5458 + * This is useful if you have updated the table rows using Ajax and you want to make the table draggable again.
5459 + * The table maintains the original configuration (so you don't have to specify it again).
5460 + *
5461 + * $("...").tableDnDSerialize()
5462 + * Will serialize and return the serialized string as above, but for each of the matching tables--so it can be
5463 + * called from anywhere and isn't dependent on the currentTable being set up correctly before calling
5464 + *
5465 + * Known problems:
5466 + * - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0
5467 + *
5468 + * Version 0.2: 2008-02-20 First public version
5469 + * Version 0.3: 2008-02-07 Added onDragStart option
5470 + * Made the scroll amount configurable (default is 5 as before)
5471 + * Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes
5472 + * Added onAllowDrop to control dropping
5473 + * Fixed a bug which meant that you couldn't set the scroll amount in both directions
5474 + * Added serialize method
5475 + * Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row
5476 + * draggable
5477 + * Improved the serialize method to use a default (and settable) regular expression.
5478 + * Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table
5479 + */
5480 +jQuery.tableDnD = {
5481 + /** Keep hold of the current table being dragged */
5482 + currentTable : null,
5483 + /** Keep hold of the current drag object if any */
5484 + dragObject: null,
5485 + /** The current mouse offset */
5486 + mouseOffset: null,
5487 + /** Remember the old value of Y so that we don't do too much processing */
5488 + oldY: 0,
5489 +
5490 + /** Actually build the structure */
5491 + build: function(options) {
5492 + // Set up the defaults if any
5493 +
5494 + this.each(function() {
5495 + // This is bound to each matching table, set up the defaults and override with user options
5496 + this.tableDnDConfig = jQuery.extend({
5497 + onDragStyle: null,
5498 + onDropStyle: null,
5499 + // Add in the default class for whileDragging
5500 + onDragClass: "tDnD_whileDrag",
5501 + onDrop: null,
5502 + onDragStart: null,
5503 + scrollAmount: 5,
5504 + serializeRegexp: /[^\_]*$/, // The regular expression to use to trim row IDs
5505 + serializeParamName: null, // If you want to specify another parameter name instead of the table ID
5506 + dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
5507 + }, options || {});
5508 + // Now make the rows draggable
5509 + jQuery.tableDnD.makeDraggable(this);
5510 + });
5511 +
5512 + // Now we need to capture the mouse up and mouse move event
5513 + // We can use bind so that we don't interfere with other event handlers
5514 + jQuery(document)
5515 + .bind('mousemove', jQuery.tableDnD.mousemove)
5516 + .bind('mouseup', jQuery.tableDnD.mouseup);
5517 +
5518 + // Don't break the chain
5519 + return this;
5520 + },
5521 +
5522 + /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
5523 + makeDraggable: function(table) {
5524 + var config = table.tableDnDConfig;
5525 + if (table.tableDnDConfig.dragHandle) {
5526 + // We only need to add the event to the specified cells
5527 + var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
5528 + cells.each(function() {
5529 + // The cell is bound to "this"
5530 + jQuery(this).mousedown(function(ev) {
5531 + jQuery.tableDnD.dragObject = this.parentNode;
5532 + jQuery.tableDnD.currentTable = table;
5533 + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
5534 + if (config.onDragStart) {
5535 + // Call the onDrop method if there is one
5536 + config.onDragStart(table, this);
5537 + }
5538 + return false;
5539 + });
5540 + })
5541 + } else {
5542 + // For backwards compatibility, we add the event to the whole row
5543 + var rows = jQuery("tr", table); // get all the rows as a wrapped set
5544 + rows.each(function() {
5545 + // Iterate through each row, the row is bound to "this"
5546 + var row = jQuery(this);
5547 + if (! row.hasClass("nodrag")) {
5548 + row.mousedown(function(ev) {
5549 + if (ev.target.tagName == "TD") {
5550 + jQuery.tableDnD.dragObject = this;
5551 + jQuery.tableDnD.currentTable = table;
5552 + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
5553 + if (config.onDragStart) {
5554 + // Call the onDrop method if there is one
5555 + config.onDragStart(table, this);
5556 + }
5557 + return false;
5558 + }
5559 + }).css("cursor", "move"); // Store the tableDnD object
5560 + }
5561 + });
5562 + }
5563 + },
5564 +
5565 + updateTables: function() {
5566 + this.each(function() {
5567 + // this is now bound to each matching table
5568 + if (this.tableDnDConfig) {
5569 + jQuery.tableDnD.makeDraggable(this);
5570 + }
5571 + })
5572 + },
5573 +
5574 + /** Get the mouse coordinates from the event (allowing for browser differences) */
5575 + mouseCoords: function(ev){
5576 + if(ev.pageX || ev.pageY){
5577 + return {x:ev.pageX, y:ev.pageY};
5578 + }
5579 + return {
5580 + x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
5581 + y:ev.clientY + document.body.scrollTop - document.body.clientTop
5582 + };
5583 + },
5584 +
5585 + /** Given a target element and a mouse event, get the mouse offset from that element.
5586 + To do this we need the element's position and the mouse position */
5587 + getMouseOffset: function(target, ev) {
5588 + ev = ev || window.event;
5589 +
5590 + var docPos = this.getPosition(target);
5591 + var mousePos = this.mouseCoords(ev);
5592 + return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
5593 + },
5594 +
5595 + /** Get the position of an element by going up the DOM tree and adding up all the offsets */
5596 + getPosition: function(e){
5597 + var left = 0;
5598 + var top = 0;
5599 + /** Safari fix -- thanks to Luis Chato for this! */
5600 + if (e.offsetHeight == 0) {
5601 + /** Safari 2 doesn't correctly grab the offsetTop of a table row
5602 + this is detailed here:
5603 + http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
5604 + the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
5605 + note that firefox will return a text node as a first child, so designing a more thorough
5606 + solution may need to take that into account, for now this seems to work in firefox, safari, ie */
5607 + e = e.firstChild; // a table cell
5608 + }
5609 +
5610 + while (e.offsetParent){
5611 + left += e.offsetLeft;
5612 + top += e.offsetTop;
5613 + e = e.offsetParent;
5614 + }
5615 +
5616 + left += e.offsetLeft;
5617 + top += e.offsetTop;
5618 +
5619 + return {x:left, y:top};
5620 + },
5621 +
5622 + mousemove: function(ev) {
5623 + if (jQuery.tableDnD.dragObject == null) {
5624 + return;
5625 + }
5626 +
5627 + var dragObj = jQuery(jQuery.tableDnD.dragObject);
5628 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
5629 + var mousePos = jQuery.tableDnD.mouseCoords(ev);
5630 + var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
5631 + //auto scroll the window
5632 + var yOffset = window.pageYOffset;
5633 + if (document.all) {
5634 + // Windows version
5635 + //yOffset=document.body.scrollTop;
5636 + if (typeof document.compatMode != 'undefined' &&
5637 + document.compatMode != 'BackCompat') {
5638 + yOffset = document.documentElement.scrollTop;
5639 + }
5640 + else if (typeof document.body != 'undefined') {
5641 + yOffset=document.body.scrollTop;
5642 + }
5643 +
5644 + }
5645 +
5646 + if (mousePos.y-yOffset < config.scrollAmount) {
5647 + window.scrollBy(0, -config.scrollAmount);
5648 + } else {
5649 + var windowHeight = window.innerHeight ? window.innerHeight
5650 + : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
5651 + if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
5652 + window.scrollBy(0, config.scrollAmount);
5653 + }
5654 + }
5655 +
5656 +
5657 + if (y != jQuery.tableDnD.oldY) {
5658 + // work out if we're going up or down...
5659 + var movingDown = y > jQuery.tableDnD.oldY;
5660 + // update the old value
5661 + jQuery.tableDnD.oldY = y;
5662 + // update the style to show we're dragging
5663 + if (config.onDragClass) {
5664 + dragObj.addClass(config.onDragClass);
5665 + } else {
5666 + dragObj.css(config.onDragStyle);
5667 + }
5668 + // If we're over a row then move the dragged row to there so that the user sees the
5669 + // effect dynamically
5670 + var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
5671 + if (currentRow) {
5672 + // TODO worry about what happens when there are multiple TBODIES
5673 + if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
5674 + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
5675 + } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
5676 + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
5677 + }
5678 + }
5679 + }
5680 +
5681 + return false;
5682 + },
5683 +
5684 + /** We're only worried about the y position really, because we can only move rows up and down */
5685 + findDropTargetRow: function(draggedRow, y) {
5686 + var rows = jQuery.tableDnD.currentTable.rows;
5687 + for (var i=0; i<rows.length; i++) {
5688 + var row = rows[i];
5689 + var rowY = this.getPosition(row).y;
5690 + var rowHeight = parseInt(row.offsetHeight)/2;
5691 + if (row.offsetHeight == 0) {
5692 + rowY = this.getPosition(row.firstChild).y;
5693 + rowHeight = parseInt(row.firstChild.offsetHeight)/2;
5694 + }
5695 + // Because we always have to insert before, we need to offset the height a bit
5696 + if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
5697 + // that's the row we're over
5698 + // If it's the same as the current row, ignore it
5699 + if (row == draggedRow) {return null;}
5700 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
5701 + if (config.onAllowDrop) {
5702 + if (config.onAllowDrop(draggedRow, row)) {
5703 + return row;
5704 + } else {
5705 + return null;
5706 + }
5707 + } else {
5708 + // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
5709 + var nodrop = jQuery(row).hasClass("nodrop");
5710 + if (! nodrop) {
5711 + return row;
5712 + } else {
5713 + return null;
5714 + }
5715 + }
5716 + return row;
5717 + }
5718 + }
5719 + return null;
5720 + },
5721 +
5722 + mouseup: function(e) {
5723 + if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
5724 + var droppedRow = jQuery.tableDnD.dragObject;
5725 + var config = jQuery.tableDnD.currentTable.tableDnDConfig;
5726 + // If we have a dragObject, then we need to release it,
5727 + // The row will already have been moved to the right place so we just reset stuff
5728 + if (config.onDragClass) {
5729 + jQuery(droppedRow).removeClass(config.onDragClass);
5730 + } else {
5731 + jQuery(droppedRow).css(config.onDropStyle);
5732 + }
5733 + jQuery.tableDnD.dragObject = null;
5734 + if (config.onDrop) {
5735 + // Call the onDrop method if there is one
5736 + config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
5737 + }
5738 + jQuery.tableDnD.currentTable = null; // let go of the table too
5739 + }
5740 + },
5741 +
5742 + serialize: function() {
5743 + if (jQuery.tableDnD.currentTable) {
5744 + return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
5745 + } else {
5746 + return "Error: No Table id set, you need to set an id on your table and every row";
5747 + }
5748 + },
5749 +
5750 + serializeTable: function(table) {
5751 + var result = "";
5752 + var tableId = table.id;
5753 + var rows = table.rows;
5754 + for (var i=0; i<rows.length; i++) {
5755 + if (result.length > 0) result += "&";
5756 + var rowId = rows[i].id;
5757 + if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
5758 + rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
5759 + }
5760 +
5761 + result += tableId + '[]=' + rowId;
5762 + }
5763 + return result;
5764 + },
5765 +
5766 + serializeTables: function() {
5767 + var result = "";
5768 + this.each(function() {
5769 + // this is now bound to each matching table
5770 + result += jQuery.tableDnD.serializeTable(this);
5771 + });
5772 + return result;
5773 + }
5774 +
5775 +}
5776 +
5777 +jQuery.fn.extend(
5778 + {
5779 + tableDnD : jQuery.tableDnD.build,
5780 + tableDnDUpdate : jQuery.tableDnD.updateTables,
5781 + tableDnDSerialize: jQuery.tableDnD.serializeTables
5782 + }
5783 +);
5784 \ No newline at end of file
5785 diff -up cacti-0.8.8a/include/js/jquery/jquery.timepicker.js.legal cacti-0.8.8a/include/js/jquery/jquery.timepicker.js
5786 --- cacti-0.8.8a/include/js/jquery/jquery.timepicker.js.legal 2013-01-04 15:44:38.041416077 -0500
5787 +++ cacti-0.8.8a/include/js/jquery/jquery.timepicker.js 2013-01-04 15:43:12.645377988 -0500
5788 @@ -0,0 +1,1060 @@
5789 +/*
5790 +* jQuery timepicker addon
5791 +* By: Trent Richardson [http://trentrichardson.com]
5792 +* Version 0.9.6
5793 +* Last Modified: 07/20/2011
5794 +*
5795 +* Copyright 2011 Trent Richardson
5796 +* Dual licensed under the MIT and GPL licenses.
5797 +* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
5798 +* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
5799 +*
5800 +* HERES THE CSS:
5801 +* .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; }
5802 +* .ui-timepicker-div dl{ text-align: left; }
5803 +* .ui-timepicker-div dl dt{ height: 25px; }
5804 +* .ui-timepicker-div dl dd{ margin: -25px 10px 10px 65px; }
5805 +* .ui-timepicker-div td { font-size: 90%; }
5806 +*/
5807 +
5808 +(function($) {
5809 +
5810 +$.extend($.ui, { timepicker: { version: "0.9.6" } });
5811 +
5812 +/* Time picker manager.
5813 + Use the singleton instance of this class, $.timepicker, to interact with the time picker.
5814 + Settings for (groups of) time pickers are maintained in an instance object,
5815 + allowing multiple different settings on the same page. */
5816 +
5817 +function Timepicker() {
5818 + this.regional = []; // Available regional settings, indexed by language code
5819 + this.regional[''] = { // Default regional settings
5820 + currentText: 'Now',
5821 + closeText: 'Done',
5822 + ampm: false,
5823 + timeFormat: 'hh:mm tt',
5824 + timeSuffix: '',
5825 + timeOnlyTitle: 'Choose Time',
5826 + timeText: 'Time',
5827 + hourText: 'Hour',
5828 + minuteText: 'Minute',
5829 + secondText: 'Second',
5830 + timezoneText: 'Time Zone'
5831 + };
5832 + this._defaults = { // Global defaults for all the datetime picker instances
5833 + showButtonPanel: true,
5834 + timeOnly: false,
5835 + showHour: true,
5836 + showMinute: true,
5837 + showSecond: false,
5838 + showTimezone: false,
5839 + showTime: true,
5840 + stepHour: 0.05,
5841 + stepMinute: 0.05,
5842 + stepSecond: 0.05,
5843 + hour: 0,
5844 + minute: 0,
5845 + second: 0,
5846 + timezone: '+0000',
5847 + hourMin: 0,
5848 + minuteMin: 0,
5849 + secondMin: 0,
5850 + hourMax: 23,
5851 + minuteMax: 59,
5852 + secondMax: 59,
5853 + minDateTime: null,
5854 + maxDateTime: null,
5855 + hourGrid: 0,
5856 + minuteGrid: 0,
5857 + secondGrid: 0,
5858 + alwaysSetTime: true,
5859 + separator: ' ',
5860 + altFieldTimeOnly: true,
5861 + showTimepicker: true,
5862 + timezoneList: ["-1100", "-1000", "-0900", "-0800", "-0700", "-0600",
5863 + "-0500", "-0400", "-0300", "-0200", "-0100", "+0000",
5864 + "+0100", "+0200", "+0300", "+0400", "+0500", "+0600",
5865 + "+0700", "+0800", "+0900", "+1000", "+1100", "+1200"]
5866 + };
5867 + $.extend(this._defaults, this.regional['']);
5868 +}
5869 +
5870 +$.extend(Timepicker.prototype, {
5871 + $input: null,
5872 + $altInput: null,
5873 + $timeObj: null,
5874 + inst: null,
5875 + hour_slider: null,
5876 + minute_slider: null,
5877 + second_slider: null,
5878 + timezone_select: null,
5879 + hour: 0,
5880 + minute: 0,
5881 + second: 0,
5882 + timezone: '+0000',
5883 + hourMinOriginal: null,
5884 + minuteMinOriginal: null,
5885 + secondMinOriginal: null,
5886 + hourMaxOriginal: null,
5887 + minuteMaxOriginal: null,
5888 + secondMaxOriginal: null,
5889 + ampm: '',
5890 + formattedDate: '',
5891 + formattedTime: '',
5892 + formattedDateTime: '',
5893 + timezoneList: ["-1100", "-1000", "-0900", "-0800", "-0700", "-0600",
5894 + "-0500", "-0400", "-0300", "-0200", "-0100", "+0000",
5895 + "+0100", "+0200", "+0300", "+0400", "+0500", "+0600",
5896 + "+0700", "+0800", "+0900", "+1000", "+1100", "+1200"],
5897 +
5898 + /* Override the default settings for all instances of the time picker.
5899 + @param settings object - the new settings to use as defaults (anonymous object)
5900 + @return the manager object */
5901 + setDefaults: function(settings) {
5902 + extendRemove(this._defaults, settings || {});
5903 + return this;
5904 + },
5905 +
5906 + //########################################################################
5907 + // Create a new Timepicker instance
5908 + //########################################################################
5909 + _newInst: function($input, o) {
5910 + var tp_inst = new Timepicker(),
5911 + inlineSettings = {};
5912 +
5913 + for (var attrName in this._defaults) {
5914 + var attrValue = $input.attr('time:' + attrName);
5915 + if (attrValue) {
5916 + try {
5917 + inlineSettings[attrName] = eval(attrValue);
5918 + } catch (err) {
5919 + inlineSettings[attrName] = attrValue;
5920 + }
5921 + }
5922 + }
5923 + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, {
5924 + beforeShow: function(input, dp_inst) {
5925 + if ($.isFunction(o.beforeShow))
5926 + o.beforeShow(input, dp_inst, tp_inst);
5927 + },
5928 + onChangeMonthYear: function(year, month, dp_inst) {
5929 + // Update the time as well : this prevents the time from disappearing from the $input field.
5930 + tp_inst._updateDateTime(dp_inst);
5931 + if ($.isFunction(o.onChangeMonthYear))
5932 + o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
5933 + },
5934 + onClose: function(dateText, dp_inst) {
5935 + if (tp_inst.timeDefined === true && $input.val() != '')
5936 + tp_inst._updateDateTime(dp_inst);
5937 + if ($.isFunction(o.onClose))
5938 + o.onClose.call($input[0], dateText, dp_inst, tp_inst);
5939 + },
5940 + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
5941 + });
5942 +
5943 + tp_inst.hour = tp_inst._defaults.hour;
5944 + tp_inst.minute = tp_inst._defaults.minute;
5945 + tp_inst.second = tp_inst._defaults.second;
5946 + tp_inst.ampm = '';
5947 + tp_inst.$input = $input;
5948 +
5949 + if (o.altField)
5950 + tp_inst.$altInput = $(o.altField)
5951 + .css({ cursor: 'pointer' })
5952 + .focus(function(){ $input.trigger("focus"); });
5953 +
5954 + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
5955 + if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date)
5956 + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
5957 + if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date)
5958 + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
5959 + if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date)
5960 + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
5961 + if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date)
5962 + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
5963 +
5964 + return tp_inst;
5965 + },
5966 +
5967 + //########################################################################
5968 + // add our sliders to the calendar
5969 + //########################################################################
5970 + _addTimePicker: function(dp_inst) {
5971 + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ?
5972 + this.$input.val() + ' ' + this.$altInput.val() :
5973 + this.$input.val();
5974 +
5975 + this.timeDefined = this._parseTime(currDT);
5976 + this._limitMinMaxDateTime(dp_inst, false);
5977 + this._injectTimePicker();
5978 + },
5979 +
5980 + //########################################################################
5981 + // parse the time string from input value or _setTime
5982 + //########################################################################
5983 + _parseTime: function(timeString, withDate) {
5984 + var regstr = this._defaults.timeFormat.toString()
5985 + .replace(/h{1,2}/ig, '(\\d?\\d)')
5986 + .replace(/m{1,2}/ig, '(\\d?\\d)')
5987 + .replace(/s{1,2}/ig, '(\\d?\\d)')
5988 + .replace(/t{1,2}/ig, '(am|pm|a|p)?')
5989 + .replace(/z{1}/ig, '((\\+|-)\\d\\d\\d\\d)?')
5990 + .replace(/\s/g, '\\s?') + this._defaults.timeSuffix + '$',
5991 + order = this._getFormatPositions(),
5992 + treg;
5993 +
5994 + if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]);
5995 +
5996 + if (withDate || !this._defaults.timeOnly) {
5997 + // the time should come after x number of characters and a space.
5998 + // x = at least the length of text specified by the date format
5999 + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
6000 + // escape special regex characters in the seperator
6001 + var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g");
6002 + regstr = '.{' + dp_dateFormat.length + ',}' + this._defaults.separator.replace(specials, "\\$&") + regstr;
6003 + }
6004 +
6005 + treg = timeString.match(new RegExp(regstr, 'i'));
6006 +
6007 + if (treg) {
6008 + if (order.t !== -1)
6009 + this.ampm = ((treg[order.t] === undefined || treg[order.t].length === 0) ?
6010 + '' :
6011 + (treg[order.t].charAt(0).toUpperCase() == 'A') ? 'AM' : 'PM').toUpperCase();
6012 +
6013 + if (order.h !== -1) {
6014 + if (this.ampm == 'AM' && treg[order.h] == '12')
6015 + this.hour = 0; // 12am = 0 hour
6016 + else if (this.ampm == 'PM' && treg[order.h] != '12')
6017 + this.hour = (parseFloat(treg[order.h]) + 12).toFixed(0); // 12pm = 12 hour, any other pm = hour + 12
6018 + else this.hour = Number(treg[order.h]);
6019 + }
6020 +
6021 + if (order.m !== -1) this.minute = Number(treg[order.m]);
6022 + if (order.s !== -1) this.second = Number(treg[order.s]);
6023 + if (order.z !== -1) this.timezone = treg[order.z];
6024 +
6025 + return true;
6026 +
6027 + }
6028 + return false;
6029 + },
6030 +
6031 + //########################################################################
6032 + // figure out position of time elements.. cause js cant do named captures
6033 + //########################################################################
6034 + _getFormatPositions: function() {
6035 + var finds = this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|t{1,2}|z)/g),
6036 + orders = { h: -1, m: -1, s: -1, t: -1, z: -1 };
6037 +
6038 + if (finds)
6039 + for (var i = 0; i < finds.length; i++)
6040 + if (orders[finds[i].toString().charAt(0)] == -1)
6041 + orders[finds[i].toString().charAt(0)] = i + 1;
6042 +
6043 + return orders;
6044 + },
6045 +
6046 + //########################################################################
6047 + // generate and inject html for timepicker into ui datepicker
6048 + //########################################################################
6049 + _injectTimePicker: function() {
6050 + var $dp = this.inst.dpDiv,
6051 + o = this._defaults,
6052 + tp_inst = this,
6053 + // Added by Peter Medeiros:
6054 + // - Figure out what the hour/minute/second max should be based on the step values.
6055 + // - Example: if stepMinute is 15, then minMax is 45.
6056 + hourMax = (o.hourMax - (o.hourMax % o.stepHour)).toFixed(0),
6057 + minMax = (o.minuteMax - (o.minuteMax % o.stepMinute)).toFixed(0),
6058 + secMax = (o.secondMax - (o.secondMax % o.stepSecond)).toFixed(0),
6059 + dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, '');
6060 +
6061 + // Prevent displaying twice
6062 + //if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) {
6063 + if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) {
6064 + var noDisplay = ' style="display:none;"',
6065 + html = '<div class="ui-timepicker-div" id="ui-timepicker-div-' + dp_id + '"><dl>' +
6066 + '<dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_' + dp_id + '"' +
6067 + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
6068 + '<dd class="ui_tpicker_time" id="ui_tpicker_time_' + dp_id + '"' +
6069 + ((o.showTime) ? '' : noDisplay) + '></dd>' +
6070 + '<dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_' + dp_id + '"' +
6071 + ((o.showHour) ? '' : noDisplay) + '>' + o.hourText + '</dt>',
6072 + hourGridSize = 0,
6073 + minuteGridSize = 0,
6074 + secondGridSize = 0,
6075 + size;
6076 +
6077 + if (o.showHour && o.hourGrid > 0) {
6078 + html += '<dd class="ui_tpicker_hour">' +
6079 + '<div id="ui_tpicker_hour_' + dp_id + '"' + ((o.showHour) ? '' : noDisplay) + '></div>' +
6080 + '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
6081 +
6082 + for (var h = o.hourMin; h <= hourMax; h += o.hourGrid) {
6083 + hourGridSize++;
6084 + var tmph = (o.ampm && h > 12) ? h-12 : h;
6085 + if (tmph < 10) tmph = '0' + tmph;
6086 + if (o.ampm) {
6087 + if (h == 0) tmph = 12 +'a';
6088 + else if (h < 12) tmph += 'a';
6089 + else tmph += 'p';
6090 + }
6091 + html += '<td>' + tmph + '</td>';
6092 + }
6093 +
6094 + html += '</tr></table></div>' +
6095 + '</dd>';
6096 + } else html += '<dd class="ui_tpicker_hour" id="ui_tpicker_hour_' + dp_id + '"' +
6097 + ((o.showHour) ? '' : noDisplay) + '></dd>';
6098 +
6099 + html += '<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_' + dp_id + '"' +
6100 + ((o.showMinute) ? '' : noDisplay) + '>' + o.minuteText + '</dt>';
6101 +
6102 + if (o.showMinute && o.minuteGrid > 0) {
6103 + html += '<dd class="ui_tpicker_minute ui_tpicker_minute_' + o.minuteGrid + '">' +
6104 + '<div id="ui_tpicker_minute_' + dp_id + '"' +
6105 + ((o.showMinute) ? '' : noDisplay) + '></div>' +
6106 + '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
6107 +
6108 + for (var m = o.minuteMin; m <= minMax; m += o.minuteGrid) {
6109 + minuteGridSize++;
6110 + html += '<td>' + ((m < 10) ? '0' : '') + m + '</td>';
6111 + }
6112 +
6113 + html += '</tr></table></div>' +
6114 + '</dd>';
6115 + } else html += '<dd class="ui_tpicker_minute" id="ui_tpicker_minute_' + dp_id + '"' +
6116 + ((o.showMinute) ? '' : noDisplay) + '></dd>';
6117 +
6118 + html += '<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_' + dp_id + '"' +
6119 + ((o.showSecond) ? '' : noDisplay) + '>' + o.secondText + '</dt>';
6120 +
6121 + if (o.showSecond && o.secondGrid > 0) {
6122 + html += '<dd class="ui_tpicker_second ui_tpicker_second_' + o.secondGrid + '">' +
6123 + '<div id="ui_tpicker_second_' + dp_id + '"' +
6124 + ((o.showSecond) ? '' : noDisplay) + '></div>' +
6125 + '<div style="padding-left: 1px"><table><tr>';
6126 +
6127 + for (var s = o.secondMin; s <= secMax; s += o.secondGrid) {
6128 + secondGridSize++;
6129 + html += '<td>' + ((s < 10) ? '0' : '') + s + '</td>';
6130 + }
6131 +
6132 + html += '</tr></table></div>' +
6133 + '</dd>';
6134 + } else html += '<dd class="ui_tpicker_second" id="ui_tpicker_second_' + dp_id + '"' +
6135 + ((o.showSecond) ? '' : noDisplay) + '></dd>';
6136 +
6137 + html += '<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_' + dp_id + '"' +
6138 + ((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
6139 + html += '<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_' + dp_id + '"' +
6140 + ((o.showTimezone) ? '' : noDisplay) + '></dd>';
6141 +
6142 + html += '</dl></div>';
6143 + $tp = $(html);
6144 +
6145 + // if we only want time picker...
6146 + if (o.timeOnly === true) {
6147 + $tp.prepend(
6148 + '<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' +
6149 + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' +
6150 + '</div>');
6151 + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
6152 + }
6153 +
6154 + this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({
6155 + orientation: "horizontal",
6156 + value: this.hour,
6157 + min: o.hourMin,
6158 + max: hourMax,
6159 + step: o.stepHour,
6160 + slide: function(event, ui) {
6161 + tp_inst.hour_slider.slider( "option", "value", ui.value);
6162 + tp_inst._onTimeChange();
6163 + }
6164 + });
6165 +
6166 + // Updated by Peter Medeiros:
6167 + // - Pass in Event and UI instance into slide function
6168 + this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({
6169 + orientation: "horizontal",
6170 + value: this.minute,
6171 + min: o.minuteMin,
6172 + max: minMax,
6173 + step: o.stepMinute,
6174 + slide: function(event, ui) {
6175 + // update the global minute slider instance value with the current slider value
6176 + tp_inst.minute_slider.slider( "option", "value", ui.value);
6177 + tp_inst._onTimeChange();
6178 + }
6179 + });
6180 +
6181 + this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
6182 + orientation: "horizontal",
6183 + value: this.second,
6184 + min: o.secondMin,
6185 + max: secMax,
6186 + step: o.stepSecond,
6187 + slide: function(event, ui) {
6188 + tp_inst.second_slider.slider( "option", "value", ui.value);
6189 + tp_inst._onTimeChange();
6190 + }
6191 + });
6192 +
6193 +
6194 + this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('<select></select>').find("select");
6195 + $.fn.append.apply(this.timezone_select,
6196 + $.map(o.timezoneList, function(val, idx) {
6197 + return $("<option />")
6198 + .val(typeof val == "object" ? val.value : val)
6199 + .text(typeof val == "object" ? val.label : val);
6200 + })
6201 + );
6202 + this.timezone_select.val((typeof this.timezone != "undefined" && this.timezone != null && this.timezone != "") ? this.timezone : o.timezone);
6203 + this.timezone_select.change(function() {
6204 + tp_inst._onTimeChange();
6205 + });
6206 +
6207 + // Add grid functionality
6208 + if (o.showHour && o.hourGrid > 0) {
6209 + size = 100 * hourGridSize * o.hourGrid / (hourMax - o.hourMin);
6210 +
6211 + $tp.find(".ui_tpicker_hour table").css({
6212 + width: size + "%",
6213 + marginLeft: (size / (-2 * hourGridSize)) + "%",
6214 + borderCollapse: 'collapse'
6215 + }).find("td").each( function(index) {
6216 + $(this).click(function() {
6217 + var h = $(this).html();
6218 + if(o.ampm) {
6219 + var ap = h.substring(2).toLowerCase(),
6220 + aph = parseInt(h.substring(0,2), 10);
6221 + if (ap == 'a') {
6222 + if (aph == 12) h = 0;
6223 + else h = aph;
6224 + } else if (aph == 12) h = 12;
6225 + else h = aph + 12;
6226 + }
6227 + tp_inst.hour_slider.slider("option", "value", h);
6228 + tp_inst._onTimeChange();
6229 + tp_inst._onSelectHandler();
6230 + }).css({
6231 + cursor: 'pointer',
6232 + width: (100 / hourGridSize) + '%',
6233 + textAlign: 'center',
6234 + overflow: 'hidden'
6235 + });
6236 + });
6237 + }
6238 +
6239 + if (o.showMinute && o.minuteGrid > 0) {
6240 + size = 100 * minuteGridSize * o.minuteGrid / (minMax - o.minuteMin);
6241 + $tp.find(".ui_tpicker_minute table").css({
6242 + width: size + "%",
6243 + marginLeft: (size / (-2 * minuteGridSize)) + "%",
6244 + borderCollapse: 'collapse'
6245 + }).find("td").each(function(index) {
6246 + $(this).click(function() {
6247 + tp_inst.minute_slider.slider("option", "value", $(this).html());
6248 + tp_inst._onTimeChange();
6249 + tp_inst._onSelectHandler();
6250 + }).css({
6251 + cursor: 'pointer',
6252 + width: (100 / minuteGridSize) + '%',
6253 + textAlign: 'center',
6254 + overflow: 'hidden'
6255 + });
6256 + });
6257 + }
6258 +
6259 + if (o.showSecond && o.secondGrid > 0) {
6260 + $tp.find(".ui_tpicker_second table").css({
6261 + width: size + "%",
6262 + marginLeft: (size / (-2 * secondGridSize)) + "%",
6263 + borderCollapse: 'collapse'
6264 + }).find("td").each(function(index) {
6265 + $(this).click(function() {
6266 + tp_inst.second_slider.slider("option", "value", $(this).html());
6267 + tp_inst._onTimeChange();
6268 + tp_inst._onSelectHandler();
6269 + }).css({
6270 + cursor: 'pointer',
6271 + width: (100 / secondGridSize) + '%',
6272 + textAlign: 'center',
6273 + overflow: 'hidden'
6274 + });
6275 + });
6276 + }
6277 +
6278 + var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
6279 + if ($buttonPanel.length) $buttonPanel.before($tp);
6280 + else $dp.append($tp);
6281 +
6282 + this.$timeObj = $tp.find('#ui_tpicker_time_'+ dp_id);
6283 +
6284 + if (this.inst !== null) {
6285 + var timeDefined = this.timeDefined;
6286 + this._onTimeChange();
6287 + this.timeDefined = timeDefined;
6288 + }
6289 +
6290 + //Emulate datepicker onSelect behavior. Call on slidestop.
6291 + var onSelectDelegate = function() {
6292 + tp_inst._onSelectHandler();
6293 + };
6294 + this.hour_slider.bind('slidestop',onSelectDelegate);
6295 + this.minute_slider.bind('slidestop',onSelectDelegate);
6296 + this.second_slider.bind('slidestop',onSelectDelegate);
6297 + }
6298 + },
6299 +
6300 + //########################################################################
6301 + // This function tries to limit the ability to go outside the
6302 + // min/max date range
6303 + //########################################################################
6304 + _limitMinMaxDateTime: function(dp_inst, adjustSliders){
6305 + var o = this._defaults,
6306 + dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
6307 +
6308 + if(!this._defaults.showTimepicker) return; // No time so nothing to check here
6309 +
6310 + if($.datepicker._get(dp_inst, 'minDateTime') !== null && dp_date){
6311 + var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
6312 + minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
6313 +
6314 + if(this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null){
6315 + this.hourMinOriginal = o.hourMin;
6316 + this.minuteMinOriginal = o.minuteMin;
6317 + this.secondMinOriginal = o.secondMin;
6318 + }
6319 +
6320 + if(dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
6321 + this._defaults.hourMin = minDateTime.getHours();
6322 + if (this.hour <= this._defaults.hourMin) {
6323 + this.hour = this._defaults.hourMin;
6324 + this._defaults.minuteMin = minDateTime.getMinutes();
6325 + if (this.minute <= this._defaults.minuteMin) {
6326 + this.minute = this._defaults.minuteMin;
6327 + this._defaults.secondMin = minDateTime.getSeconds();
6328 + } else {
6329 + if(this.second < this._defaults.secondMin) this.second = this._defaults.secondMin;
6330 + this._defaults.secondMin = this.secondMinOriginal;
6331 + }
6332 + } else {
6333 + this._defaults.minuteMin = this.minuteMinOriginal;
6334 + this._defaults.secondMin = this.secondMinOriginal;
6335 + }
6336 + }else{
6337 + this._defaults.hourMin = this.hourMinOriginal;
6338 + this._defaults.minuteMin = this.minuteMinOriginal;
6339 + this._defaults.secondMin = this.secondMinOriginal;
6340 + }
6341 + }
6342 +
6343 + if($.datepicker._get(dp_inst, 'maxDateTime') !== null && dp_date){
6344 + var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
6345 + maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
6346 +
6347 + if(this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null){
6348 + this.hourMaxOriginal = o.hourMax;
6349 + this.minuteMaxOriginal = o.minuteMax;
6350 + this.secondMaxOriginal = o.secondMax;
6351 + }
6352 +
6353 + if(dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()){
6354 + this._defaults.hourMax = maxDateTime.getHours();
6355 + if (this.hour >= this._defaults.hourMax) {
6356 + this.hour = this._defaults.hourMax;
6357 + this._defaults.minuteMax = maxDateTime.getMinutes();
6358 + if (this.minute >= this._defaults.minuteMax) {
6359 + this.minute = this._defaults.minuteMax;
6360 + this._defaults.secondMax = maxDateTime.getSeconds();
6361 + } else {
6362 + if(this.second > this._defaults.secondMax) this.second = this._defaults.secondMax;
6363 + this._defaults.secondMax = this.secondMaxOriginal;
6364 + }
6365 + } else {
6366 + this._defaults.minuteMax = this.minuteMaxOriginal;
6367 + this._defaults.secondMax = this.secondMaxOriginal;
6368 + }
6369 + }else{
6370 + this._defaults.hourMax = this.hourMaxOriginal;
6371 + this._defaults.minuteMax = this.minuteMaxOriginal;
6372 + this._defaults.secondMax = this.secondMaxOriginal;
6373 + }
6374 + }
6375 +
6376 + if(adjustSliders !== undefined && adjustSliders === true){
6377 + var hourMax = (this._defaults.hourMax - (this._defaults.hourMax % this._defaults.stepHour)).toFixed(0),
6378 + minMax = (this._defaults.minuteMax - (this._defaults.minuteMax % this._defaults.stepMinute)).toFixed(0),
6379 + secMax = (this._defaults.secondMax - (this._defaults.secondMax % this._defaults.stepSecond)).toFixed(0);
6380 +
6381 + if(this.hour_slider)
6382 + this.hour_slider.slider("option", { min: this._defaults.hourMin, max: hourMax }).slider('value', this.hour);
6383 + if(this.minute_slider)
6384 + this.minute_slider.slider("option", { min: this._defaults.minuteMin, max: minMax }).slider('value', this.minute);
6385 + if(this.second_slider)
6386 + this.second_slider.slider("option", { min: this._defaults.secondMin, max: secMax }).slider('value', this.second);
6387 + }
6388 +
6389 + },
6390 +
6391 +
6392 + //########################################################################
6393 + // when a slider moves, set the internal time...
6394 + // on time change is also called when the time is updated in the text field
6395 + //########################################################################
6396 + _onTimeChange: function() {
6397 + var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
6398 + minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
6399 + second = (this.second_slider) ? this.second_slider.slider('value') : false,
6400 + timezone = (this.timezone_select) ? this.timezone_select.val() : false;
6401 +
6402 + if (typeof(hour) == 'object') hour = false;
6403 + if (typeof(minute) == 'object') minute = false;
6404 + if (typeof(second) == 'object') second = false;
6405 + if (typeof(timezone) == 'object') timezone = false;
6406 +
6407 + if (hour !== false) hour = parseInt(hour,10);
6408 + if (minute !== false) minute = parseInt(minute,10);
6409 + if (second !== false) second = parseInt(second,10);
6410 +
6411 + var ampm = (hour < 12) ? 'AM' : 'PM';
6412 +
6413 + // If the update was done in the input field, the input field should not be updated.
6414 + // If the update was done using the sliders, update the input field.
6415 + var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || (this.ampm.length > 0 && this.ampm != ampm) || timezone != this.timezone);
6416 +
6417 + if (hasChanged) {
6418 +
6419 + if (hour !== false)this.hour = hour;
6420 + if (minute !== false) this.minute = minute;
6421 + if (second !== false) this.second = second;
6422 + if (timezone !== false) this.timezone = timezone;
6423 +
6424 + if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]);
6425 +
6426 + this._limitMinMaxDateTime(this.inst, true);
6427 + }
6428 + if (this._defaults.ampm) this.ampm = ampm;
6429 +
6430 + this._formatTime();
6431 + if (this.$timeObj) this.$timeObj.text(this.formattedTime + this._defaults.timeSuffix);
6432 + this.timeDefined = true;
6433 + if (hasChanged) this._updateDateTime();
6434 + },
6435 +
6436 + //########################################################################
6437 + // call custom onSelect.
6438 + // bind to sliders slidestop, and grid click.
6439 + //########################################################################
6440 + _onSelectHandler: function() {
6441 + var onSelect = this._defaults['onSelect'];
6442 + var inputEl = this.$input ? this.$input[0] : null;
6443 + if (onSelect && inputEl) {
6444 + onSelect.apply(inputEl, [this.formattedDateTime, this]);
6445 + }
6446 + },
6447 +
6448 + //########################################################################
6449 + // format the time all pretty...
6450 + //########################################################################
6451 + _formatTime: function(time, format, ampm) {
6452 + if (ampm == undefined) ampm = this._defaults.ampm;
6453 + time = time || { hour: this.hour, minute: this.minute, second: this.second, ampm: this.ampm, timezone: this.timezone };
6454 + var tmptime = format || this._defaults.timeFormat.toString();
6455 +
6456 + if (ampm) {
6457 + var hour12 = ((time.ampm == 'AM') ? (time.hour) : (time.hour % 12));
6458 + hour12 = (Number(hour12) === 0) ? 12 : hour12;
6459 + tmptime = tmptime.toString()
6460 + .replace(/hh/g, ((hour12 < 10) ? '0' : '') + hour12)
6461 + .replace(/h/g, hour12)
6462 + .replace(/mm/g, ((time.minute < 10) ? '0' : '') + time.minute)
6463 + .replace(/m/g, time.minute)
6464 + .replace(/ss/g, ((time.second < 10) ? '0' : '') + time.second)
6465 + .replace(/s/g, time.second)
6466 + .replace(/TT/g, time.ampm.toUpperCase())
6467 + .replace(/Tt/g, time.ampm.toUpperCase())
6468 + .replace(/tT/g, time.ampm.toLowerCase())
6469 + .replace(/tt/g, time.ampm.toLowerCase())
6470 + .replace(/T/g, time.ampm.charAt(0).toUpperCase())
6471 + .replace(/t/g, time.ampm.charAt(0).toLowerCase())
6472 + .replace(/z/g, time.timezone);
6473 + } else {
6474 + tmptime = tmptime.toString()
6475 + .replace(/hh/g, ((time.hour < 10) ? '0' : '') + time.hour)
6476 + .replace(/h/g, time.hour)
6477 + .replace(/mm/g, ((time.minute < 10) ? '0' : '') + time.minute)
6478 + .replace(/m/g, time.minute)
6479 + .replace(/ss/g, ((time.second < 10) ? '0' : '') + time.second)
6480 + .replace(/s/g, time.second)
6481 + .replace(/z/g, time.timezone);
6482 + tmptime = $.trim(tmptime.replace(/t/gi, ''));
6483 + }
6484 +
6485 + if (arguments.length) return tmptime;
6486 + else this.formattedTime = tmptime;
6487 + },
6488 +
6489 + //########################################################################
6490 + // update our input with the new date time..
6491 + //########################################################################
6492 + _updateDateTime: function(dp_inst) {
6493 + dp_inst = this.inst || dp_inst,
6494 + dt = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay),
6495 + dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
6496 + formatCfg = $.datepicker._getFormatConfig(dp_inst),
6497 + timeAvailable = dt !== null && this.timeDefined;
6498 + this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
6499 + var formattedDateTime = this.formattedDate;
6500 + if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0))
6501 + return;
6502 +
6503 + if (this._defaults.timeOnly === true) {
6504 + formattedDateTime = this.formattedTime;
6505 + } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
6506 + formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
6507 + }
6508 +
6509 + this.formattedDateTime = formattedDateTime;
6510 +
6511 + if(!this._defaults.showTimepicker) {
6512 + this.$input.val(this.formattedDate);
6513 + } else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
6514 + this.$altInput.val(this.formattedTime);
6515 + this.$input.val(this.formattedDate);
6516 + } else if(this.$altInput) {
6517 + this.$altInput.val(formattedDateTime);
6518 + this.$input.val(formattedDateTime);
6519 + } else {
6520 + this.$input.val(formattedDateTime);
6521 + }
6522 +
6523 + this.$input.trigger("change");
6524 + }
6525 +
6526 +});
6527 +
6528 +$.fn.extend({
6529 + //########################################################################
6530 + // shorthand just to use timepicker..
6531 + //########################################################################
6532 + timepicker: function(o) {
6533 + o = o || {};
6534 + var tmp_args = arguments;
6535 +
6536 + if (typeof o == 'object') tmp_args[0] = $.extend(o, { timeOnly: true });
6537 +
6538 + return $(this).each(function() {
6539 + $.fn.datetimepicker.apply($(this), tmp_args);
6540 + });
6541 + },
6542 +
6543 + //########################################################################
6544 + // extend timepicker to datepicker
6545 + //########################################################################
6546 + datetimepicker: function(o) {
6547 + o = o || {};
6548 + var $input = this,
6549 + tmp_args = arguments;
6550 +
6551 + if (typeof(o) == 'string'){
6552 + if(o == 'getDate')
6553 + return $.fn.datepicker.apply($(this[0]), tmp_args);
6554 + else
6555 + return this.each(function() {
6556 + var $t = $(this);
6557 + $t.datepicker.apply($t, tmp_args);
6558 + });
6559 + }
6560 + else
6561 + return this.each(function() {
6562 + var $t = $(this);
6563 + $t.datepicker($.timepicker._newInst($t, o)._defaults);
6564 + });
6565 + }
6566 +});
6567 +
6568 +//########################################################################
6569 +// the bad hack :/ override datepicker so it doesnt close on select
6570 +// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
6571 +//########################################################################
6572 +$.datepicker._base_selectDate = $.datepicker._selectDate;
6573 +$.datepicker._selectDate = function (id, dateStr) {
6574 + var inst = this._getInst($(id)[0]),
6575 + tp_inst = this._get(inst, 'timepicker');
6576 +
6577 + if (tp_inst) {
6578 + tp_inst._limitMinMaxDateTime(inst, true);
6579 + inst.inline = inst.stay_open = true;
6580 + //This way the onSelect handler called from calendarpicker get the full dateTime
6581 + this._base_selectDate(id, dateStr + tp_inst._defaults.separator + tp_inst.formattedTime + tp_inst._defaults.timeSuffix);
6582 + inst.inline = inst.stay_open = false;
6583 + this._notifyChange(inst);
6584 + this._updateDatepicker(inst);
6585 + }
6586 + else this._base_selectDate(id, dateStr);
6587 +};
6588 +
6589 +//#############################################################################################
6590 +// second bad hack :/ override datepicker so it triggers an event when changing the input field
6591 +// and does not redraw the datepicker on every selectDate event
6592 +//#############################################################################################
6593 +$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
6594 +$.datepicker._updateDatepicker = function(inst) {
6595 +
6596 + // don't popup the datepicker if there is another instance already opened
6597 + var input = inst.input[0];
6598 + if($.datepicker._curInst &&
6599 + $.datepicker._curInst != inst &&
6600 + $.datepicker._datepickerShowing &&
6601 + $.datepicker._lastInput != input) {
6602 + return;
6603 + }
6604 +
6605 + if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
6606 +
6607 + this._base_updateDatepicker(inst);
6608 +
6609 + // Reload the time control when changing something in the input text field.
6610 + var tp_inst = this._get(inst, 'timepicker');
6611 + if(tp_inst) tp_inst._addTimePicker(inst);
6612 + }
6613 +};
6614 +
6615 +//#######################################################################################
6616 +// third bad hack :/ override datepicker so it allows spaces and colon in the input field
6617 +//#######################################################################################
6618 +$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
6619 +$.datepicker._doKeyPress = function(event) {
6620 + var inst = $.datepicker._getInst(event.target),
6621 + tp_inst = $.datepicker._get(inst, 'timepicker');
6622 +
6623 + if (tp_inst) {
6624 + if ($.datepicker._get(inst, 'constrainInput')) {
6625 + var ampm = tp_inst._defaults.ampm,
6626 + dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
6627 + datetimeChars = tp_inst._defaults.timeFormat.toString()
6628 + .replace(/[hms]/g, '')
6629 + .replace(/TT/g, ampm ? 'APM' : '')
6630 + .replace(/Tt/g, ampm ? 'AaPpMm' : '')
6631 + .replace(/tT/g, ampm ? 'AaPpMm' : '')
6632 + .replace(/T/g, ampm ? 'AP' : '')
6633 + .replace(/tt/g, ampm ? 'apm' : '')
6634 + .replace(/t/g, ampm ? 'ap' : '') +
6635 + " " +
6636 + tp_inst._defaults.separator +
6637 + tp_inst._defaults.timeSuffix +
6638 + (tp_inst._defaults.showTimezone ? tp_inst._defaults.timezoneList.join('') : '') +
6639 + dateChars,
6640 + chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
6641 + return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
6642 + }
6643 + }
6644 +
6645 + return $.datepicker._base_doKeyPress(event);
6646 +};
6647 +
6648 +//#######################################################################################
6649 +// Override key up event to sync manual input changes.
6650 +//#######################################################################################
6651 +$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
6652 +$.datepicker._doKeyUp = function (event) {
6653 + var inst = $.datepicker._getInst(event.target),
6654 + tp_inst = $.datepicker._get(inst, 'timepicker');
6655 +
6656 + if (tp_inst) {
6657 + if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
6658 + try {
6659 + $.datepicker._updateDatepicker(inst);
6660 + }
6661 + catch (err) {
6662 + $.datepicker.log(err);
6663 + }
6664 + }
6665 + }
6666 +
6667 + return $.datepicker._base_doKeyUp(event);
6668 +};
6669 +
6670 +//#######################################################################################
6671 +// override "Today" button to also grab the time.
6672 +//#######################################################################################
6673 +$.datepicker._base_gotoToday = $.datepicker._gotoToday;
6674 +$.datepicker._gotoToday = function(id) {
6675 + this._base_gotoToday(id);
6676 + this._setTime(this._getInst($(id)[0]), new Date());
6677 +};
6678 +
6679 +//#######################################################################################
6680 +// Disable & enable the Time in the datetimepicker
6681 +//#######################################################################################
6682 +$.datepicker._disableTimepickerDatepicker = function(target, date, withDate) {
6683 + var inst = this._getInst(target),
6684 + tp_inst = this._get(inst, 'timepicker');
6685 + $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
6686 + if (tp_inst) {
6687 + tp_inst._defaults.showTimepicker = false;
6688 + tp_inst._updateDateTime(inst);
6689 + }
6690 +};
6691 +
6692 +$.datepicker._enableTimepickerDatepicker = function(target, date, withDate) {
6693 + var inst = this._getInst(target),
6694 + tp_inst = this._get(inst, 'timepicker');
6695 + $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
6696 + if (tp_inst) {
6697 + tp_inst._defaults.showTimepicker = true;
6698 + tp_inst._addTimePicker(inst); // Could be disabled on page load
6699 + tp_inst._updateDateTime(inst);
6700 + }
6701 +};
6702 +
6703 +//#######################################################################################
6704 +// Create our own set time function
6705 +//#######################################################################################
6706 +$.datepicker._setTime = function(inst, date) {
6707 + var tp_inst = this._get(inst, 'timepicker');
6708 + if (tp_inst) {
6709 + var defaults = tp_inst._defaults,
6710 + // calling _setTime with no date sets time to defaults
6711 + hour = date ? date.getHours() : defaults.hour,
6712 + minute = date ? date.getMinutes() : defaults.minute,
6713 + second = date ? date.getSeconds() : defaults.second;
6714 +
6715 + //check if within min/max times..
6716 + if ((hour < defaults.hourMin || hour > defaults.hourMax) || (minute < defaults.minuteMin || minute > defaults.minuteMax) || (second < defaults.secondMin || second > defaults.secondMax)) {
6717 + hour = defaults.hourMin;
6718 + minute = defaults.minuteMin;
6719 + second = defaults.secondMin;
6720 + }
6721 +
6722 + tp_inst.hour = hour;
6723 + tp_inst.minute = minute;
6724 + tp_inst.second = second;
6725 +
6726 + if (tp_inst.hour_slider) tp_inst.hour_slider.slider('value', hour);
6727 + if (tp_inst.minute_slider) tp_inst.minute_slider.slider('value', minute);
6728 + if (tp_inst.second_slider) tp_inst.second_slider.slider('value', second);
6729 +
6730 + tp_inst._onTimeChange();
6731 + tp_inst._updateDateTime(inst);
6732 + }
6733 +};
6734 +
6735 +//#######################################################################################
6736 +// Create new public method to set only time, callable as $().datepicker('setTime', date)
6737 +//#######################################################################################
6738 +$.datepicker._setTimeDatepicker = function(target, date, withDate) {
6739 + var inst = this._getInst(target),
6740 + tp_inst = this._get(inst, 'timepicker');
6741 +
6742 + if (tp_inst) {
6743 + this._setDateFromField(inst);
6744 + var tp_date;
6745 + if (date) {
6746 + if (typeof date == "string") {
6747 + tp_inst._parseTime(date, withDate);
6748 + tp_date = new Date();
6749 + tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second);
6750 + }
6751 + else tp_date = new Date(date.getTime());
6752 + if (tp_date.toString() == 'Invalid Date') tp_date = undefined;
6753 + this._setTime(inst, tp_date);
6754 + }
6755 + }
6756 +
6757 +};
6758 +
6759 +//#######################################################################################
6760 +// override setDate() to allow setting time too within Date object
6761 +//#######################################################################################
6762 +$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
6763 +$.datepicker._setDateDatepicker = function(target, date) {
6764 + var inst = this._getInst(target),
6765 + tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
6766 +
6767 + this._updateDatepicker(inst);
6768 + this._base_setDateDatepicker.apply(this, arguments);
6769 + this._setTimeDatepicker(target, tp_date, true);
6770 +};
6771 +
6772 +//#######################################################################################
6773 +// override getDate() to allow getting time too within Date object
6774 +//#######################################################################################
6775 +$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
6776 +$.datepicker._getDateDatepicker = function(target, noDefault) {
6777 + var inst = this._getInst(target),
6778 + tp_inst = this._get(inst, 'timepicker');
6779 +
6780 + if (tp_inst) {
6781 + this._setDateFromField(inst, noDefault);
6782 + var date = this._getDate(inst);
6783 + if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second);
6784 + return date;
6785 + }
6786 + return this._base_getDateDatepicker(target, noDefault);
6787 +};
6788 +
6789 +//#######################################################################################
6790 +// override parseDate() because UI 1.8.14 throws an error about "Extra characters"
6791 +// An option in datapicker to ignore extra format characters would be nicer.
6792 +//#######################################################################################
6793 +$.datepicker._base_parseDate = $.datepicker.parseDate;
6794 +$.datepicker.parseDate = function(format, value, settings) {
6795 + var date;
6796 + try {
6797 + date = this._base_parseDate(format, value, settings);
6798 + } catch (err) {
6799 + // Hack! The error message ends with a colon, a space, and
6800 + // the "extra" characters. We rely on that instead of
6801 + // attempting to perfectly reproduce the parsing algorithm.
6802 + date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
6803 + }
6804 + return date;
6805 +};
6806 +
6807 +//#######################################################################################
6808 +// override options setter to add time to maxDate(Time) and minDate(Time)
6809 +//#######################################################################################
6810 +$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
6811 +$.datepicker._optionDatepicker = function(target, name, value) {
6812 + this._base_optionDatepicker(target, name, value);
6813 + var inst = this._getInst(target),
6814 + tp_inst = this._get(inst, 'timepicker');
6815 + if (tp_inst) {
6816 + //Set minimum and maximum date values if we have timepicker
6817 + if(name==='minDate') {
6818 + if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date)
6819 + tp_inst._defaults.minDateTime = new Date(value);
6820 + if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date)
6821 + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
6822 + tp_inst._limitMinMaxDateTime(inst,true);
6823 + }
6824 + if(name==='maxDate') {
6825 + if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date)
6826 + tp_inst._defaults.maxDateTime = new Date(value);
6827 + if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date)
6828 + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
6829 + tp_inst._limitMinMaxDateTime(inst,true);
6830 + }
6831 + }
6832 +};
6833 +
6834 +//#######################################################################################
6835 +// jQuery extend now ignores nulls!
6836 +//#######################################################################################
6837 +function extendRemove(target, props) {
6838 + $.extend(target, props);
6839 + for (var name in props)
6840 + if (props[name] === null || props[name] === undefined)
6841 + target[name] = props[name];
6842 + return target;
6843 +}
6844 +
6845 +$.timepicker = new Timepicker(); // singleton instance
6846 +$.timepicker.version = "0.9.6";
6847 +
6848 +})(jQuery);
6849 \ No newline at end of file
6850 diff -up cacti-0.8.8a/include/js/jquery/jquery-ui.js.legal cacti-0.8.8a/include/js/jquery/jquery-ui.js
6851 --- cacti-0.8.8a/include/js/jquery/jquery-ui.js.legal 2013-01-04 15:44:38.043416079 -0500
6852 +++ cacti-0.8.8a/include/js/jquery/jquery-ui.js 2013-01-04 15:43:12.646377987 -0500
6853 @@ -0,0 +1,356 @@
6854 +/*!
6855 + * jQuery UI 1.8.18
6856 + *
6857 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6858 + * Dual licensed under the MIT or GPL Version 2 licenses.
6859 + * http://jquery.org/license
6860 + *
6861 + * http://docs.jquery.com/UI
6862 + */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
6863 + * jQuery UI Widget 1.8.18
6864 + *
6865 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6866 + * Dual licensed under the MIT or GPL Version 2 licenses.
6867 + * http://jquery.org/license
6868 + *
6869 + * http://docs.jquery.com/UI/Widget
6870 + */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*!
6871 + * jQuery UI Mouse 1.8.18
6872 + *
6873 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6874 + * Dual licensed under the MIT or GPL Version 2 licenses.
6875 + * http://jquery.org/license
6876 + *
6877 + * http://docs.jquery.com/UI/Mouse
6878 + *
6879 + * Depends:
6880 + * jquery.ui.widget.js
6881 + */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/*
6882 + * jQuery UI Position 1.8.18
6883 + *
6884 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6885 + * Dual licensed under the MIT or GPL Version 2 licenses.
6886 + * http://jquery.org/license
6887 + *
6888 + * http://docs.jquery.com/UI/Position
6889 + */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/*
6890 + * jQuery UI Draggable 1.8.18
6891 + *
6892 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6893 + * Dual licensed under the MIT or GPL Version 2 licenses.
6894 + * http://jquery.org/license
6895 + *
6896 + * http://docs.jquery.com/UI/Draggables
6897 + *
6898 + * Depends:
6899 + * jquery.ui.core.js
6900 + * jquery.ui.mouse.js
6901 + * jquery.ui.widget.js
6902 + */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.18"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/*
6903 + * jQuery UI Droppable 1.8.18
6904 + *
6905 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6906 + * Dual licensed under the MIT or GPL Version 2 licenses.
6907 + * http://jquery.org/license
6908 + *
6909 + * http://docs.jquery.com/UI/Droppables
6910 + *
6911 + * Depends:
6912 + * jquery.ui.core.js
6913 + * jquery.ui.widget.js
6914 + * jquery.ui.mouse.js
6915 + * jquery.ui.draggable.js
6916 + */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.18"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/*
6917 + * jQuery UI Resizable 1.8.18
6918 + *
6919 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6920 + * Dual licensed under the MIT or GPL Version 2 licenses.
6921 + * http://jquery.org/license
6922 + *
6923 + * http://docs.jquery.com/UI/Resizables
6924 + *
6925 + * Depends:
6926 + * jquery.ui.core.js
6927 + * jquery.ui.mouse.js
6928 + * jquery.ui.widget.js
6929 + */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/*
6930 + * jQuery UI Selectable 1.8.18
6931 + *
6932 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6933 + * Dual licensed under the MIT or GPL Version 2 licenses.
6934 + * http://jquery.org/license
6935 + *
6936 + * http://docs.jquery.com/UI/Selectables
6937 + *
6938 + * Depends:
6939 + * jquery.ui.core.js
6940 + * jquery.ui.mouse.js
6941 + * jquery.ui.widget.js
6942 + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);/*
6943 + * jQuery UI Sortable 1.8.18
6944 + *
6945 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6946 + * Dual licensed under the MIT or GPL Version 2 licenses.
6947 + * http://jquery.org/license
6948 + *
6949 + * http://docs.jquery.com/UI/Sortables
6950 + *
6951 + * Depends:
6952 + * jquery.ui.core.js
6953 + * jquery.ui.mouse.js
6954 + * jquery.ui.widget.js
6955 + */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.18"})})(jQuery);/*
6956 + * jQuery UI Accordion 1.8.18
6957 + *
6958 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6959 + * Dual licensed under the MIT or GPL Version 2 licenses.
6960 + * http://jquery.org/license
6961 + *
6962 + * http://docs.jquery.com/UI/Accordion
6963 + *
6964 + * Depends:
6965 + * jquery.ui.core.js
6966 + * jquery.ui.widget.js
6967 + */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/*
6968 + * jQuery UI Autocomplete 1.8.18
6969 + *
6970 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6971 + * Dual licensed under the MIT or GPL Version 2 licenses.
6972 + * http://jquery.org/license
6973 + *
6974 + * http://docs.jquery.com/UI/Autocomplete
6975 + *
6976 + * Depends:
6977 + * jquery.ui.core.js
6978 + * jquery.ui.widget.js
6979 + * jquery.ui.position.js
6980 + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/*
6981 + * jQuery UI Button 1.8.18
6982 + *
6983 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6984 + * Dual licensed under the MIT or GPL Version 2 licenses.
6985 + * http://jquery.org/license
6986 + *
6987 + * http://docs.jquery.com/UI/Button
6988 + *
6989 + * Depends:
6990 + * jquery.ui.core.js
6991 + * jquery.ui.widget.js
6992 + */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/*
6993 + * jQuery UI Dialog 1.8.18
6994 + *
6995 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
6996 + * Dual licensed under the MIT or GPL Version 2 licenses.
6997 + * http://jquery.org/license
6998 + *
6999 + * http://docs.jquery.com/UI/Dialog
7000 + *
7001 + * Depends:
7002 + * jquery.ui.core.js
7003 + * jquery.ui.widget.js
7004 + * jquery.ui.button.js
7005 + * jquery.ui.draggable.js
7006 + * jquery.ui.mouse.js
7007 + * jquery.ui.position.js
7008 + * jquery.ui.resizable.js
7009 + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*
7010 + * jQuery UI Slider 1.8.18
7011 + *
7012 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7013 + * Dual licensed under the MIT or GPL Version 2 licenses.
7014 + * http://jquery.org/license
7015 + *
7016 + * http://docs.jquery.com/UI/Slider
7017 + *
7018 + * Depends:
7019 + * jquery.ui.core.js
7020 + * jquery.ui.mouse.js
7021 + * jquery.ui.widget.js
7022 + */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/*
7023 + * jQuery UI Tabs 1.8.18
7024 + *
7025 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7026 + * Dual licensed under the MIT or GPL Version 2 licenses.
7027 + * http://jquery.org/license
7028 + *
7029 + * http://docs.jquery.com/UI/Tabs
7030 + *
7031 + * Depends:
7032 + * jquery.ui.core.js
7033 + * jquery.ui.widget.js
7034 + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/*
7035 + * jQuery UI Datepicker 1.8.18
7036 + *
7037 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7038 + * Dual licensed under the MIT or GPL Version 2 licenses.
7039 + * http://jquery.org/license
7040 + *
7041 + * http://docs.jquery.com/UI/Datepicker
7042 + *
7043 + * Depends:
7044 + * jquery.ui.core.js
7045 + */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),
7046 +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/*
7047 + * jQuery UI Progressbar 1.8.18
7048 + *
7049 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7050 + * Dual licensed under the MIT or GPL Version 2 licenses.
7051 + * http://jquery.org/license
7052 + *
7053 + * http://docs.jquery.com/UI/Progressbar
7054 + *
7055 + * Depends:
7056 + * jquery.ui.core.js
7057 + * jquery.ui.widget.js
7058 + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/*
7059 + * jQuery UI Effects 1.8.18
7060 + *
7061 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7062 + * Dual licensed under the MIT or GPL Version 2 licenses.
7063 + * http://jquery.org/license
7064 + *
7065 + * http://docs.jquery.com/UI/Effects/
7066 + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/*
7067 + * jQuery UI Effects Blind 1.8.18
7068 + *
7069 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7070 + * Dual licensed under the MIT or GPL Version 2 licenses.
7071 + * http://jquery.org/license
7072 + *
7073 + * http://docs.jquery.com/UI/Effects/Blind
7074 + *
7075 + * Depends:
7076 + * jquery.effects.core.js
7077 + */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
7078 + * jQuery UI Effects Bounce 1.8.18
7079 + *
7080 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7081 + * Dual licensed under the MIT or GPL Version 2 licenses.
7082 + * http://jquery.org/license
7083 + *
7084 + * http://docs.jquery.com/UI/Effects/Bounce
7085 + *
7086 + * Depends:
7087 + * jquery.effects.core.js
7088 + */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
7089 + * jQuery UI Effects Clip 1.8.18
7090 + *
7091 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7092 + * Dual licensed under the MIT or GPL Version 2 licenses.
7093 + * http://jquery.org/license
7094 + *
7095 + * http://docs.jquery.com/UI/Effects/Clip
7096 + *
7097 + * Depends:
7098 + * jquery.effects.core.js
7099 + */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/*
7100 + * jQuery UI Effects Drop 1.8.18
7101 + *
7102 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7103 + * Dual licensed under the MIT or GPL Version 2 licenses.
7104 + * http://jquery.org/license
7105 + *
7106 + * http://docs.jquery.com/UI/Effects/Drop
7107 + *
7108 + * Depends:
7109 + * jquery.effects.core.js
7110 + */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
7111 + * jQuery UI Effects Explode 1.8.18
7112 + *
7113 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7114 + * Dual licensed under the MIT or GPL Version 2 licenses.
7115 + * http://jquery.org/license
7116 + *
7117 + * http://docs.jquery.com/UI/Effects/Explode
7118 + *
7119 + * Depends:
7120 + * jquery.effects.core.js
7121 + */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/*
7122 + * jQuery UI Effects Fade 1.8.18
7123 + *
7124 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7125 + * Dual licensed under the MIT or GPL Version 2 licenses.
7126 + * http://jquery.org/license
7127 + *
7128 + * http://docs.jquery.com/UI/Effects/Fade
7129 + *
7130 + * Depends:
7131 + * jquery.effects.core.js
7132 + */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
7133 + * jQuery UI Effects Fold 1.8.18
7134 + *
7135 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7136 + * Dual licensed under the MIT or GPL Version 2 licenses.
7137 + * http://jquery.org/license
7138 + *
7139 + * http://docs.jquery.com/UI/Effects/Fold
7140 + *
7141 + * Depends:
7142 + * jquery.effects.core.js
7143 + */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
7144 + * jQuery UI Effects Highlight 1.8.18
7145 + *
7146 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7147 + * Dual licensed under the MIT or GPL Version 2 licenses.
7148 + * http://jquery.org/license
7149 + *
7150 + * http://docs.jquery.com/UI/Effects/Highlight
7151 + *
7152 + * Depends:
7153 + * jquery.effects.core.js
7154 + */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
7155 + * jQuery UI Effects Pulsate 1.8.18
7156 + *
7157 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7158 + * Dual licensed under the MIT or GPL Version 2 licenses.
7159 + * http://jquery.org/license
7160 + *
7161 + * http://docs.jquery.com/UI/Effects/Pulsate
7162 + *
7163 + * Depends:
7164 + * jquery.effects.core.js
7165 + */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&&times--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/*
7166 + * jQuery UI Effects Scale 1.8.18
7167 + *
7168 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7169 + * Dual licensed under the MIT or GPL Version 2 licenses.
7170 + * http://jquery.org/license
7171 + *
7172 + * http://docs.jquery.com/UI/Effects/Scale
7173 + *
7174 + * Depends:
7175 + * jquery.effects.core.js
7176 + */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
7177 + * jQuery UI Effects Shake 1.8.18
7178 + *
7179 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7180 + * Dual licensed under the MIT or GPL Version 2 licenses.
7181 + * http://jquery.org/license
7182 + *
7183 + * http://docs.jquery.com/UI/Effects/Shake
7184 + *
7185 + * Depends:
7186 + * jquery.effects.core.js
7187 + */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
7188 + * jQuery UI Effects Slide 1.8.18
7189 + *
7190 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7191 + * Dual licensed under the MIT or GPL Version 2 licenses.
7192 + * http://jquery.org/license
7193 + *
7194 + * http://docs.jquery.com/UI/Effects/Slide
7195 + *
7196 + * Depends:
7197 + * jquery.effects.core.js
7198 + */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
7199 + * jQuery UI Effects Transfer 1.8.18
7200 + *
7201 + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
7202 + * Dual licensed under the MIT or GPL Version 2 licenses.
7203 + * http://jquery.org/license
7204 + *
7205 + * http://docs.jquery.com/UI/Effects/Transfer
7206 + *
7207 + * Depends:
7208 + * jquery.effects.core.js
7209 + */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);
7210 \ No newline at end of file
7211 diff -up cacti-0.8.8a/include/js/jquery/jquery.zoom.js.legal cacti-0.8.8a/include/js/jquery/jquery.zoom.js
7212 --- cacti-0.8.8a/include/js/jquery/jquery.zoom.js.legal 2013-01-04 15:44:38.045416081 -0500
7213 +++ cacti-0.8.8a/include/js/jquery/jquery.zoom.js 2013-01-04 15:43:12.646377987 -0500
7214 @@ -0,0 +1,866 @@
7215 +/*
7216 + +-------------------------------------------------------------------------+
7217 + | Copyright (C) 2004-2013 The Cacti Group |
7218 + | |
7219 + | This program is free software; you can redistribute it and/or |
7220 + | modify it under the terms of the GNU General Public License |
7221 + | as published by the Free Software Foundation; either version 2 |
7222 + | of the License, or (at your option) any later version. |
7223 + | |
7224 + | This program is distributed in the hope that it will be useful, |
7225 + | but WITHOUT ANY WARRANTY; without even the implied warranty of |
7226 + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7227 + | GNU General Public License for more details. |
7228 + +-------------------------------------------------------------------------+
7229 + | Cacti: The Complete RRDTool-based Graphing Solution |
7230 + +-------------------------------------------------------------------------+
7231 + | This code is designed, written, and maintained by the Cacti Group. See |
7232 + | about.php and/or the AUTHORS file for specific developer information. |
7233 + +-------------------------------------------------------------------------+
7234 + | http://www.cacti.net/ |
7235 + +-------------------------------------------------------------------------+
7236 +*/
7237 +
7238 +/* requirements:
7239 + jQuery 1.7.x or above
7240 + jQuery UI 1.8.x or above
7241 + jQuery cookie plugin
7242 +*/
7243 +
7244 +(function($){
7245 + $.fn.zoom = function(options) {
7246 +
7247 + /* +++++++++++++++++++++++ Global Variables +++++++++++++++++++++++++ */
7248 +
7249 + // default values of the different options being offered
7250 + var defaults = {
7251 + inputfieldStartTime : '', // ID of the input field that contains the start date
7252 + inputfieldEndTime : '', // ID of the input field that contains the end date
7253 + submitButton : 'button_refresh_x', // ID of the submit button
7254 + cookieName : 'cacti_zoom' // default name required for session cookie
7255 + };
7256 +
7257 + // define global variables / objects here
7258 + var zoom = {
7259 + // "initiator" is the element that initiates Zoom
7260 + initiator: $(this),
7261 + // "image" means the image tag and its properties
7262 + image: { top:0, left:0, width:0, height:0 },
7263 + // "graph" stands for the rrdgraph itself excluding legend, graph title etc.
7264 + graph: { timespan:0, secondsPerPixel:0 },
7265 + // "box" describes the area in front of the graph whithin jQueryZoom will allow interaction
7266 + box: { top:0, left:0, right:0, width:0, height:0 },
7267 + // "markers" are selectors useable within the advanced mode
7268 + marker: { 1 : { placed:false }, 2 : { placed:false} },
7269 + // "custom" holds the local configuration done by the user
7270 + custom: {},
7271 + // "options" contains the start input parameters
7272 + options: $.extend(defaults, options),
7273 + // "attributes" holds all values that will describe the selected area
7274 + attr: { activeElement:'', start:'none', end:'none', action:'left2right', location: window.location.href.split("?") }
7275 + };
7276 +
7277 +
7278 + /* ++++++++++++++++++++++++ Initialization ++++++++++++++++++++++++++ */
7279 +
7280 + // use a cookie to support local settings
7281 + zoom.custom = $.cookie(zoom.options.cookieName) ? unserialize( $.cookie(zoom.options.cookieName) ) : {};
7282 + if(zoom.custom.zoomMode == undefined) zoom.custom.zoomMode = 'quick';
7283 + if(zoom.custom.zoomOutPositioning == undefined) zoom.custom.zoomOutPositioning = 'center';
7284 + if(zoom.custom.zoomOutFactor == undefined) zoom.custom.zoomOutFactor = '2';
7285 + if(zoom.custom.zoomMarkers == undefined) zoom.custom.zoomMarkers = true;
7286 + if(zoom.custom.zoomTimestamps == undefined) zoom.custom.zoomTimestamps = 'auto';
7287 + if(zoom.custom.zoom3rdMouseButton == undefined) zoom.custom.zoom3rdMouseButton = false;
7288 +
7289 + // create or update a session cookie
7290 + $.cookie( zoom.options.cookieName, serialize(zoom.custom), {expires: null} );
7291 +
7292 + // support jQuery's concatination
7293 + return this.each(function() { zoom_init( $(this) ); });
7294 +
7295 +
7296 + /* ++++++++++++++++++++ Universal Functions +++++++++++++++++++++++++ */
7297 +
7298 + /**
7299 + * checks if an image has been already loaded or if the link is broken
7300 + **/
7301 + function isReady(image){
7302 + if(typeof image[0].naturalWidth !== undefined && image[0].naturalWidth == 0) {
7303 + return false;
7304 + }
7305 + // support older versions of IE(6-8)
7306 + if(!image[0].complete) {
7307 + return false;
7308 + }
7309 + return true;
7310 + }
7311 +
7312 + /**
7313 + * splits off the parameters of a given url
7314 + **/
7315 + function getUrlVars(url) {
7316 + var parameters = [], name, value;
7317 +
7318 + urlBaseAndParameters = url.split("?");
7319 + urlBase = urlBaseAndParameters[0];
7320 + urlParameters = urlBaseAndParameters[1].split("&");
7321 + parameters["urlBase"] = urlBase;
7322 +
7323 + for(var i=0; i<urlParameters.length; i++) {
7324 + parameter = urlParameters[i].split("=");
7325 + parameters[parameter[0].replace(/^graph_/, "")] = $.isNumeric(parameter[1]) ? +parameter[1] : parameter[1];
7326 + }
7327 + return parameters;
7328 + }
7329 +
7330 + /**
7331 + * transforms an object into a comma separated string of key-value pairs
7332 + **/
7333 + function serialize(object){
7334 + var str = "";
7335 + for(var key in object) { str += (key + '=' + object[key] + ','); }
7336 + return str.slice(0, -1);
7337 + }
7338 +
7339 + /**
7340 + * transforms a comma separated string of key-values pairs into an object
7341 + * including a change of the value type from string to boolean or numeric if reasonable.
7342 + **/
7343 + function unserialize(string){
7344 + var obj = new Array();
7345 + pairs = string.split(',');
7346 + for(var i=0; i<pairs.length; i++) {
7347 + pair = pairs[i].split("=");
7348 + if(pair[1] == "true") {
7349 + pair[1] = true;
7350 + }else if(pair[1] == "false") {
7351 + pair[1] = false;
7352 + }else if($.isNumeric(pair[1])) {
7353 + pair[1] = +pair[1];
7354 + }
7355 + obj[pair[0]] = pair[1];
7356 + }
7357 + return obj;
7358 + }
7359 +
7360 + /**
7361 + * converts a Unix time stamp to a formatted date string
7362 + **/
7363 + function unixTime2Date(unixTime){
7364 + var date = new Date(unixTime*1000);
7365 + var year = date.getFullYear();
7366 + var month = ((date.getMonth()+1) < 9 ) ? '0' + (date.getMonth()+1) : date.getMonth()+1;
7367 + var day = (date.getDate() > 9) ? date.getDate() : '0' + date.getDate();
7368 + var hours = (date.getHours() > 9) ? date.getHours() : '0' + date.getHours();
7369 + var minutes = (date.getMinutes() > 9) ? date.getMinutes() : '0' + date.getMinutes();
7370 + var seconds = (date.getSeconds() > 9) ? date.getSeconds() : '0' + date.getSeconds();
7371 +
7372 + var formattedTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
7373 + return formattedTime;
7374 + }
7375 +
7376 +
7377 + /* +++++++++++++++++++++++ Core Functions +++++++++++++++++++++++++++ */
7378 +
7379 + /* init zoom */
7380 + function zoom_init(image) {
7381 + var $this = image;
7382 + $this.mouseenter(
7383 + function(){
7384 + if(zoom.attr.activeElement == '') {
7385 + zoom.attr.activeElement = $(this).attr('id');
7386 + zoomFunction_init($this);
7387 + // focusing another image will trigger a reset of Zoom
7388 + }else if(zoom.attr.activeElement != $(this).attr('id')) {
7389 + zoom.attr.activeElement = $(this).attr('id');
7390 + zoomFunction_init($this);
7391 + }
7392 + }
7393 + );
7394 + }
7395 +
7396 + function zoomFunction_init(image) {
7397 + var $this = image;
7398 + // exit if image has not been already loaded or if image is not available
7399 + if(isReady($this)) {
7400 + // update zoom.image object with the attributes of this image
7401 + zoom.image.width = parseInt($this.width());
7402 + zoom.image.height = parseInt($this.height());
7403 + zoom.image.top = parseInt($this.offset().top);
7404 + zoom.image.left = parseInt($this.offset().left);
7405 + }else {
7406 + return;
7407 + }
7408 +
7409 + // get all graph parameters and merge results with zoom.graph object
7410 + $.extend(zoom.graph, getUrlVars( $this.attr("src") ));
7411 + zoom.graph.timespan = zoom.graph.end - zoom.graph.start;
7412 + zoom.graph.secondsPerPixel = zoom.graph.timespan/zoom.graph.width;
7413 +
7414 + if((zoom.graph.title_font_size <= 0) || (zoom.graph.title_font_size == "")) {
7415 + zoom.graph.title_font_size = 10;
7416 + }
7417 +
7418 + if(zoom.graph.nolegend != undefined) {
7419 + zoom.graph.title_font_size *= .70;
7420 + }
7421 +
7422 + // update all zoom box attributes. Unfortunately we have to use that best fit way
7423 + // to support RRDtool 1.2 and below. With RRDtool 1.3 or higher there would be a
7424 + // much more elegant solution available. (see RRDdtool graph option "graphv")
7425 + zoom.box.width = zoom.graph.width;
7426 + zoom.box.height = zoom.graph.height;
7427 +
7428 + if(zoom.graph.title_font_size == null) {
7429 + zoom.box.top = 32 - 1;
7430 + }else {
7431 + //default multiplier
7432 + var multiplier = 2.4;
7433 + // array of "best fit" multipliers
7434 + multipliers = new Array("-5", "-2", "0", "1.7", "1.6", "1.7", "1.8", "1.9", "2", "2", "2.1", "2.1", "2.2", "2.2", "2.3", "2.3", "2.3", "2.3", "2.3");
7435 + if(multipliers[Math.round(zoom.graph.title_font_size)] != null) {
7436 + multiplier = multipliers[Math.round(zoom.graph.title_font_size)];
7437 + }
7438 + zoom.box.top = zoom.image.top + parseInt(Math.abs(zoom.graph.title_font_size) * multiplier) + 15;
7439 + }
7440 +
7441 + zoom.box.bottom = zoom.box.top + zoom.box.height;
7442 + zoom.box.right = zoom.image.left + zoom.image.width - 30;
7443 + zoom.box.left = zoom.box.right - zoom.graph.width;
7444 +
7445 + // add all additional HTML elements to the DOM if necessary and register
7446 + // the individual events needed. Once added we will only reset
7447 + // and reposition these elements.
7448 +
7449 + // add the "zoomBox"
7450 + if($("#zoom-box").length == 0) {
7451 + // Please note: IE does not fire hover or click behaviors on completely transparent elements.
7452 + // Use a background color and set opacity to 1% as a workaround.(see CSS file)
7453 + $("<div id='zoom-box'></div>").appendTo("body");
7454 + }
7455 +
7456 + // add the "zoomSelectedArea"
7457 + if($("#zoom-area").length == 0) {
7458 + $("<div id='zoom-area'></div>").appendTo("body");
7459 + }
7460 +
7461 + // add two markers for the advanced mode
7462 + if($("#zoom-marker-1").length == 0) {
7463 + $('<div id="zoom-excluded-area-1" class="zoom-area-excluded"></div>').appendTo("body");
7464 + $('<div class="zoom-marker" id="zoom-marker-1"><div class="zoom-marker-arrow-down"></div><div class="zoom-marker-arrow-up"></div></div>').appendTo("body");
7465 + $('<div id="zoom-marker-tooltip-1" class="zoom-marker-tooltip"><div id="zoom-marker-tooltip-1-arrow-left" class="zoom-marker-tooltip-arrow-left"><div id="zoom-marker-tooltip-1-arrow-left-inner" class="zoom-marker-tooltip-arrow-left-inner"></div></div><span id="zoom-marker-tooltip-value-1" class="zoom-marker-tooltip-value">-</span><div id="zoom-marker-tooltip-1-arrow-right" class="zoom-marker-tooltip-arrow-right"><div id="zoom-marker-tooltip-1-arrow-right-inner" class="zoom-marker-tooltip-arrow-right-inner"></div></div></div>').appendTo('body');
7466 + }
7467 + if($("#zoom-marker-2").length == 0) {
7468 + $('<div id="zoom-excluded-area-2" class="zoom-area-excluded"></div>').appendTo("body");
7469 + $('<div class="zoom-marker" id="zoom-marker-2"><div class="zoom-marker-arrow-down"></div><div class="zoom-marker-arrow-up"></div></div>').appendTo("body");
7470 + $('<div id="zoom-marker-tooltip-2" class="zoom-marker-tooltip"><div id="zoom-marker-tooltip-2-arrow-left" class="zoom-marker-tooltip-arrow-left"><div id="zoom-marker-tooltip-1-arrow-left-inner" class="zoom-marker-tooltip-arrow-left-inner"></div></div><span id="zoom-marker-tooltip-value-2" class="zoom-marker-tooltip-value">-</span><div id="zoom-marker-tooltip-2-arrow-right" class="zoom-marker-tooltip-arrow-right"><div id="zoom-marker-tooltip-2-arrow-right-inner" class="zoom-marker-tooltip-arrow-right-inner"></div></div></div>').appendTo('body');
7471 + }
7472 + zoom.marker[1].placed = false;
7473 + zoom.marker[2].placed = false;
7474 +
7475 + // add the context (right click) menu
7476 + if($("#zoom-menu").length == 0) {
7477 + $('<div id="zoom-menu" class="zoom-menu">'
7478 + + '<div class="first_li">'
7479 + + '<div class="ui-icon ui-icon-zoomin"></div>'
7480 + + '<span class="zoomContextMenuAction__zoom_in">Zoom In</span>'
7481 + + '</div>'
7482 + + '<div class="first_li">'
7483 + + '<div class="ui-icon ui-icon-zoomout"></div>'
7484 + + '<span class="zoomContextMenuAction__zoom_out">Zoom Out (2x)</span>'
7485 + + '<div class="inner_li advanced_mode">'
7486 + + '<span class="zoomContextMenuAction__zoom_out__2">2x</span>'
7487 + + '<span class="zoomContextMenuAction__zoom_out__4">4x</span>'
7488 + + '<span class="zoomContextMenuAction__zoom_out__8">8x</span>'
7489 + + '<span class="zoomContextMenuAction__zoom_out__16">16x</span>'
7490 + + '<span class="zoomContextMenuAction__zoom_out__32">32x</span>'
7491 + + '</div>'
7492 + + '</div>'
7493 + + '<div class="sep_li"></div>'
7494 + + '<div class="first_li">'
7495 + + '<div class="ui-icon ui-icon-empty"></div><span>Zoom Mode</span>'
7496 + + '<div class="inner_li">'
7497 + + '<span class="zoomContextMenuAction__set_zoomMode__quick">Quick</span>'
7498 + + '<span class="zoomContextMenuAction__set_zoomMode__advanced">Advanced</span>'
7499 + + '</div>'
7500 + + '</div>'
7501 + + '<div class="first_li advanced_mode">'
7502 + + '<div class="ui-icon ui-icon-wrench"></div><span>Settings</span>'
7503 + + '<div class="inner_li">'
7504 + + '<div class="sec_li"><span>Markers</span>'
7505 + + '<div class="inner_li advanced_mode">'
7506 + + '<span class="zoomContextMenuAction__set_zoomMarkers__on">Enabled</span>'
7507 + + '<span class="zoomContextMenuAction__set_zoomMarkers__off">Disabled</span>'
7508 + + '</div>'
7509 + + '</div>'
7510 + + '<div class="sec_li"><span>Timestamps</span></span>'
7511 + + '<div class="inner_li advanced_mode">'
7512 + + '<span class="zoomContextMenuAction__set_zoomTimestamps__on">Always On</span>'
7513 + + '<span class="zoomContextMenuAction__set_zoomTimestamps__auto">Auto</span>'
7514 + + '<span class="zoomContextMenuAction__set_zoomTimestamps__off">Always Off</span>'
7515 + + '</div>'
7516 + + '</div>'
7517 + + '<div class="sep_li"></div>'
7518 + + '<div class="sec_li"><span>Zoom Out Factor</span>'
7519 + + '<div class="inner_li advanced_mode">'
7520 + + '<span class="zoomContextMenuAction__set_zoomOutFactor__2">2x</span>'
7521 + + '<span class="zoomContextMenuAction__set_zoomOutFactor__4">4x</span>'
7522 + + '<span class="zoomContextMenuAction__set_zoomOutFactor__8">8x</span>'
7523 + + '<span class="zoomContextMenuAction__set_zoomOutFactor__16">16x</span>'
7524 + + '<span class="zoomContextMenuAction__set_zoomOutFactor__32">32x</span>'
7525 + + '</div>'
7526 + + '</div>'
7527 + + '<div class="sec_li"><span>Zoom Out Positioning</span>'
7528 + + '<div class="inner_li advanced_mode">'
7529 + + '<span class="zoomContextMenuAction__set_zoomOutPositioning__begin">Begin with</span>'
7530 + + '<span class="zoomContextMenuAction__set_zoomOutPositioning__center">Center</span>'
7531 + + '<span class="zoomContextMenuAction__set_zoomOutPositioning__end">End with</span>'
7532 + + '</div>'
7533 + + '</div>'
7534 + + '<div class="sec_li"><span>3rd Mouse Button</span>'
7535 + + '<div class="inner_li advanced_mode">'
7536 + + '<span class="zoomContextMenuAction__set_zoom3rdMouseButton__zoom_in">Zoom in</span>'
7537 + + '<span class="zoomContextMenuAction__set_zoom3rdMouseButton__zoom_out">Zoom out</span>'
7538 + + '<span class="zoomContextMenuAction__set_zoom3rdMouseButton__off">Disabled</span>'
7539 + + '</div>'
7540 + + '</div>'
7541 + + '</div>'
7542 + + '</div>'
7543 + + '<div class="sep_li"></div>'
7544 + + '<div class="first_li">'
7545 + + '<div class="ui-icon ui-icon-close"></div><span class="zoomContextMenuAction__close">Close</span>'
7546 + + '</div>').appendTo('body');
7547 + }
7548 + zoomElemtents_reset()
7549 + zoomContextMenu_init();
7550 + zoomAction_init(image);
7551 + }
7552 +
7553 + /**
7554 + * resets all elements of Zoom
7555 + **/
7556 + function zoomElemtents_reset() {
7557 + zoom.marker = { 1 : { placed:false }, 2 : { placed:false} };
7558 + $('div[id^="zoom-"]').not('#zoom-menu').each( function () {
7559 + $(this).removeAttr('style');
7560 + });
7561 + $("#zoom-box").off();
7562 + $("#zoom-box").css({ cursor:'crosshair', width:zoom.box.width + 'px', height:zoom.box.height + 'px', top:zoom.box.top+'px', left:zoom.box.left+'px' });
7563 + $("#zoom-box").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} );
7564 + $("#zoom-area").off().css({ top:zoom.box.top+'px', height:zoom.box.height+'px' });
7565 + $(".zoom-area-excluded").off();
7566 + $(".zoom-area-excluded").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} );
7567 + $(".zoom-area-excluded").bind('click', function(e) { zoomContextMenu_hide(); return false;} );
7568 + $(".zoom-marker-arrow-up").css({ top:(zoom.box.height-6) + 'px' });
7569 + $(".zoom-marker-tooltip-value").disableSelection();
7570 + }
7571 +
7572 + /*
7573 + * registers all the different mouse click event handler
7574 + */
7575 + function zoomAction_init(image) {
7576 +
7577 + if(zoom.custom.zoomMode == 'quick') {
7578 + $("#zoom-box").off("mousedown").on("mousedown", function(e) {
7579 + switch(e.which) {
7580 + /* clicking the left mouse button will initiates a zoom-in */
7581 + case 1:
7582 + zoomContextMenu_hide();
7583 + // reset the zoom area
7584 + zoom.attr.start = e.pageX;
7585 + if(zoom.custom.zoomMode != 'quick') {
7586 + $("#zoom-marker-1").css({ height:zoom.box.height+'px', top:zoom.box.top+'px', left:zoom.attr.start+'px', display:'block' });
7587 + $("#zoom-marker-tooltip-1").css({ top:zoom.box.top+'px', left:zoom.attr.start+'px'});
7588 + }
7589 + $("#zoom-box").css({ cursor:'e-resize' });
7590 + $("#zoom-area").css({ width:'0px', left:zoom.attr.start+'px' });
7591 + break;
7592 + }
7593 + });
7594 +
7595 + /* register the mouse up event */
7596 + $("#zoom-area").off("mouseup").on("mouseup", function(e) {
7597 + switch(e.which) {
7598 + /* leaving the left mouse button will execute a zoom in */
7599 + case 1:
7600 + if(zoom.custom.zoomMode == 'quick' && zoom.attr.start != 'none') {
7601 + zoomAction_zoom_in();
7602 + }
7603 + break;
7604 + }
7605 + });
7606 +
7607 + /* stretch the zoom area in that direction the user moved the mouse pointer */
7608 + $("#zoom-box").mousemove( function(e) { zoomAction_draw(e) } );
7609 +
7610 + /* stretch the zoom area in that direction the user moved the mouse pointer.
7611 + That is required to get it working faultlessly with Opera, IE and Chrome */
7612 + $("#zoom-area").mousemove( function(e) { zoomAction_draw(e); } );
7613 +
7614 + /* moving the mouse pointer quickly will avoid that the mousemove event has enough time to actualize the zoom area */
7615 + $("#zoom-box").mouseout( function(e) { zoomAction_draw(e) } );
7616 +
7617 + }else{
7618 + /* welcome to the advanced mode ;) */
7619 + $("#zoom-box").off("mousedown").on("mousedown", function(e) {
7620 + switch(e.which) {
7621 + case 1:
7622 + /* hide context menu if open */
7623 + zoomContextMenu_hide();
7624 +
7625 + /* find out which marker has to be added */
7626 + if(zoom.marker[1].placed && zoom.marker[2].placed) {
7627 + zoomAction_zoom_in();
7628 + return;
7629 + }else {
7630 + var marker = zoom.marker[1].placed ? 2 : 1;
7631 + var secondmarker = (marker == 1) ? 2 : 1;
7632 + }
7633 +
7634 + /* select marker */
7635 + var $this = $("#zoom-marker-" + marker);
7636 +
7637 + /* place the marker and make it visible */
7638 + $this.css({ height:zoom.box.height+'px', top:zoom.box.top+'px', left:e.pageX+'px', display:'block' });
7639 + zoom.marker[marker].placed = true;
7640 + zoom.marker[marker].left = e.pageX;
7641 +
7642 + /* place the marker's tooltip, update its value and make it visible if necessary (Setting: "Always On") */
7643 + zoom.marker[marker].unixtime = parseInt(parseInt(zoom.graph.start) + (e.pageX + 1 - zoom.box.left)*zoom.graph.secondsPerPixel);
7644 + $("#zoom-marker-tooltip-value-" + marker).html(
7645 + unixTime2Date(zoom.marker[marker].unixtime).replace(" ", "<br>")
7646 + );
7647 + zoom.marker[marker].width = $("#zoom-marker-tooltip-" + marker).width();
7648 +
7649 + $("#zoom-marker-tooltip-" + marker).css({
7650 + top: ( (marker == 1) ? zoom.box.top+3 : zoom.box.bottom-30 )+'px',
7651 + left:( (marker == 1) ? e.pageX - zoom.marker[marker].width : e.pageX )+'px'}
7652 + );
7653 +
7654 + if(zoom.custom.zoomTimestamps === true) {
7655 + $("#zoom-marker-tooltip-" + marker).fadeIn(500);
7656 + }
7657 +
7658 + if(e.pageX == $("#zoom-marker-tooltip-" + marker).position().left) {
7659 + $("#zoom-marker-tooltip-" + marker + "-arrow-right").css({ visibility:'hidden'});
7660 + }else {
7661 + $("#zoom-marker-tooltip-" + marker + "-arrow-left").css({ visibility:'hidden'});
7662 + }
7663 +
7664 + /* make the excluded areas visible directly in that moment both markers are set */
7665 + if(zoom.marker[1].placed && zoom.marker[2].placed) {
7666 + zoom.marker.distance = zoom.marker[1].left - zoom.marker[2].left;
7667 +
7668 + $("#zoom-excluded-area-1").css({
7669 + height:zoom.box.height+'px',
7670 + top:zoom.box.top+'px',
7671 + left: (zoom.marker.distance > 0) ? zoom.marker[1].left : zoom.box.left,
7672 + width: (zoom.marker.distance > 0) ? zoom.box.right - zoom.marker[1].left : zoom.marker[1].left - zoom.box.left,
7673 + display:'block'
7674 + });
7675 +
7676 + $("#zoom-excluded-area-2").css({
7677 + height:zoom.box.height+'px',
7678 + top:zoom.box.top+'px',
7679 + left: (zoom.marker.distance < 0) ? zoom.marker[2].left : zoom.box.left,
7680 + width: (zoom.marker.distance < 0) ? zoom.box.right - zoom.marker[2].left : zoom.marker[2].left - zoom.box.left,
7681 + display:'block'
7682 + });
7683 +
7684 + /* reposition both tooltips */
7685 + $("#zoom-marker-tooltip-1").css({ left: $("#zoom-marker-1").position().left - ( (zoom.marker.distance > 0) ? 0 : $("#zoom-marker-tooltip-1").width() ) + 'px' });
7686 + $("#zoom-marker-tooltip-1-arrow-left").css({ visibility: (($("#zoom-marker-tooltip-1").position().left < $("#zoom-marker-1").position().left ) ? 'hidden' : 'visible') });
7687 + $("#zoom-marker-tooltip-1-arrow-right").css({ visibility: (($("#zoom-marker-tooltip-1").position().left < $("#zoom-marker-1").position().left ) ? 'visible' : 'hidden') });
7688 +
7689 + $("#zoom-marker-tooltip-2").css({ left: $("#zoom-marker-2").position().left - ( (zoom.marker.distance < 0) ? 0 : $("#zoom-marker-tooltip-2").width() ) + 'px' });
7690 + $("#zoom-marker-tooltip-2-arrow-left").css({ visibility: (($("#zoom-marker-tooltip-2").position().left < $("#zoom-marker-2").position().left ) ? 'hidden' : 'visible') });
7691 + $("#zoom-marker-tooltip-2-arrow-right").css({ visibility: (($("#zoom-marker-tooltip-2").position().left < $("#zoom-marker-2").position().left ) ? 'visible' : 'hidden') });
7692 + }
7693 +
7694 + /* make the marker draggable */
7695 + $this.draggable({
7696 + containment:[ zoom.box.left-1, 0 , zoom.box.left+parseInt(zoom.box.width), 0 ],
7697 + axis: "x",
7698 + start:
7699 + function(event, ui) {
7700 + if(zoom.custom.zoomTimestamps == "auto") {
7701 + $(".zoom-marker-tooltip").fadeIn(500);
7702 + }
7703 + },
7704 + drag:
7705 + function(event, ui) {
7706 +
7707 + zoom.marker[marker].left = ui.position["left"];
7708 +
7709 + /* update the timestamp shown in tooltip */
7710 + zoom.marker[marker].unixtime = parseInt(parseInt(zoom.graph.start) + (zoom.marker[marker].left + 1 - zoom.box.left)*zoom.graph.secondsPerPixel);
7711 + $("#zoom-marker-tooltip-value-" + marker).html(
7712 + unixTime2Date(zoom.marker[marker].unixtime).replace(" ", "<br>")
7713 + );
7714 +
7715 + zoom.marker[marker].width = $("#zoom-marker-tooltip-" + marker).width();
7716 +
7717 + /* update the execludedArea if both markers have been placed */
7718 + if(zoom.marker[1].placed && zoom.marker[2].placed) {
7719 + zoom.marker.distance = zoom.marker[marker].left - zoom.marker[secondmarker].left;
7720 +
7721 + if( zoom.marker.distance > 0 ) {
7722 + zoom.marker[marker].excludeArea = 'right';
7723 + zoom.marker[secondmarker].excludeArea = 'left';
7724 + }else {
7725 + zoom.marker[marker].excludeArea = 'left';
7726 + zoom.marker[secondmarker].excludeArea = 'right';
7727 + }
7728 +
7729 + /* in that case we have to update the tooltip of both marker */
7730 + $("#zoom-excluded-area-" + marker).css({ left: (zoom.marker.distance > 0) ? zoom.marker[marker].left : zoom.box.left, width: (zoom.marker.distance > 0) ? zoom.box.right - zoom.marker[marker].left : zoom.marker[marker].left - zoom.box.left});
7731 + $("#zoom-marker-tooltip-" + marker).css({ left: zoom.marker[marker].left + ( (zoom.marker[marker].excludeArea == 'right') ? (0) : (-zoom.marker[marker].width) ) });
7732 + $("#zoom-marker-tooltip-" + marker + "-arrow-left").css({ visibility: ( zoom.marker[marker].excludeArea == 'left' ? 'hidden' : 'visible') });
7733 + $("#zoom-marker-tooltip-" + marker + "-arrow-right").css({ visibility: ( zoom.marker[marker].excludeArea == 'left' ? 'visible' : 'hidden') });
7734 +
7735 + $("#zoom-excluded-area-" + secondmarker).css({ left: (zoom.marker.distance > 0) ? zoom.box.left : zoom.marker[secondmarker].left, width: (zoom.marker.distance > 0) ? zoom.marker[secondmarker].left - zoom.box.left : zoom.box.right - zoom.marker[secondmarker].left});
7736 + $("#zoom-marker-tooltip-" + secondmarker ).css({ left: zoom.marker[secondmarker].left + ( (zoom.marker[secondmarker].excludeArea == 'right') ? (0) : (-zoom.marker[secondmarker].width) ) });
7737 + $("#zoom-marker-tooltip-" + secondmarker + "-arrow-left").css({ visibility: ( zoom.marker[secondmarker].excludeArea == 'left' ? 'hidden' : 'visible') });
7738 + $("#zoom-marker-tooltip-" + secondmarker + "-arrow-right").css({ visibility: ( zoom.marker[secondmarker].excludeArea == 'left' ? 'visible' : 'hidden') });
7739 +
7740 + }else {
7741 + /* let the tooltip follow its marker */
7742 + $("#zoom-marker-tooltip-" + marker).css({ left: zoom.marker[marker].left -zoom.marker[marker].width });
7743 + }
7744 +
7745 + },
7746 + stop:
7747 + function(event,ui) {
7748 + /* hide all tooltip if we are in auto mode */
7749 + if(zoom.custom.zoomTimestamps == "auto") {
7750 + $(".zoom-marker-tooltip").fadeOut(1000);
7751 + }
7752 + }
7753 +
7754 + });
7755 +
7756 + break;
7757 + case 2:
7758 + if(zoom.custom.zoom3rdMouseButton != false) {
7759 + /* hide context menu if open */
7760 + zoomContextMenu_hide();
7761 + if(zoom.custom.zoom3rdMouseButton == "zoom_in") {
7762 + zoomAction_zoom_in();
7763 + }else {
7764 + zoomAction_zoom_out( zoom.custom.zoomOutFactor );
7765 + }
7766 + }
7767 + break;
7768 + }
7769 + return false;
7770 +
7771 + });
7772 +
7773 + }
7774 + }
7775 +
7776 +
7777 + /*
7778 + * executes a dynamic zoom in
7779 + */
7780 + function zoomAction_zoom_in(){
7781 +
7782 + /* hide context menu if open */
7783 + zoomContextMenu_hide();
7784 +
7785 + if(zoom.custom.zoomMode == 'quick') {
7786 +
7787 + var newGraphStartTime = (zoom.attr.action == 'left2right') ? parseInt(parseInt(zoom.graph.start) + (zoom.attr.start - zoom.box.left)*zoom.graph.secondsPerPixel)
7788 + : parseInt(parseInt(zoom.graph.start) + (zoom.attr.end - zoom.box.left)*zoom.graph.secondsPerPixel);
7789 + var newGraphEndTime = (zoom.attr.action == 'left2right') ? parseInt(newGraphStartTime + (zoom.attr.end-zoom.attr.start)*zoom.graph.secondsPerPixel)
7790 + : parseInt(newGraphStartTime + (zoom.attr.start-zoom.attr.end)*zoom.graph.secondsPerPixel);
7791 +
7792 + /* If the user only clicked on a graph then equal end and start date to ensure that we do not propergate NaNs */
7793 + if(isNaN(newGraphStartTime) & isNaN(newGraphEndTime)) {
7794 + return;
7795 + }else if(isNaN(newGraphStartTime) & !isNaN(newGraphEndTime)) {
7796 + newGraphStartTime = newGraphEndTime;
7797 + }else if(!isNaN(newGraphStartTime) & isNaN(newGraphEndTime)){
7798 + newGraphEndTime = newGraphStartTime;
7799 + }
7800 + }else {
7801 + /* advanced mode has other requirements */
7802 + /* first of, do nothing if not both marker have been positioned */
7803 + if(!zoom.marker[1].placed | !zoom.marker[2].placed) {
7804 + alert("NOTE: In advanced mode both markers have to be positioned first to define the period of time you want to zoom in.");
7805 + return;
7806 + }else {
7807 + var newGraphStartTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 2 : 1 )].unixtime;
7808 + var newGraphEndTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 1 : 2 )].unixtime;
7809 + }
7810 + }
7811 +
7812 + if(zoom.options.inputfieldStartTime != '' & zoom.options.inputfieldEndTime != ''){
7813 + /* execute zoom within "tree view" or the "preview view" */
7814 + $('#' + zoom.options.inputfieldStartTime).val(unixTime2Date(newGraphStartTime));
7815 + $('#' + zoom.options.inputfieldEndTime).val(unixTime2Date(newGraphEndTime));
7816 +
7817 + $("input[name='" + zoom.options.submitButton + "']").trigger('click');
7818 + return false;
7819 + }else {
7820 + /* graph view is alread in zoom status */
7821 + open(zoom.attr.location[0] + "?action=" + zoom.graph.action + "&local_graph_id=" + zoom.graph.local_graph_id + "&rra_id=" + zoom.graph.rra_id + "&view_type=" + zoom.graph.view_type + "&graph_start=" + newGraphStartTime + "&graph_end=" + newGraphEndTime + "&graph_height=" + zoom.graph.height + "&graph_width=" + zoom.graph.width + "&title_font_size=" + zoom.graph.title_font_size, "_self");
7822 + }
7823 +
7824 + }
7825 +
7826 +
7827 +
7828 +
7829 + /*
7830 + * executes a static zoom out (as right click event)
7831 + */
7832 + function zoomAction_zoom_out(multiplier){
7833 +
7834 + multiplier--;
7835 + /* avoid that we can not zoom out anymore if start and end date will be equal */
7836 + if(zoom.graph.timespan == 0) {
7837 + zoom.graph.timespan = 1;
7838 + }
7839 +
7840 + if(zoom.custom.zoomMode == 'quick' || !zoom.marker[1].placed || !zoom.marker[2].placed ) {
7841 + if(zoom.custom.zoomOutPositioning == 'begin') {
7842 + var newGraphStartTime = parseInt(zoom.graph.start);
7843 + var newGraphEndTime = parseInt(parseInt(zoom.graph.end) + (multiplier * zoom.graph.timespan));
7844 + }else if(zoom.custom.zoomOutPositioning == 'end') {
7845 + var newGraphStartTime = parseInt(parseInt(zoom.graph.start) - (multiplier * zoom.graph.timespan));
7846 + var newGraphEndTime = parseInt(zoom.graph.end);
7847 + }else {
7848 + // define the new start and end time, so that the selected area will be centered per default
7849 + var newGraphStartTime = parseInt(parseInt(zoom.graph.start) - (0.5 * multiplier * zoom.graph.timespan));
7850 + var newGraphEndTime = parseInt(parseInt(zoom.graph.end) + (0.5 * multiplier * zoom.graph.timespan));
7851 + }
7852 + }else {
7853 + var newGraphStartTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 2 : 1 )].unixtime;
7854 + var newGraphEndTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 1 : 2 )].unixtime;
7855 + var selectedTimeSpan = newGraphEndTime - newGraphStartTime;
7856 +
7857 + if(zoom.custom.zoomOutPositioning == 'begin') {
7858 + newGraphEndTime = newGraphEndTime + multiplier * selectedTimeSpan;
7859 + }else if(zoom.custom.zoomOutPositioning == 'end') {
7860 + newGraphStartTime = newGraphStartTime - multiplier * selectedTimeSpan;
7861 + }else {
7862 + newGraphStartTime = newGraphStartTime - 0.5 * multiplier * selectedTimeSpan;
7863 + newGraphEndTime = newGraphEndTime + 0.5 * multiplier * selectedTimeSpan;
7864 + }
7865 + }
7866 +
7867 + if(zoom.options.inputfieldStartTime != '' & zoom.options.inputfieldEndTime != ''){
7868 + $('#' + zoom.options.inputfieldStartTime).val(unixTime2Date(newGraphStartTime));
7869 + $('#' + zoom.options.inputfieldEndTime).val(unixTime2Date(newGraphEndTime));
7870 + $('#' + zoom.options.inputfieldStartTime).closest("form").submit();
7871 + }else {
7872 + open(zoom.attr.location[0] + "?action=" + zoom.graph.action + "&local_graph_id=" + zoom.graph.local_graph_id + "&rra_id=" + zoom.graph.rra_id + "&view_type=" + zoom.graph.view_type + "&graph_start=" + newGraphStartTime + "&graph_end=" + newGraphEndTime + "&graph_height=" + zoom.graph.height + "&graph_width=" + zoom.graph.width + "&title_font_size=" + zoom.graph.title_font_size, "_self");
7873 + }
7874 + }
7875 +
7876 +
7877 + /*
7878 + * updates the css parameters of the zoom area to reflect user's interaction
7879 + */
7880 + function zoomAction_draw(event) {
7881 +
7882 + if(zoom.attr.start == 'none') { return; }
7883 +
7884 + /* mouse has been moved from right to left */
7885 + if((event.pageX-zoom.attr.start)<0) {
7886 + zoom.attr.action = 'right2left';
7887 + zoom.attr.end = (event.pageX < zoom.box.left) ? zoom.box.left : event.pageX;
7888 + $("#zoom-area").css({ background:'red', left:(zoom.attr.end+1)+'px', width:Math.abs(zoom.attr.start-zoom.attr.end-1)+'px' });
7889 + /* mouse has been moved from left to right*/
7890 + }else {
7891 + zoom.attr.action = 'left2right';
7892 + zoom.attr.end = (event.pageX > zoom.box.right) ? zoom.box.right : event.pageX;
7893 + $("#zoom-area").css({ background:'red', left:zoom.attr.start+'px', width:Math.abs(zoom.attr.end-zoom.attr.start-1)+'px' });
7894 + }
7895 + /* move second marker if necessary */
7896 + if(zoom.custom.zoomMode != 'quick') {
7897 + $("#zoom-marker-2").css({ left:(zoom.attr.end+1)+'px' });
7898 + $("#zoom-marker-tooltip-2").css({ top:zoom.box.top+'px', left:(zoom.attr.end-5)+'px' });
7899 + }
7900 + }
7901 +
7902 + /**
7903 + *
7904 + * @access public
7905 + * @return void
7906 + **/
7907 + function zoomContextMenu_init(){
7908 +
7909 + /* sync menu with cookie parameters */
7910 + $(".zoomContextMenuAction__set_zoomMode__" + zoom.custom.zoomMode).addClass("ui-state-highlight");
7911 + $(".zoomContextMenuAction__set_zoomMarkers__" + ((zoom.custom.zoomMarkers === true) ? "on" : "off") ).addClass("ui-state-highlight");
7912 + $(".zoomContextMenuAction__set_zoomTimestamps__" + ((zoom.custom.zoomTimestamps == 'auto') ? "auto" : ((zoom.custom.zoomTimestamps) ? "on" : "off" ))).addClass("ui-state-highlight");
7913 + $(".zoomContextMenuAction__set_zoomOutFactor__" + zoom.custom.zoomOutFactor).addClass("ui-state-highlight");
7914 + $(".zoomContextMenuAction__set_zoomOutPositioning__" + zoom.custom.zoomOutPositioning).addClass("ui-state-highlight");
7915 + $(".zoomContextMenuAction__set_zoom3rdMouseButton__" + ((zoom.custom.zoom3rdMouseButton === false) ? "off" : zoom.custom.zoom3rdMouseButton) ).addClass("ui-state-highlight");
7916 +
7917 + if(zoom.custom.zoomMode == "quick") {
7918 + $("#zoom-menu > .advanced_mode").hide();
7919 + }else {
7920 + $(".zoomContextMenuAction__zoom_out").text("Zoom Out (" + zoom.custom.zoomOutFactor + "x)");
7921 + }
7922 +
7923 + /* init click on events */
7924 + $('[class*=zoomContextMenuAction__]').off().on('click', function() {
7925 + var zoomContextMenuAction = false;
7926 + var zoomContextMenuActionValue = false;
7927 + var classList = $(this).attr('class').trim().split(/\s+/);
7928 +
7929 + $.each( classList, function(index, item){
7930 + if( item.search("zoomContextMenuAction__") != -1) {
7931 + zoomContextMenuActionList = item.replace("zoomContextMenuAction__", "").split("__");
7932 + zoomContextMenuAction = zoomContextMenuActionList[0];
7933 + if(zoomContextMenuActionList[1] == 'undefined' || zoomContextMenuActionList[1] == 'off') {
7934 + zoomContextMenuActionValue = false;
7935 + }else if(zoomContextMenuActionList[1] == 'on') {
7936 + zoomContextMenuActionValue = true;
7937 + }else {
7938 + zoomContextMenuActionValue = zoomContextMenuActionList[1];
7939 + }
7940 + return( false );
7941 + }
7942 + });
7943 +
7944 + if( zoomContextMenuAction ) {
7945 + if( zoomContextMenuAction.substring(0,8) == "set_zoom") {
7946 + zoomContextMenuAction_set( zoomContextMenuAction.replace("set_zoom", "").toLowerCase(), zoomContextMenuActionValue);
7947 + }else {
7948 + zoomContextMenuAction_do( zoomContextMenuAction, zoomContextMenuActionValue);
7949 + }
7950 + }
7951 + });
7952 +
7953 + /* init hover events */
7954 + $(".first_li , .sec_li, .inner_li span").hover(
7955 + function () {
7956 + $(this).css({backgroundColor : '#E0EDFE' , cursor : 'pointer'});
7957 + if ( $(this).children().size() >0 )
7958 + if(zoom.custom.zoomMode == "quick") {
7959 + $(this).children('.inner_li:not(.advanced_mode)').show();
7960 + }else {
7961 + $(this).children('.inner_li').show();
7962 + }
7963 + },
7964 + function () {
7965 + $(this).css('background-color' , '#fff' );
7966 + $(this).children('.inner_li').hide();
7967 + }
7968 + );
7969 + };
7970 +
7971 + /**
7972 + *
7973 + * @access public
7974 + * @return void
7975 + **/
7976 + function zoomContextMenuAction_set(object, value){
7977 + switch(object) {
7978 + case "mode":
7979 + if( zoom.custom.zoomMode != value) {
7980 + zoom.custom.zoomMode = value;
7981 + $('[class*=zoomContextMenuAction__set_zoomMode__]').toggleClass("ui-state-highlight");
7982 +
7983 + if(value == "quick") {
7984 + // reset menu
7985 + $("#zoom-menu > .advanced_mode").hide();
7986 + $(".zoomContextMenuAction__zoom_out").text("Zoom Out (2x)");
7987 +
7988 + zoom.custom.zoomMode = 'quick';
7989 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
7990 + }else {
7991 + // switch to advanced mode
7992 + $("#zoom-menu > .advanced_mode").show();
7993 + $(".zoomContextMenuAction__zoom_out").text("Zoom Out (" + + zoom.custom.zoomOutFactor + "x)");
7994 +
7995 + zoom.custom.zoomMode = 'advanced';
7996 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
7997 + }
7998 + zoomElemtents_reset();
7999 + zoomAction_init(zoom.initiator);
8000 +
8001 + }
8002 + break;
8003 + case "markers":
8004 + if( zoom.custom.zoomMarkers != value) {
8005 + zoom.custom.zoomMarkers = value;
8006 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
8007 + $('[class*=zoomContextMenuAction__set_zoomMarkers__]').toggleClass('ui-state-highlight');
8008 + }
8009 + break;
8010 + case "timestamps":
8011 + if( zoom.custom.zoomTimestamps != value) {
8012 + zoom.custom.zoomTimestamps = value;
8013 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
8014 + $('[class*=zoomContextMenuAction__set_zoomTimestamps__]').removeClass('ui-state-highlight');
8015 + $('.zoomContextMenuAction__set_zoomTimestamps__' + ((zoom.custom.zoomTimestamps == 'auto') ? "auto" : ((zoom.custom.zoomTimestamps) ? "on" : "off" ))).addClass('ui-state-highlight');
8016 +
8017 + /* make them visible only for mode "Always On" */
8018 + if(zoom.custom.zoomTimestamps === true) {
8019 + $('.zoom-marker-tooltip').fadeIn(500);
8020 + }else {
8021 + $('.zoom-marker-tooltip').fadeOut(500);
8022 + }
8023 + }
8024 + break;
8025 + case "outfactor":
8026 + if( zoom.custom.zoomOutFactor != value) {
8027 + zoom.custom.zoomOutFactor = value;
8028 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
8029 + $('[class*=zoomContextMenuAction__set_zoomOutFactor__]').removeClass('ui-state-highlight');
8030 + $('.zoomContextMenuAction__set_zoomOutFactor__' + value).addClass('ui-state-highlight');
8031 + $('.zoomContextMenuAction__zoom_out').text('Zoom Out (' + value + 'x)');
8032 + }
8033 + break;
8034 + case "outpositioning":
8035 + if( zoom.custom.zoomOutPositioning != value) {
8036 + zoom.custom.zoomOutPositioning = value;
8037 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
8038 + $('[class*=zoomContextMenuAction__set_zoomOutPositioning__]').removeClass('ui-state-highlight');
8039 + $('.zoomContextMenuAction__set_zoomOutPositioning__' + value).addClass('ui-state-highlight');
8040 + }
8041 + break;
8042 + case "3rdmousebutton":
8043 + if( zoom.custom.zoom3rdMouseButton != value) {
8044 + zoom.custom.zoom3rdMouseButton = value;
8045 + $.cookie( zoom.options.cookieName, serialize(zoom.custom));
8046 + $('[class*=zoomContextMenuAction__set_zoom3rdMouseButton__]').removeClass('ui-state-highlight');
8047 + $('.zoomContextMenuAction__set_zoom3rdMouseButton__' + ((value === false) ? "off" : value)).addClass('ui-state-highlight');
8048 + }
8049 + break;
8050 + }
8051 + }
8052 +
8053 + function zoomContextMenuAction_do(action, value){
8054 + switch(action) {
8055 + case "close":
8056 + zoomContextMenu_hide();
8057 + break;
8058 + case "zoom_out":
8059 + if(value == undefined) {
8060 + value = (zoom.custom.zoomMode != "quick") ? zoom.custom.zoomOutFactor : 2;
8061 + }
8062 + zoomAction_zoom_out(value);
8063 + break;
8064 + case "zoom_in":
8065 + zoomAction_zoom_in();
8066 + break;
8067 + }
8068 + }
8069 +
8070 + function zoomContextMenu_show(e){
8071 + $("#zoom-menu").css({ left: e.pageX, top: e.pageY, zIndex: '101' }).show();
8072 + };
8073 +
8074 + function zoomContextMenu_hide(){
8075 + $('#zoom-menu').hide();
8076 + }
8077 +
8078 + };
8079 +
8080 +})(jQuery);
8081 \ No newline at end of file
8082 diff -up cacti-0.8.8a/include/js/jquery/themes/default/d.gif.legal cacti-0.8.8a/include/js/jquery/themes/default/d.gif
8083 Binary files cacti-0.8.8a/include/js/jquery/themes/default/d.gif.legal and cacti-0.8.8a/include/js/jquery/themes/default/d.gif differ
8084 diff -up cacti-0.8.8a/include/js/jquery/themes/default/d.png.legal cacti-0.8.8a/include/js/jquery/themes/default/d.png
8085 Binary files cacti-0.8.8a/include/js/jquery/themes/default/d.png.legal and cacti-0.8.8a/include/js/jquery/themes/default/d.png differ
8086 diff -up cacti-0.8.8a/include/js/jquery/themes/default/style.css.legal cacti-0.8.8a/include/js/jquery/themes/default/style.css
8087 --- cacti-0.8.8a/include/js/jquery/themes/default/style.css.legal 2013-01-04 15:44:49.350420872 -0500
8088 +++ cacti-0.8.8a/include/js/jquery/themes/default/style.css 2013-01-04 15:44:08.391403304 -0500
8089 @@ -0,0 +1,74 @@
8090 +/*
8091 + * jsTree default theme 1.0
8092 + * Supported features: dots/no-dots, icons/no-icons, focused, loading
8093 + * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
8094 + */
8095 +
8096 +.jstree-default li,
8097 +.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
8098 +.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
8099 +.jstree-default li.jstree-last { background:transparent; }
8100 +.jstree-default .jstree-open > ins { background-position:-72px 0; }
8101 +.jstree-default .jstree-closed > ins { background-position:-54px 0; }
8102 +.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
8103 +
8104 +.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
8105 +.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
8106 +.jstree-default a .jstree-icon { background-position:-56px -19px; }
8107 +.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
8108 +
8109 +.jstree-default.jstree-focused { background:#ffffee; }
8110 +
8111 +.jstree-default .jstree-no-dots li,
8112 +.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
8113 +.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
8114 +.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
8115 +
8116 +.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
8117 +
8118 +.jstree-default .jstree-search { font-style:italic; }
8119 +
8120 +.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
8121 +.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
8122 +.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
8123 +.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
8124 +.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
8125 +.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
8126 +.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
8127 +.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
8128 +
8129 +#vakata-dragged.jstree-default ins { background:transparent !important; }
8130 +#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
8131 +#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
8132 +#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
8133 +
8134 +.jstree-default a.jstree-search { color:aqua; }
8135 +.jstree-default .jstree-locked a { color:silver; cursor:default; }
8136 +
8137 +#vakata-contextmenu.jstree-default-context,
8138 +#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
8139 +#vakata-contextmenu.jstree-default-context li { }
8140 +#vakata-contextmenu.jstree-default-context a { color:black; }
8141 +#vakata-contextmenu.jstree-default-context a:hover,
8142 +#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
8143 +#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
8144 +#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
8145 +#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
8146 +#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
8147 +
8148 +/* IE6 BEGIN */
8149 +.jstree-default li,
8150 +.jstree-default ins,
8151 +#vakata-dragged.jstree-default .jstree-invalid,
8152 +#vakata-dragged.jstree-default .jstree-ok,
8153 +#jstree-marker.jstree-default { _background-image:url("d.gif"); }
8154 +.jstree-default .jstree-open ins { _background-position:-72px 0; }
8155 +.jstree-default .jstree-closed ins { _background-position:-54px 0; }
8156 +.jstree-default .jstree-leaf ins { _background-position:-36px 0; }
8157 +.jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
8158 +#vakata-contextmenu.jstree-default-context ins { _display:none; }
8159 +#vakata-contextmenu.jstree-default-context li { _zoom:1; }
8160 +.jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
8161 +.jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
8162 +.jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
8163 +/* IE6 END */
8164 \ No newline at end of file
8165 diff -up cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif.legal cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif
8166 Binary files cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif.legal and cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif differ