Commit 239350703e0b39a0b30db97057d87d804475788f

Fix faulty gitignore and add js/lib

  For virtualenv, all lib directories were to gitignore-d; that caused js/lib
to get ignored. Fix that with only root level lib to be ignored.
.gitignore
(4 / 4)
  
22*.pyc
33conf.py
44# For virtual-env
5bin/
6lib/
7local/
8include/
5/bin/
6/lib/
7/local/
8/include/
  
1// Backbone.js 1.0.0
2
3// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
4// Backbone may be freely distributed under the MIT license.
5// For all details and documentation:
6// http://backbonejs.org
7
8(function(){
9
10 // Initial Setup
11 // -------------
12
13 // Save a reference to the global object (`window` in the browser, `exports`
14 // on the server).
15 var root = this;
16
17 // Save the previous value of the `Backbone` variable, so that it can be
18 // restored later on, if `noConflict` is used.
19 var previousBackbone = root.Backbone;
20
21 // Create local references to array methods we'll want to use later.
22 var array = [];
23 var push = array.push;
24 var slice = array.slice;
25 var splice = array.splice;
26
27 // The top-level namespace. All public Backbone classes and modules will
28 // be attached to this. Exported for both the browser and the server.
29 var Backbone;
30 if (typeof exports !== 'undefined') {
31 Backbone = exports;
32 } else {
33 Backbone = root.Backbone = {};
34 }
35
36 // Current version of the library. Keep in sync with `package.json`.
37 Backbone.VERSION = '1.0.0';
38
39 // Require Underscore, if we're on the server, and it's not already present.
40 var _ = root._;
41 if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
42
43 // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
44 // the `$` variable.
45 Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;
46
47 // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
48 // to its previous owner. Returns a reference to this Backbone object.
49 Backbone.noConflict = function() {
50 root.Backbone = previousBackbone;
51 return this;
52 };
53
54 // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
55 // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
56 // set a `X-Http-Method-Override` header.
57 Backbone.emulateHTTP = false;
58
59 // Turn on `emulateJSON` to support legacy servers that can't deal with direct
60 // `application/json` requests ... will encode the body as
61 // `application/x-www-form-urlencoded` instead and will send the model in a
62 // form param named `model`.
63 Backbone.emulateJSON = false;
64
65 // Backbone.Events
66 // ---------------
67
68 // A module that can be mixed in to *any object* in order to provide it with
69 // custom events. You may bind with `on` or remove with `off` callback
70 // functions to an event; `trigger`-ing an event fires all callbacks in
71 // succession.
72 //
73 // var object = {};
74 // _.extend(object, Backbone.Events);
75 // object.on('expand', function(){ alert('expanded'); });
76 // object.trigger('expand');
77 //
78 var Events = Backbone.Events = {
79
80 // Bind an event to a `callback` function. Passing `"all"` will bind
81 // the callback to all events fired.
82 on: function(name, callback, context) {
83 if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
84 this._events || (this._events = {});
85 var events = this._events[name] || (this._events[name] = []);
86 events.push({callback: callback, context: context, ctx: context || this});
87 return this;
88 },
89
90 // Bind an event to only be triggered a single time. After the first time
91 // the callback is invoked, it will be removed.
92 once: function(name, callback, context) {
93 if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
94 var self = this;
95 var once = _.once(function() {
96 self.off(name, once);
97 callback.apply(this, arguments);
98 });
99 once._callback = callback;
100 return this.on(name, once, context);
101 },
102
103 // Remove one or many callbacks. If `context` is null, removes all
104 // callbacks with that function. If `callback` is null, removes all
105 // callbacks for the event. If `name` is null, removes all bound
106 // callbacks for all events.
107 off: function(name, callback, context) {
108 var retain, ev, events, names, i, l, j, k;
109 if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
110 if (!name && !callback && !context) {
111 this._events = {};
112 return this;
113 }
114
115 names = name ? [name] : _.keys(this._events);
116 for (i = 0, l = names.length; i < l; i++) {
117 name = names[i];
118 if (events = this._events[name]) {
119 this._events[name] = retain = [];
120 if (callback || context) {
121 for (j = 0, k = events.length; j < k; j++) {
122 ev = events[j];
123 if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
124 (context && context !== ev.context)) {
125 retain.push(ev);
126 }
127 }
128 }
129 if (!retain.length) delete this._events[name];
130 }
131 }
132
133 return this;
134 },
135
136 // Trigger one or many events, firing all bound callbacks. Callbacks are
137 // passed the same arguments as `trigger` is, apart from the event name
138 // (unless you're listening on `"all"`, which will cause your callback to
139 // receive the true name of the event as the first argument).
140 trigger: function(name) {
141 if (!this._events) return this;
142 var args = slice.call(arguments, 1);
143 if (!eventsApi(this, 'trigger', name, args)) return this;
144 var events = this._events[name];
145 var allEvents = this._events.all;
146 if (events) triggerEvents(events, args);
147 if (allEvents) triggerEvents(allEvents, arguments);
148 return this;
149 },
150
151 // Tell this object to stop listening to either specific events ... or
152 // to every object it's currently listening to.
153 stopListening: function(obj, name, callback) {
154 var listeners = this._listeners;
155 if (!listeners) return this;
156 var deleteListener = !name && !callback;
157 if (typeof name === 'object') callback = this;
158 if (obj) (listeners = {})[obj._listenerId] = obj;
159 for (var id in listeners) {
160 listeners[id].off(name, callback, this);
161 if (deleteListener) delete this._listeners[id];
162 }
163 return this;
164 }
165
166 };
167
168 // Regular expression used to split event strings.
169 var eventSplitter = /\s+/;
170
171 // Implement fancy features of the Events API such as multiple event
172 // names `"change blur"` and jQuery-style event maps `{change: action}`
173 // in terms of the existing API.
174 var eventsApi = function(obj, action, name, rest) {
175 if (!name) return true;
176
177 // Handle event maps.
178 if (typeof name === 'object') {
179 for (var key in name) {
180 obj[action].apply(obj, [key, name[key]].concat(rest));
181 }
182 return false;
183 }
184
185 // Handle space separated event names.
186 if (eventSplitter.test(name)) {
187 var names = name.split(eventSplitter);
188 for (var i = 0, l = names.length; i < l; i++) {
189 obj[action].apply(obj, [names[i]].concat(rest));
190 }
191 return false;
192 }
193
194 return true;
195 };
196
197 // A difficult-to-believe, but optimized internal dispatch function for
198 // triggering events. Tries to keep the usual cases speedy (most internal
199 // Backbone events have 3 arguments).
200 var triggerEvents = function(events, args) {
201 var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
202 switch (args.length) {
203 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
204 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
205 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
206 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
207 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
208 }
209 };
210
211 var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
212
213 // Inversion-of-control versions of `on` and `once`. Tell *this* object to
214 // listen to an event in another object ... keeping track of what it's
215 // listening to.
216 _.each(listenMethods, function(implementation, method) {
217 Events[method] = function(obj, name, callback) {
218 var listeners = this._listeners || (this._listeners = {});
219 var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
220 listeners[id] = obj;
221 if (typeof name === 'object') callback = this;
222 obj[implementation](name, callback, this);
223 return this;
224 };
225 });
226
227 // Aliases for backwards compatibility.
228 Events.bind = Events.on;
229 Events.unbind = Events.off;
230
231 // Allow the `Backbone` object to serve as a global event bus, for folks who
232 // want global "pubsub" in a convenient place.
233 _.extend(Backbone, Events);
234
235 // Backbone.Model
236 // --------------
237
238 // Backbone **Models** are the basic data object in the framework --
239 // frequently representing a row in a table in a database on your server.
240 // A discrete chunk of data and a bunch of useful, related methods for
241 // performing computations and transformations on that data.
242
243 // Create a new model with the specified attributes. A client id (`cid`)
244 // is automatically generated and assigned for you.
245 var Model = Backbone.Model = function(attributes, options) {
246 var defaults;
247 var attrs = attributes || {};
248 options || (options = {});
249 this.cid = _.uniqueId('c');
250 this.attributes = {};
251 _.extend(this, _.pick(options, modelOptions));
252 if (options.parse) attrs = this.parse(attrs, options) || {};
253 if (defaults = _.result(this, 'defaults')) {
254 attrs = _.defaults({}, attrs, defaults);
255 }
256 this.set(attrs, options);
257 this.changed = {};
258 this.initialize.apply(this, arguments);
259 };
260
261 // A list of options to be attached directly to the model, if provided.
262 var modelOptions = ['url', 'urlRoot', 'collection'];
263
264 // Attach all inheritable methods to the Model prototype.
265 _.extend(Model.prototype, Events, {
266
267 // A hash of attributes whose current and previous value differ.
268 changed: null,
269
270 // The value returned during the last failed validation.
271 validationError: null,
272
273 // The default name for the JSON `id` attribute is `"id"`. MongoDB and
274 // CouchDB users may want to set this to `"_id"`.
275 idAttribute: 'id',
276
277 // Initialize is an empty function by default. Override it with your own
278 // initialization logic.
279 initialize: function(){},
280
281 // Return a copy of the model's `attributes` object.
282 toJSON: function(options) {
283 return _.clone(this.attributes);
284 },
285
286 // Proxy `Backbone.sync` by default -- but override this if you need
287 // custom syncing semantics for *this* particular model.
288 sync: function() {
289 return Backbone.sync.apply(this, arguments);
290 },
291
292 // Get the value of an attribute.
293 get: function(attr) {
294 return this.attributes[attr];
295 },
296
297 // Get the HTML-escaped value of an attribute.
298 escape: function(attr) {
299 return _.escape(this.get(attr));
300 },
301
302 // Returns `true` if the attribute contains a value that is not null
303 // or undefined.
304 has: function(attr) {
305 return this.get(attr) != null;
306 },
307
308 // Set a hash of model attributes on the object, firing `"change"`. This is
309 // the core primitive operation of a model, updating the data and notifying
310 // anyone who needs to know about the change in state. The heart of the beast.
311 set: function(key, val, options) {
312 var attr, attrs, unset, changes, silent, changing, prev, current;
313 if (key == null) return this;
314
315 // Handle both `"key", value` and `{key: value}` -style arguments.
316 if (typeof key === 'object') {
317 attrs = key;
318 options = val;
319 } else {
320 (attrs = {})[key] = val;
321 }
322
323 options || (options = {});
324
325 // Run validation.
326 if (!this._validate(attrs, options)) return false;
327
328 // Extract attributes and options.
329 unset = options.unset;
330 silent = options.silent;
331 changes = [];
332 changing = this._changing;
333 this._changing = true;
334
335 if (!changing) {
336 this._previousAttributes = _.clone(this.attributes);
337 this.changed = {};
338 }
339 current = this.attributes, prev = this._previousAttributes;
340
341 // Check for changes of `id`.
342 if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
343
344 // For each `set` attribute, update or delete the current value.
345 for (attr in attrs) {
346 val = attrs[attr];
347 if (!_.isEqual(current[attr], val)) changes.push(attr);
348 if (!_.isEqual(prev[attr], val)) {
349 this.changed[attr] = val;
350 } else {
351 delete this.changed[attr];
352 }
353 unset ? delete current[attr] : current[attr] = val;
354 }
355
356 // Trigger all relevant attribute changes.
357 if (!silent) {
358 if (changes.length) this._pending = true;
359 for (var i = 0, l = changes.length; i < l; i++) {
360 this.trigger('change:' + changes[i], this, current[changes[i]], options);
361 }
362 }
363
364 // You might be wondering why there's a `while` loop here. Changes can
365 // be recursively nested within `"change"` events.
366 if (changing) return this;
367 if (!silent) {
368 while (this._pending) {
369 this._pending = false;
370 this.trigger('change', this, options);
371 }
372 }
373 this._pending = false;
374 this._changing = false;
375 return this;
376 },
377
378 // Remove an attribute from the model, firing `"change"`. `unset` is a noop
379 // if the attribute doesn't exist.
380 unset: function(attr, options) {
381 return this.set(attr, void 0, _.extend({}, options, {unset: true}));
382 },
383
384 // Clear all attributes on the model, firing `"change"`.
385 clear: function(options) {
386 var attrs = {};
387 for (var key in this.attributes) attrs[key] = void 0;
388 return this.set(attrs, _.extend({}, options, {unset: true}));
389 },
390
391 // Determine if the model has changed since the last `"change"` event.
392 // If you specify an attribute name, determine if that attribute has changed.
393 hasChanged: function(attr) {
394 if (attr == null) return !_.isEmpty(this.changed);
395 return _.has(this.changed, attr);
396 },
397
398 // Return an object containing all the attributes that have changed, or
399 // false if there are no changed attributes. Useful for determining what
400 // parts of a view need to be updated and/or what attributes need to be
401 // persisted to the server. Unset attributes will be set to undefined.
402 // You can also pass an attributes object to diff against the model,
403 // determining if there *would be* a change.
404 changedAttributes: function(diff) {
405 if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
406 var val, changed = false;
407 var old = this._changing ? this._previousAttributes : this.attributes;
408 for (var attr in diff) {
409 if (_.isEqual(old[attr], (val = diff[attr]))) continue;
410 (changed || (changed = {}))[attr] = val;
411 }
412 return changed;
413 },
414
415 // Get the previous value of an attribute, recorded at the time the last
416 // `"change"` event was fired.
417 previous: function(attr) {
418 if (attr == null || !this._previousAttributes) return null;
419 return this._previousAttributes[attr];
420 },
421
422 // Get all of the attributes of the model at the time of the previous
423 // `"change"` event.
424 previousAttributes: function() {
425 return _.clone(this._previousAttributes);
426 },
427
428 // Fetch the model from the server. If the server's representation of the
429 // model differs from its current attributes, they will be overridden,
430 // triggering a `"change"` event.
431 fetch: function(options) {
432 options = options ? _.clone(options) : {};
433 if (options.parse === void 0) options.parse = true;
434 var model = this;
435 var success = options.success;
436 options.success = function(resp) {
437 if (!model.set(model.parse(resp, options), options)) return false;
438 if (success) success(model, resp, options);
439 model.trigger('sync', model, resp, options);
440 };
441 wrapError(this, options);
442 return this.sync('read', this, options);
443 },
444
445 // Set a hash of model attributes, and sync the model to the server.
446 // If the server returns an attributes hash that differs, the model's
447 // state will be `set` again.
448 save: function(key, val, options) {
449 var attrs, method, xhr, attributes = this.attributes;
450
451 // Handle both `"key", value` and `{key: value}` -style arguments.
452 if (key == null || typeof key === 'object') {
453 attrs = key;
454 options = val;
455 } else {
456 (attrs = {})[key] = val;
457 }
458
459 // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
460 if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
461
462 options = _.extend({validate: true}, options);
463
464 // Do not persist invalid models.
465 if (!this._validate(attrs, options)) return false;
466
467 // Set temporary attributes if `{wait: true}`.
468 if (attrs && options.wait) {
469 this.attributes = _.extend({}, attributes, attrs);
470 }
471
472 // After a successful server-side save, the client is (optionally)
473 // updated with the server-side state.
474 if (options.parse === void 0) options.parse = true;
475 var model = this;
476 var success = options.success;
477 options.success = function(resp) {
478 // Ensure attributes are restored during synchronous saves.
479 model.attributes = attributes;
480 var serverAttrs = model.parse(resp, options);
481 if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
482 if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
483 return false;
484 }
485 if (success) success(model, resp, options);
486 model.trigger('sync', model, resp, options);
487 };
488 wrapError(this, options);
489
490 method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
491 if (method === 'patch') options.attrs = attrs;
492 xhr = this.sync(method, this, options);
493
494 // Restore attributes.
495 if (attrs && options.wait) this.attributes = attributes;
496
497 return xhr;
498 },
499
500 // Destroy this model on the server if it was already persisted.
501 // Optimistically removes the model from its collection, if it has one.
502 // If `wait: true` is passed, waits for the server to respond before removal.
503 destroy: function(options) {
504 options = options ? _.clone(options) : {};
505 var model = this;
506 var success = options.success;
507
508 var destroy = function() {
509 model.trigger('destroy', model, model.collection, options);
510 };
511
512 options.success = function(resp) {
513 if (options.wait || model.isNew()) destroy();
514 if (success) success(model, resp, options);
515 if (!model.isNew()) model.trigger('sync', model, resp, options);
516 };
517
518 if (this.isNew()) {
519 options.success();
520 return false;
521 }
522 wrapError(this, options);
523
524 var xhr = this.sync('delete', this, options);
525 if (!options.wait) destroy();
526 return xhr;
527 },
528
529 // Default URL for the model's representation on the server -- if you're
530 // using Backbone's restful methods, override this to change the endpoint
531 // that will be called.
532 url: function() {
533 var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
534 if (this.isNew()) return base;
535 return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
536 },
537
538 // **parse** converts a response into the hash of attributes to be `set` on
539 // the model. The default implementation is just to pass the response along.
540 parse: function(resp, options) {
541 return resp;
542 },
543
544 // Create a new model with identical attributes to this one.
545 clone: function() {
546 return new this.constructor(this.attributes);
547 },
548
549 // A model is new if it has never been saved to the server, and lacks an id.
550 isNew: function() {
551 return this.id == null;
552 },
553
554 // Check if the model is currently in a valid state.
555 isValid: function(options) {
556 return this._validate({}, _.extend(options || {}, { validate: true }));
557 },
558
559 // Run validation against the next complete set of model attributes,
560 // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
561 _validate: function(attrs, options) {
562 if (!options.validate || !this.validate) return true;
563 attrs = _.extend({}, this.attributes, attrs);
564 var error = this.validationError = this.validate(attrs, options) || null;
565 if (!error) return true;
566 this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
567 return false;
568 }
569
570 });
571
572 // Underscore methods that we want to implement on the Model.
573 var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
574
575 // Mix in each Underscore method as a proxy to `Model#attributes`.
576 _.each(modelMethods, function(method) {
577 Model.prototype[method] = function() {
578 var args = slice.call(arguments);
579 args.unshift(this.attributes);
580 return _[method].apply(_, args);
581 };
582 });
583
584 // Backbone.Collection
585 // -------------------
586
587 // If models tend to represent a single row of data, a Backbone Collection is
588 // more analagous to a table full of data ... or a small slice or page of that
589 // table, or a collection of rows that belong together for a particular reason
590 // -- all of the messages in this particular folder, all of the documents
591 // belonging to this particular author, and so on. Collections maintain
592 // indexes of their models, both in order, and for lookup by `id`.
593
594 // Create a new **Collection**, perhaps to contain a specific type of `model`.
595 // If a `comparator` is specified, the Collection will maintain
596 // its models in sort order, as they're added and removed.
597 var Collection = Backbone.Collection = function(models, options) {
598 options || (options = {});
599 if (options.url) this.url = options.url;
600 if (options.model) this.model = options.model;
601 if (options.comparator !== void 0) this.comparator = options.comparator;
602 this._reset();
603 this.initialize.apply(this, arguments);
604 if (models) this.reset(models, _.extend({silent: true}, options));
605 };
606
607 // Default options for `Collection#set`.
608 var setOptions = {add: true, remove: true, merge: true};
609 var addOptions = {add: true, merge: false, remove: false};
610
611 // Define the Collection's inheritable methods.
612 _.extend(Collection.prototype, Events, {
613
614 // The default model for a collection is just a **Backbone.Model**.
615 // This should be overridden in most cases.
616 model: Model,
617
618 // Initialize is an empty function by default. Override it with your own
619 // initialization logic.
620 initialize: function(){},
621
622 // The JSON representation of a Collection is an array of the
623 // models' attributes.
624 toJSON: function(options) {
625 return this.map(function(model){ return model.toJSON(options); });
626 },
627
628 // Proxy `Backbone.sync` by default.
629 sync: function() {
630 return Backbone.sync.apply(this, arguments);
631 },
632
633 // Add a model, or list of models to the set.
634 add: function(models, options) {
635 return this.set(models, _.defaults(options || {}, addOptions));
636 },
637
638 // Remove a model, or a list of models from the set.
639 remove: function(models, options) {
640 models = _.isArray(models) ? models.slice() : [models];
641 options || (options = {});
642 var i, l, index, model;
643 for (i = 0, l = models.length; i < l; i++) {
644 model = this.get(models[i]);
645 if (!model) continue;
646 delete this._byId[model.id];
647 delete this._byId[model.cid];
648 index = this.indexOf(model);
649 this.models.splice(index, 1);
650 this.length--;
651 if (!options.silent) {
652 options.index = index;
653 model.trigger('remove', model, this, options);
654 }
655 this._removeReference(model);
656 }
657 return this;
658 },
659
660 // Update a collection by `set`-ing a new list of models, adding new ones,
661 // removing models that are no longer present, and merging models that
662 // already exist in the collection, as necessary. Similar to **Model#set**,
663 // the core operation for updating the data contained by the collection.
664 set: function(models, options) {
665 options = _.defaults(options || {}, setOptions);
666 if (options.parse) models = this.parse(models, options);
667 if (!_.isArray(models)) models = models ? [models] : [];
668 var i, l, model, attrs, existing, sort;
669 var at = options.at;
670 var sortable = this.comparator && (at == null) && options.sort !== false;
671 var sortAttr = _.isString(this.comparator) ? this.comparator : null;
672 var toAdd = [], toRemove = [], modelMap = {};
673
674 // Turn bare objects into model references, and prevent invalid models
675 // from being added.
676 for (i = 0, l = models.length; i < l; i++) {
677 if (!(model = this._prepareModel(models[i], options))) continue;
678
679 // If a duplicate is found, prevent it from being added and
680 // optionally merge it into the existing model.
681 if (existing = this.get(model)) {
682 if (options.remove) modelMap[existing.cid] = true;
683 if (options.merge) {
684 existing.set(model.attributes, options);
685 if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
686 }
687
688 // This is a new model, push it to the `toAdd` list.
689 } else if (options.add) {
690 toAdd.push(model);
691
692 // Listen to added models' events, and index models for lookup by
693 // `id` and by `cid`.
694 model.on('all', this._onModelEvent, this);
695 this._byId[model.cid] = model;
696 if (model.id != null) this._byId[model.id] = model;
697 }
698 }
699
700 // Remove nonexistent models if appropriate.
701 if (options.remove) {
702 for (i = 0, l = this.length; i < l; ++i) {
703 if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
704 }
705 if (toRemove.length) this.remove(toRemove, options);
706 }
707
708 // See if sorting is needed, update `length` and splice in new models.
709 if (toAdd.length) {
710 if (sortable) sort = true;
711 this.length += toAdd.length;
712 if (at != null) {
713 splice.apply(this.models, [at, 0].concat(toAdd));
714 } else {
715 push.apply(this.models, toAdd);
716 }
717 }
718
719 // Silently sort the collection if appropriate.
720 if (sort) this.sort({silent: true});
721
722 if (options.silent) return this;
723
724 // Trigger `add` events.
725 for (i = 0, l = toAdd.length; i < l; i++) {
726 (model = toAdd[i]).trigger('add', model, this, options);
727 }
728
729 // Trigger `sort` if the collection was sorted.
730 if (sort) this.trigger('sort', this, options);
731 return this;
732 },
733
734 // When you have more items than you want to add or remove individually,
735 // you can reset the entire set with a new list of models, without firing
736 // any granular `add` or `remove` events. Fires `reset` when finished.
737 // Useful for bulk operations and optimizations.
738 reset: function(models, options) {
739 options || (options = {});
740 for (var i = 0, l = this.models.length; i < l; i++) {
741 this._removeReference(this.models[i]);
742 }
743 options.previousModels = this.models;
744 this._reset();
745 this.add(models, _.extend({silent: true}, options));
746 if (!options.silent) this.trigger('reset', this, options);
747 return this;
748 },
749
750 // Add a model to the end of the collection.
751 push: function(model, options) {
752 model = this._prepareModel(model, options);
753 this.add(model, _.extend({at: this.length}, options));
754 return model;
755 },
756
757 // Remove a model from the end of the collection.
758 pop: function(options) {
759 var model = this.at(this.length - 1);
760 this.remove(model, options);
761 return model;
762 },
763
764 // Add a model to the beginning of the collection.
765 unshift: function(model, options) {
766 model = this._prepareModel(model, options);
767 this.add(model, _.extend({at: 0}, options));
768 return model;
769 },
770
771 // Remove a model from the beginning of the collection.
772 shift: function(options) {
773 var model = this.at(0);
774 this.remove(model, options);
775 return model;
776 },
777
778 // Slice out a sub-array of models from the collection.
779 slice: function(begin, end) {
780 return this.models.slice(begin, end);
781 },
782
783 // Get a model from the set by id.
784 get: function(obj) {
785 if (obj == null) return void 0;
786 return this._byId[obj.id != null ? obj.id : obj.cid || obj];
787 },
788
789 // Get the model at the given index.
790 at: function(index) {
791 return this.models[index];
792 },
793
794 // Return models with matching attributes. Useful for simple cases of
795 // `filter`.
796 where: function(attrs, first) {
797 if (_.isEmpty(attrs)) return first ? void 0 : [];
798 return this[first ? 'find' : 'filter'](function(model) {
799 for (var key in attrs) {
800 if (attrs[key] !== model.get(key)) return false;
801 }
802 return true;
803 });
804 },
805
806 // Return the first model with matching attributes. Useful for simple cases
807 // of `find`.
808 findWhere: function(attrs) {
809 return this.where(attrs, true);
810 },
811
812 // Force the collection to re-sort itself. You don't need to call this under
813 // normal circumstances, as the set will maintain sort order as each item
814 // is added.
815 sort: function(options) {
816 if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
817 options || (options = {});
818
819 // Run sort based on type of `comparator`.
820 if (_.isString(this.comparator) || this.comparator.length === 1) {
821 this.models = this.sortBy(this.comparator, this);
822 } else {
823 this.models.sort(_.bind(this.comparator, this));
824 }
825
826 if (!options.silent) this.trigger('sort', this, options);
827 return this;
828 },
829
830 // Figure out the smallest index at which a model should be inserted so as
831 // to maintain order.
832 sortedIndex: function(model, value, context) {
833 value || (value = this.comparator);
834 var iterator = _.isFunction(value) ? value : function(model) {
835 return model.get(value);
836 };
837 return _.sortedIndex(this.models, model, iterator, context);
838 },
839
840 // Pluck an attribute from each model in the collection.
841 pluck: function(attr) {
842 return _.invoke(this.models, 'get', attr);
843 },
844
845 // Fetch the default set of models for this collection, resetting the
846 // collection when they arrive. If `reset: true` is passed, the response
847 // data will be passed through the `reset` method instead of `set`.
848 fetch: function(options) {
849 options = options ? _.clone(options) : {};
850 if (options.parse === void 0) options.parse = true;
851 var success = options.success;
852 var collection = this;
853 options.success = function(resp) {
854 var method = options.reset ? 'reset' : 'set';
855 collection[method](resp, options);
856 if (success) success(collection, resp, options);
857 collection.trigger('sync', collection, resp, options);
858 };
859 wrapError(this, options);
860 return this.sync('read', this, options);
861 },
862
863 // Create a new instance of a model in this collection. Add the model to the
864 // collection immediately, unless `wait: true` is passed, in which case we
865 // wait for the server to agree.
866 create: function(model, options) {
867 options = options ? _.clone(options) : {};
868 if (!(model = this._prepareModel(model, options))) return false;
869 if (!options.wait) this.add(model, options);
870 var collection = this;
871 var success = options.success;
872 options.success = function(resp) {
873 if (options.wait) collection.add(model, options);
874 if (success) success(model, resp, options);
875 };
876 model.save(null, options);
877 return model;
878 },
879
880 // **parse** converts a response into a list of models to be added to the
881 // collection. The default implementation is just to pass it through.
882 parse: function(resp, options) {
883 return resp;
884 },
885
886 // Create a new collection with an identical list of models as this one.
887 clone: function() {
888 return new this.constructor(this.models);
889 },
890
891 // Private method to reset all internal state. Called when the collection
892 // is first initialized or reset.
893 _reset: function() {
894 this.length = 0;
895 this.models = [];
896 this._byId = {};
897 },
898
899 // Prepare a hash of attributes (or other model) to be added to this
900 // collection.
901 _prepareModel: function(attrs, options) {
902 if (attrs instanceof Model) {
903 if (!attrs.collection) attrs.collection = this;
904 return attrs;
905 }
906 options || (options = {});
907 options.collection = this;
908 var model = new this.model(attrs, options);
909 if (!model._validate(attrs, options)) {
910 this.trigger('invalid', this, attrs, options);
911 return false;
912 }
913 return model;
914 },
915
916 // Internal method to sever a model's ties to a collection.
917 _removeReference: function(model) {
918 if (this === model.collection) delete model.collection;
919 model.off('all', this._onModelEvent, this);
920 },
921
922 // Internal method called every time a model in the set fires an event.
923 // Sets need to update their indexes when models change ids. All other
924 // events simply proxy through. "add" and "remove" events that originate
925 // in other collections are ignored.
926 _onModelEvent: function(event, model, collection, options) {
927 if ((event === 'add' || event === 'remove') && collection !== this) return;
928 if (event === 'destroy') this.remove(model, options);
929 if (model && event === 'change:' + model.idAttribute) {
930 delete this._byId[model.previous(model.idAttribute)];
931 if (model.id != null) this._byId[model.id] = model;
932 }
933 this.trigger.apply(this, arguments);
934 }
935
936 });
937
938 // Underscore methods that we want to implement on the Collection.
939 // 90% of the core usefulness of Backbone Collections is actually implemented
940 // right here:
941 var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
942 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
943 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
944 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
945 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
946 'isEmpty', 'chain'];
947
948 // Mix in each Underscore method as a proxy to `Collection#models`.
949 _.each(methods, function(method) {
950 Collection.prototype[method] = function() {
951 var args = slice.call(arguments);
952 args.unshift(this.models);
953 return _[method].apply(_, args);
954 };
955 });
956
957 // Underscore methods that take a property name as an argument.
958 var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
959
960 // Use attributes instead of properties.
961 _.each(attributeMethods, function(method) {
962 Collection.prototype[method] = function(value, context) {
963 var iterator = _.isFunction(value) ? value : function(model) {
964 return model.get(value);
965 };
966 return _[method](this.models, iterator, context);
967 };
968 });
969
970 // Backbone.View
971 // -------------
972
973 // Backbone Views are almost more convention than they are actual code. A View
974 // is simply a JavaScript object that represents a logical chunk of UI in the
975 // DOM. This might be a single item, an entire list, a sidebar or panel, or
976 // even the surrounding frame which wraps your whole app. Defining a chunk of
977 // UI as a **View** allows you to define your DOM events declaratively, without
978 // having to worry about render order ... and makes it easy for the view to
979 // react to specific changes in the state of your models.
980
981 // Creating a Backbone.View creates its initial element outside of the DOM,
982 // if an existing element is not provided...
983 var View = Backbone.View = function(options) {
984 this.cid = _.uniqueId('view');
985 this._configure(options || {});
986 this._ensureElement();
987 this.initialize.apply(this, arguments);
988 this.delegateEvents();
989 };
990
991 // Cached regex to split keys for `delegate`.
992 var delegateEventSplitter = /^(\S+)\s*(.*)$/;
993
994 // List of view options to be merged as properties.
995 var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
996
997 // Set up all inheritable **Backbone.View** properties and methods.
998 _.extend(View.prototype, Events, {
999
1000 // The default `tagName` of a View's element is `"div"`.
1001 tagName: 'div',
1002
1003 // jQuery delegate for element lookup, scoped to DOM elements within the
1004 // current view. This should be prefered to global lookups where possible.
1005 $: function(selector) {
1006 return this.$el.find(selector);
1007 },
1008
1009 // Initialize is an empty function by default. Override it with your own
1010 // initialization logic.
1011 initialize: function(){},
1012
1013 // **render** is the core function that your view should override, in order
1014 // to populate its element (`this.el`), with the appropriate HTML. The
1015 // convention is for **render** to always return `this`.
1016 render: function() {
1017 return this;
1018 },
1019
1020 // Remove this view by taking the element out of the DOM, and removing any
1021 // applicable Backbone.Events listeners.
1022 remove: function() {
1023 this.$el.remove();
1024 this.stopListening();
1025 return this;
1026 },
1027
1028 // Change the view's element (`this.el` property), including event
1029 // re-delegation.
1030 setElement: function(element, delegate) {
1031 if (this.$el) this.undelegateEvents();
1032 this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
1033 this.el = this.$el[0];
1034 if (delegate !== false) this.delegateEvents();
1035 return this;
1036 },
1037
1038 // Set callbacks, where `this.events` is a hash of
1039 //
1040 // *{"event selector": "callback"}*
1041 //
1042 // {
1043 // 'mousedown .title': 'edit',
1044 // 'click .button': 'save'
1045 // 'click .open': function(e) { ... }
1046 // }
1047 //
1048 // pairs. Callbacks will be bound to the view, with `this` set properly.
1049 // Uses event delegation for efficiency.
1050 // Omitting the selector binds the event to `this.el`.
1051 // This only works for delegate-able events: not `focus`, `blur`, and
1052 // not `change`, `submit`, and `reset` in Internet Explorer.
1053 delegateEvents: function(events) {
1054 if (!(events || (events = _.result(this, 'events')))) return this;
1055 this.undelegateEvents();
1056 for (var key in events) {
1057 var method = events[key];
1058 if (!_.isFunction(method)) method = this[events[key]];
1059 if (!method) continue;
1060
1061 var match = key.match(delegateEventSplitter);
1062 var eventName = match[1], selector = match[2];
1063 method = _.bind(method, this);
1064 eventName += '.delegateEvents' + this.cid;
1065 if (selector === '') {
1066 this.$el.on(eventName, method);
1067 } else {
1068 this.$el.on(eventName, selector, method);
1069 }
1070 }
1071 return this;
1072 },
1073
1074 // Clears all callbacks previously bound to the view with `delegateEvents`.
1075 // You usually don't need to use this, but may wish to if you have multiple
1076 // Backbone views attached to the same DOM element.
1077 undelegateEvents: function() {
1078 this.$el.off('.delegateEvents' + this.cid);
1079 return this;
1080 },
1081
1082 // Performs the initial configuration of a View with a set of options.
1083 // Keys with special meaning *(e.g. model, collection, id, className)* are
1084 // attached directly to the view. See `viewOptions` for an exhaustive
1085 // list.
1086 _configure: function(options) {
1087 if (this.options) options = _.extend({}, _.result(this, 'options'), options);
1088 _.extend(this, _.pick(options, viewOptions));
1089 this.options = options;
1090 },
1091
1092 // Ensure that the View has a DOM element to render into.
1093 // If `this.el` is a string, pass it through `$()`, take the first
1094 // matching element, and re-assign it to `el`. Otherwise, create
1095 // an element from the `id`, `className` and `tagName` properties.
1096 _ensureElement: function() {
1097 if (!this.el) {
1098 var attrs = _.extend({}, _.result(this, 'attributes'));
1099 if (this.id) attrs.id = _.result(this, 'id');
1100 if (this.className) attrs['class'] = _.result(this, 'className');
1101 var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
1102 this.setElement($el, false);
1103 } else {
1104 this.setElement(_.result(this, 'el'), false);
1105 }
1106 }
1107
1108 });
1109
1110 // Backbone.sync
1111 // -------------
1112
1113 // Override this function to change the manner in which Backbone persists
1114 // models to the server. You will be passed the type of request, and the
1115 // model in question. By default, makes a RESTful Ajax request
1116 // to the model's `url()`. Some possible customizations could be:
1117 //
1118 // * Use `setTimeout` to batch rapid-fire updates into a single request.
1119 // * Send up the models as XML instead of JSON.
1120 // * Persist models via WebSockets instead of Ajax.
1121 //
1122 // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
1123 // as `POST`, with a `_method` parameter containing the true HTTP method,
1124 // as well as all requests with the body as `application/x-www-form-urlencoded`
1125 // instead of `application/json` with the model in a param named `model`.
1126 // Useful when interfacing with server-side languages like **PHP** that make
1127 // it difficult to read the body of `PUT` requests.
1128 Backbone.sync = function(method, model, options) {
1129 var type = methodMap[method];
1130
1131 // Default options, unless specified.
1132 _.defaults(options || (options = {}), {
1133 emulateHTTP: Backbone.emulateHTTP,
1134 emulateJSON: Backbone.emulateJSON
1135 });
1136
1137 // Default JSON-request options.
1138 var params = {type: type, dataType: 'json'};
1139
1140 // Ensure that we have a URL.
1141 if (!options.url) {
1142 params.url = _.result(model, 'url') || urlError();
1143 }
1144
1145 // Ensure that we have the appropriate request data.
1146 if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
1147 params.contentType = 'application/json';
1148 params.data = JSON.stringify(options.attrs || model.toJSON(options));
1149 }
1150
1151 // For older servers, emulate JSON by encoding the request into an HTML-form.
1152 if (options.emulateJSON) {
1153 params.contentType = 'application/x-www-form-urlencoded';
1154 params.data = params.data ? {model: params.data} : {};
1155 }
1156
1157 // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
1158 // And an `X-HTTP-Method-Override` header.
1159 if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
1160 params.type = 'POST';
1161 if (options.emulateJSON) params.data._method = type;
1162 var beforeSend = options.beforeSend;
1163 options.beforeSend = function(xhr) {
1164 xhr.setRequestHeader('X-HTTP-Method-Override', type);
1165 if (beforeSend) return beforeSend.apply(this, arguments);
1166 };
1167 }
1168
1169 // Don't process data on a non-GET request.
1170 if (params.type !== 'GET' && !options.emulateJSON) {
1171 params.processData = false;
1172 }
1173
1174 // If we're sending a `PATCH` request, and we're in an old Internet Explorer
1175 // that still has ActiveX enabled by default, override jQuery to use that
1176 // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
1177 if (params.type === 'PATCH' && window.ActiveXObject &&
1178 !(window.external && window.external.msActiveXFilteringEnabled)) {
1179 params.xhr = function() {
1180 return new ActiveXObject("Microsoft.XMLHTTP");
1181 };
1182 }
1183
1184 // Make the request, allowing the user to override any Ajax options.
1185 var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
1186 model.trigger('request', model, xhr, options);
1187 return xhr;
1188 };
1189
1190 // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
1191 var methodMap = {
1192 'create': 'POST',
1193 'update': 'PUT',
1194 'patch': 'PATCH',
1195 'delete': 'DELETE',
1196 'read': 'GET'
1197 };
1198
1199 // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
1200 // Override this if you'd like to use a different library.
1201 Backbone.ajax = function() {
1202 return Backbone.$.ajax.apply(Backbone.$, arguments);
1203 };
1204
1205 // Backbone.Router
1206 // ---------------
1207
1208 // Routers map faux-URLs to actions, and fire events when routes are
1209 // matched. Creating a new one sets its `routes` hash, if not set statically.
1210 var Router = Backbone.Router = function(options) {
1211 options || (options = {});
1212 if (options.routes) this.routes = options.routes;
1213 this._bindRoutes();
1214 this.initialize.apply(this, arguments);
1215 };
1216
1217 // Cached regular expressions for matching named param parts and splatted
1218 // parts of route strings.
1219 var optionalParam = /\((.*?)\)/g;
1220 var namedParam = /(\(\?)?:\w+/g;
1221 var splatParam = /\*\w+/g;
1222 var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
1223
1224 // Set up all inheritable **Backbone.Router** properties and methods.
1225 _.extend(Router.prototype, Events, {
1226
1227 // Initialize is an empty function by default. Override it with your own
1228 // initialization logic.
1229 initialize: function(){},
1230
1231 // Manually bind a single named route to a callback. For example:
1232 //
1233 // this.route('search/:query/p:num', 'search', function(query, num) {
1234 // ...
1235 // });
1236 //
1237 route: function(route, name, callback) {
1238 if (!_.isRegExp(route)) route = this._routeToRegExp(route);
1239 if (_.isFunction(name)) {
1240 callback = name;
1241 name = '';
1242 }
1243 if (!callback) callback = this[name];
1244 var router = this;
1245 Backbone.history.route(route, function(fragment) {
1246 var args = router._extractParameters(route, fragment);
1247 callback && callback.apply(router, args);
1248 router.trigger.apply(router, ['route:' + name].concat(args));
1249 router.trigger('route', name, args);
1250 Backbone.history.trigger('route', router, name, args);
1251 });
1252 return this;
1253 },
1254
1255 // Simple proxy to `Backbone.history` to save a fragment into the history.
1256 navigate: function(fragment, options) {
1257 Backbone.history.navigate(fragment, options);
1258 return this;
1259 },
1260
1261 // Bind all defined routes to `Backbone.history`. We have to reverse the
1262 // order of the routes here to support behavior where the most general
1263 // routes can be defined at the bottom of the route map.
1264 _bindRoutes: function() {
1265 if (!this.routes) return;
1266 this.routes = _.result(this, 'routes');
1267 var route, routes = _.keys(this.routes);
1268 while ((route = routes.pop()) != null) {
1269 this.route(route, this.routes[route]);
1270 }
1271 },
1272
1273 // Convert a route string into a regular expression, suitable for matching
1274 // against the current location hash.
1275 _routeToRegExp: function(route) {
1276 route = route.replace(escapeRegExp, '\\$&')
1277 .replace(optionalParam, '(?:$1)?')
1278 .replace(namedParam, function(match, optional){
1279 return optional ? match : '([^\/]+)';
1280 })
1281 .replace(splatParam, '(.*?)');
1282 return new RegExp('^' + route + '$');
1283 },
1284
1285 // Given a route, and a URL fragment that it matches, return the array of
1286 // extracted decoded parameters. Empty or unmatched parameters will be
1287 // treated as `null` to normalize cross-browser behavior.
1288 _extractParameters: function(route, fragment) {
1289 var params = route.exec(fragment).slice(1);
1290 return _.map(params, function(param) {
1291 return param ? decodeURIComponent(param) : null;
1292 });
1293 }
1294
1295 });
1296
1297 // Backbone.History
1298 // ----------------
1299
1300 // Handles cross-browser history management, based on either
1301 // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
1302 // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
1303 // and URL fragments. If the browser supports neither (old IE, natch),
1304 // falls back to polling.
1305 var History = Backbone.History = function() {
1306 this.handlers = [];
1307 _.bindAll(this, 'checkUrl');
1308
1309 // Ensure that `History` can be used outside of the browser.
1310 if (typeof window !== 'undefined') {
1311 this.location = window.location;
1312 this.history = window.history;
1313 }
1314 };
1315
1316 // Cached regex for stripping a leading hash/slash and trailing space.
1317 var routeStripper = /^[#\/]|\s+$/g;
1318
1319 // Cached regex for stripping leading and trailing slashes.
1320 var rootStripper = /^\/+|\/+$/g;
1321
1322 // Cached regex for detecting MSIE.
1323 var isExplorer = /msie [\w.]+/;
1324
1325 // Cached regex for removing a trailing slash.
1326 var trailingSlash = /\/$/;
1327
1328 // Has the history handling already been started?
1329 History.started = false;
1330
1331 // Set up all inheritable **Backbone.History** properties and methods.
1332 _.extend(History.prototype, Events, {
1333
1334 // The default interval to poll for hash changes, if necessary, is
1335 // twenty times a second.
1336 interval: 50,
1337
1338 // Gets the true hash value. Cannot use location.hash directly due to bug
1339 // in Firefox where location.hash will always be decoded.
1340 getHash: function(window) {
1341 var match = (window || this).location.href.match(/#(.*)$/);
1342 return match ? match[1] : '';
1343 },
1344
1345 // Get the cross-browser normalized URL fragment, either from the URL,
1346 // the hash, or the override.
1347 getFragment: function(fragment, forcePushState) {
1348 if (fragment == null) {
1349 if (this._hasPushState || !this._wantsHashChange || forcePushState) {
1350 fragment = this.location.pathname;
1351 var root = this.root.replace(trailingSlash, '');
1352 if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
1353 } else {
1354 fragment = this.getHash();
1355 }
1356 }
1357 return fragment.replace(routeStripper, '');
1358 },
1359
1360 // Start the hash change handling, returning `true` if the current URL matches
1361 // an existing route, and `false` otherwise.
1362 start: function(options) {
1363 if (History.started) throw new Error("Backbone.history has already been started");
1364 History.started = true;
1365
1366 // Figure out the initial configuration. Do we need an iframe?
1367 // Is pushState desired ... is it available?
1368 this.options = _.extend({}, {root: '/'}, this.options, options);
1369 this.root = this.options.root;
1370 this._wantsHashChange = this.options.hashChange !== false;
1371 this._wantsPushState = !!this.options.pushState;
1372 this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
1373 var fragment = this.getFragment();
1374 var docMode = document.documentMode;
1375 var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
1376
1377 // Normalize root to always include a leading and trailing slash.
1378 this.root = ('/' + this.root + '/').replace(rootStripper, '/');
1379
1380 if (oldIE && this._wantsHashChange) {
1381 this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
1382 this.navigate(fragment);
1383 }
1384
1385 // Depending on whether we're using pushState or hashes, and whether
1386 // 'onhashchange' is supported, determine how we check the URL state.
1387 if (this._hasPushState) {
1388 Backbone.$(window).on('popstate', this.checkUrl);
1389 } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
1390 Backbone.$(window).on('hashchange', this.checkUrl);
1391 } else if (this._wantsHashChange) {
1392 this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
1393 }
1394
1395 // Determine if we need to change the base url, for a pushState link
1396 // opened by a non-pushState browser.
1397 this.fragment = fragment;
1398 var loc = this.location;
1399 var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
1400
1401 // If we've started off with a route from a `pushState`-enabled browser,
1402 // but we're currently in a browser that doesn't support it...
1403 if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
1404 this.fragment = this.getFragment(null, true);
1405 this.location.replace(this.root + this.location.search + '#' + this.fragment);
1406 // Return immediately as browser will do redirect to new url
1407 return true;
1408
1409 // Or if we've started out with a hash-based route, but we're currently
1410 // in a browser where it could be `pushState`-based instead...
1411 } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
1412 this.fragment = this.getHash().replace(routeStripper, '');
1413 this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
1414 }
1415
1416 if (!this.options.silent) return this.loadUrl();
1417 },
1418
1419 // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
1420 // but possibly useful for unit testing Routers.
1421 stop: function() {
1422 Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
1423 clearInterval(this._checkUrlInterval);
1424 History.started = false;
1425 },
1426
1427 // Add a route to be tested when the fragment changes. Routes added later
1428 // may override previous routes.
1429 route: function(route, callback) {
1430 this.handlers.unshift({route: route, callback: callback});
1431 },
1432
1433 // Checks the current URL to see if it has changed, and if it has,
1434 // calls `loadUrl`, normalizing across the hidden iframe.
1435 checkUrl: function(e) {
1436 var current = this.getFragment();
1437 if (current === this.fragment && this.iframe) {
1438 current = this.getFragment(this.getHash(this.iframe));
1439 }
1440 if (current === this.fragment) return false;
1441 if (this.iframe) this.navigate(current);
1442 this.loadUrl() || this.loadUrl(this.getHash());
1443 },
1444
1445 // Attempt to load the current URL fragment. If a route succeeds with a
1446 // match, returns `true`. If no defined routes matches the fragment,
1447 // returns `false`.
1448 loadUrl: function(fragmentOverride) {
1449 var fragment = this.fragment = this.getFragment(fragmentOverride);
1450 var matched = _.any(this.handlers, function(handler) {
1451 if (handler.route.test(fragment)) {
1452 handler.callback(fragment);
1453 return true;
1454 }
1455 });
1456 return matched;
1457 },
1458
1459 // Save a fragment into the hash history, or replace the URL state if the
1460 // 'replace' option is passed. You are responsible for properly URL-encoding
1461 // the fragment in advance.
1462 //
1463 // The options object can contain `trigger: true` if you wish to have the
1464 // route callback be fired (not usually desirable), or `replace: true`, if
1465 // you wish to modify the current URL without adding an entry to the history.
1466 navigate: function(fragment, options) {
1467 if (!History.started) return false;
1468 if (!options || options === true) options = {trigger: options};
1469 fragment = this.getFragment(fragment || '');
1470 if (this.fragment === fragment) return;
1471 this.fragment = fragment;
1472 var url = this.root + fragment;
1473
1474 // If pushState is available, we use it to set the fragment as a real URL.
1475 if (this._hasPushState) {
1476 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
1477
1478 // If hash changes haven't been explicitly disabled, update the hash
1479 // fragment to store history.
1480 } else if (this._wantsHashChange) {
1481 this._updateHash(this.location, fragment, options.replace);
1482 if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
1483 // Opening and closing the iframe tricks IE7 and earlier to push a
1484 // history entry on hash-tag change. When replace is true, we don't
1485 // want this.
1486 if(!options.replace) this.iframe.document.open().close();
1487 this._updateHash(this.iframe.location, fragment, options.replace);
1488 }
1489
1490 // If you've told us that you explicitly don't want fallback hashchange-
1491 // based history, then `navigate` becomes a page refresh.
1492 } else {
1493 return this.location.assign(url);
1494 }
1495 if (options.trigger) this.loadUrl(fragment);
1496 },
1497
1498 // Update the hash location, either replacing the current entry, or adding
1499 // a new one to the browser history.
1500 _updateHash: function(location, fragment, replace) {
1501 if (replace) {
1502 var href = location.href.replace(/(javascript:|#).*$/, '');
1503 location.replace(href + '#' + fragment);
1504 } else {
1505 // Some browsers require that `hash` contains a leading #.
1506 location.hash = '#' + fragment;
1507 }
1508 }
1509
1510 });
1511
1512 // Create the default Backbone.history.
1513 Backbone.history = new History;
1514
1515 // Helpers
1516 // -------
1517
1518 // Helper function to correctly set up the prototype chain, for subclasses.
1519 // Similar to `goog.inherits`, but uses a hash of prototype properties and
1520 // class properties to be extended.
1521 var extend = function(protoProps, staticProps) {
1522 var parent = this;
1523 var child;
1524
1525 // The constructor function for the new subclass is either defined by you
1526 // (the "constructor" property in your `extend` definition), or defaulted
1527 // by us to simply call the parent's constructor.
1528 if (protoProps && _.has(protoProps, 'constructor')) {
1529 child = protoProps.constructor;
1530 } else {
1531 child = function(){ return parent.apply(this, arguments); };
1532 }
1533
1534 // Add static properties to the constructor function, if supplied.
1535 _.extend(child, parent, staticProps);
1536
1537 // Set the prototype chain to inherit from `parent`, without calling
1538 // `parent`'s constructor function.
1539 var Surrogate = function(){ this.constructor = child; };
1540 Surrogate.prototype = parent.prototype;
1541 child.prototype = new Surrogate;
1542
1543 // Add prototype properties (instance properties) to the subclass,
1544 // if supplied.
1545 if (protoProps) _.extend(child.prototype, protoProps);
1546
1547 // Set a convenience property in case the parent's prototype is needed
1548 // later.
1549 child.__super__ = parent.prototype;
1550
1551 return child;
1552 };
1553
1554 // Set up inheritance for the model, collection, router, view and history.
1555 Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
1556
1557 // Throw an error when a URL is needed, and none is supplied.
1558 var urlError = function() {
1559 throw new Error('A "url" property or function must be specified');
1560 };
1561
1562 // Wrap an optional error callback with a fallback error event.
1563 var wrapError = function (model, options) {
1564 var error = options.error;
1565 options.error = function(resp) {
1566 if (error) error(model, resp, options);
1567 model.trigger('error', model, resp, options);
1568 };
1569 };
1570
1571}).call(this);
  
1// Backbone.js 0.9.2
2
3// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
4// Backbone may be freely distributed under the MIT license.
5// For all details and documentation:
6// http://backbonejs.org
7
8(function(){
9
10 // Initial Setup
11 // -------------
12
13 // Save a reference to the global object (`window` in the browser, `global`
14 // on the server).
15 var root = this;
16
17 // Save the previous value of the `Backbone` variable, so that it can be
18 // restored later on, if `noConflict` is used.
19 var previousBackbone = root.Backbone;
20
21 // Create a local reference to slice/splice.
22 var slice = Array.prototype.slice;
23 var splice = Array.prototype.splice;
24
25 // The top-level namespace. All public Backbone classes and modules will
26 // be attached to this. Exported for both CommonJS and the browser.
27 var Backbone;
28 if (typeof exports !== 'undefined') {
29 Backbone = exports;
30 } else {
31 Backbone = root.Backbone = {};
32 }
33
34 // Current version of the library. Keep in sync with `package.json`.
35 Backbone.VERSION = '0.9.2';
36
37 // Require Underscore, if we're on the server, and it's not already present.
38 var _ = root._;
39 if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
40
41 // For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
42 var $ = root.jQuery || root.Zepto || root.ender;
43
44 // Set the JavaScript library that will be used for DOM manipulation and
45 // Ajax calls (a.k.a. the `$` variable). By default Backbone will use: jQuery,
46 // Zepto, or Ender; but the `setDomLibrary()` method lets you inject an
47 // alternate JavaScript library (or a mock library for testing your views
48 // outside of a browser).
49 Backbone.setDomLibrary = function(lib) {
50 $ = lib;
51 };
52
53 // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
54 // to its previous owner. Returns a reference to this Backbone object.
55 Backbone.noConflict = function() {
56 root.Backbone = previousBackbone;
57 return this;
58 };
59
60 // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
61 // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
62 // set a `X-Http-Method-Override` header.
63 Backbone.emulateHTTP = false;
64
65 // Turn on `emulateJSON` to support legacy servers that can't deal with direct
66 // `application/json` requests ... will encode the body as
67 // `application/x-www-form-urlencoded` instead and will send the model in a
68 // form param named `model`.
69 Backbone.emulateJSON = false;
70
71 // Backbone.Events
72 // -----------------
73
74 // Regular expression used to split event strings
75 var eventSplitter = /\s+/;
76
77 // A module that can be mixed in to *any object* in order to provide it with
78 // custom events. You may bind with `on` or remove with `off` callback functions
79 // to an event; trigger`-ing an event fires all callbacks in succession.
80 //
81 // var object = {};
82 // _.extend(object, Backbone.Events);
83 // object.on('expand', function(){ alert('expanded'); });
84 // object.trigger('expand');
85 //
86 var Events = Backbone.Events = {
87
88 // Bind one or more space separated events, `events`, to a `callback`
89 // function. Passing `"all"` will bind the callback to all events fired.
90 on: function(events, callback, context) {
91
92 var calls, event, node, tail, list;
93 if (!callback) return this;
94 events = events.split(eventSplitter);
95 calls = this._callbacks || (this._callbacks = {});
96
97 // Create an immutable callback list, allowing traversal during
98 // modification. The tail is an empty object that will always be used
99 // as the next node.
100 while (event = events.shift()) {
101 list = calls[event];
102 node = list ? list.tail : {};
103 node.next = tail = {};
104 node.context = context;
105 node.callback = callback;
106 calls[event] = {tail: tail, next: list ? list.next : node};
107 }
108
109 return this;
110 },
111
112 // Remove one or many callbacks. If `context` is null, removes all callbacks
113 // with that function. If `callback` is null, removes all callbacks for the
114 // event. If `events` is null, removes all bound callbacks for all events.
115 off: function(events, callback, context) {
116 var event, calls, node, tail, cb, ctx;
117
118 // No events, or removing *all* events.
119 if (!(calls = this._callbacks)) return;
120 if (!(events || callback || context)) {
121 delete this._callbacks;
122 return this;
123 }
124
125 // Loop through the listed events and contexts, splicing them out of the
126 // linked list of callbacks if appropriate.
127 events = events ? events.split(eventSplitter) : _.keys(calls);
128 while (event = events.shift()) {
129 node = calls[event];
130 delete calls[event];
131 if (!node || !(callback || context)) continue;
132 // Create a new list, omitting the indicated callbacks.
133 tail = node.tail;
134 while ((node = node.next) !== tail) {
135 cb = node.callback;
136 ctx = node.context;
137 if ((callback && cb !== callback) || (context && ctx !== context)) {
138 this.on(event, cb, ctx);
139 }
140 }
141 }
142
143 return this;
144 },
145
146 // Trigger one or many events, firing all bound callbacks. Callbacks are
147 // passed the same arguments as `trigger` is, apart from the event name
148 // (unless you're listening on `"all"`, which will cause your callback to
149 // receive the true name of the event as the first argument).
150 trigger: function(events) {
151 var event, node, calls, tail, args, all, rest;
152 if (!(calls = this._callbacks)) return this;
153 all = calls.all;
154 events = events.split(eventSplitter);
155 rest = slice.call(arguments, 1);
156
157 // For each event, walk through the linked list of callbacks twice,
158 // first to trigger the event, then to trigger any `"all"` callbacks.
159 while (event = events.shift()) {
160 if (node = calls[event]) {
161 tail = node.tail;
162 while ((node = node.next) !== tail) {
163 node.callback.apply(node.context || this, rest);
164 }
165 }
166 if (node = all) {
167 tail = node.tail;
168 args = [event].concat(rest);
169 while ((node = node.next) !== tail) {
170 node.callback.apply(node.context || this, args);
171 }
172 }
173 }
174
175 return this;
176 }
177
178 };
179
180 // Aliases for backwards compatibility.
181 Events.bind = Events.on;
182 Events.unbind = Events.off;
183
184 // Backbone.Model
185 // --------------
186
187 // Create a new model, with defined attributes. A client id (`cid`)
188 // is automatically generated and assigned for you.
189 var Model = Backbone.Model = function(attributes, options) {
190 var defaults;
191 attributes || (attributes = {});
192 if (options && options.parse) attributes = this.parse(attributes);
193 if (defaults = getValue(this, 'defaults')) {
194 attributes = _.extend({}, defaults, attributes);
195 }
196 if (options && options.collection) this.collection = options.collection;
197 this.attributes = {};
198 this._escapedAttributes = {};
199 this.cid = _.uniqueId('c');
200 this.changed = {};
201 this._silent = {};
202 this._pending = {};
203 this.set(attributes, {silent: true});
204 // Reset change tracking.
205 this.changed = {};
206 this._silent = {};
207 this._pending = {};
208 this._previousAttributes = _.clone(this.attributes);
209 this.initialize.apply(this, arguments);
210 };
211
212 // Attach all inheritable methods to the Model prototype.
213 _.extend(Model.prototype, Events, {
214
215 // A hash of attributes whose current and previous value differ.
216 changed: null,
217
218 // A hash of attributes that have silently changed since the last time
219 // `change` was called. Will become pending attributes on the next call.
220 _silent: null,
221
222 // A hash of attributes that have changed since the last `'change'` event
223 // began.
224 _pending: null,
225
226 // The default name for the JSON `id` attribute is `"id"`. MongoDB and
227 // CouchDB users may want to set this to `"_id"`.
228 idAttribute: 'id',
229
230 // Initialize is an empty function by default. Override it with your own
231 // initialization logic.
232 initialize: function(){},
233
234 // Return a copy of the model's `attributes` object.
235 toJSON: function(options) {
236 return _.clone(this.attributes);
237 },
238
239 // Get the value of an attribute.
240 get: function(attr) {
241 return this.attributes[attr];
242 },
243
244 // Get the HTML-escaped value of an attribute.
245 escape: function(attr) {
246 var html;
247 if (html = this._escapedAttributes[attr]) return html;
248 var val = this.get(attr);
249 return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
250 },
251
252 // Returns `true` if the attribute contains a value that is not null
253 // or undefined.
254 has: function(attr) {
255 return this.get(attr) != null;
256 },
257
258 // Set a hash of model attributes on the object, firing `"change"` unless
259 // you choose to silence it.
260 set: function(key, value, options) {
261 var attrs, attr, val;
262
263 // Handle both `"key", value` and `{key: value}` -style arguments.
264 if (_.isObject(key) || key == null) {
265 attrs = key;
266 options = value;
267 } else {
268 attrs = {};
269 attrs[key] = value;
270 }
271
272 // Extract attributes and options.
273 options || (options = {});
274 if (!attrs) return this;
275 if (attrs instanceof Model) attrs = attrs.attributes;
276 if (options.unset) for (attr in attrs) attrs[attr] = void 0;
277
278 // Run validation.
279 if (!this._validate(attrs, options)) return false;
280
281 // Check for changes of `id`.
282 if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
283
284 var changes = options.changes = {};
285 var now = this.attributes;
286 var escaped = this._escapedAttributes;
287 var prev = this._previousAttributes || {};
288
289 // For each `set` attribute...
290 for (attr in attrs) {
291 val = attrs[attr];
292
293 // If the new and current value differ, record the change.
294 if (!_.isEqual(now[attr], val) || (options.unset && _.has(now, attr))) {
295 delete escaped[attr];
296 (options.silent ? this._silent : changes)[attr] = true;
297 }
298
299 // Update or delete the current value.
300 options.unset ? delete now[attr] : now[attr] = val;
301
302 // If the new and previous value differ, record the change. If not,
303 // then remove changes for this attribute.
304 if (!_.isEqual(prev[attr], val) || (_.has(now, attr) != _.has(prev, attr))) {
305 this.changed[attr] = val;
306 if (!options.silent) this._pending[attr] = true;
307 } else {
308 delete this.changed[attr];
309 delete this._pending[attr];
310 }
311 }
312
313 // Fire the `"change"` events.
314 if (!options.silent) this.change(options);
315 return this;
316 },
317
318 // Remove an attribute from the model, firing `"change"` unless you choose
319 // to silence it. `unset` is a noop if the attribute doesn't exist.
320 unset: function(attr, options) {
321 (options || (options = {})).unset = true;
322 return this.set(attr, null, options);
323 },
324
325 // Clear all attributes on the model, firing `"change"` unless you choose
326 // to silence it.
327 clear: function(options) {
328 (options || (options = {})).unset = true;
329 return this.set(_.clone(this.attributes), options);
330 },
331
332 // Fetch the model from the server. If the server's representation of the
333 // model differs from its current attributes, they will be overriden,
334 // triggering a `"change"` event.
335 fetch: function(options) {
336 options = options ? _.clone(options) : {};
337 var model = this;
338 var success = options.success;
339 options.success = function(resp, status, xhr) {
340 if (!model.set(model.parse(resp, xhr), options)) return false;
341 if (success) success(model, resp);
342 };
343 options.error = Backbone.wrapError(options.error, model, options);
344 return (this.sync || Backbone.sync).call(this, 'read', this, options);
345 },
346
347 // Set a hash of model attributes, and sync the model to the server.
348 // If the server returns an attributes hash that differs, the model's
349 // state will be `set` again.
350 save: function(key, value, options) {
351 var attrs, current;
352
353 // Handle both `("key", value)` and `({key: value})` -style calls.
354 if (_.isObject(key) || key == null) {
355 attrs = key;
356 options = value;
357 } else {
358 attrs = {};
359 attrs[key] = value;
360 }
361 options = options ? _.clone(options) : {};
362
363 // If we're "wait"-ing to set changed attributes, validate early.
364 if (options.wait) {
365 if (!this._validate(attrs, options)) return false;
366 current = _.clone(this.attributes);
367 }
368
369 // Regular saves `set` attributes before persisting to the server.
370 var silentOptions = _.extend({}, options, {silent: true});
371 if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
372 return false;
373 }
374
375 // After a successful server-side save, the client is (optionally)
376 // updated with the server-side state.
377 var model = this;
378 var success = options.success;
379 options.success = function(resp, status, xhr) {
380 var serverAttrs = model.parse(resp, xhr);
381 if (options.wait) {
382 delete options.wait;
383 serverAttrs = _.extend(attrs || {}, serverAttrs);
384 }
385 if (!model.set(serverAttrs, options)) return false;
386 if (success) {
387 success(model, resp);
388 } else {
389 model.trigger('sync', model, resp, options);
390 }
391 };
392
393 // Finish configuring and sending the Ajax request.
394 options.error = Backbone.wrapError(options.error, model, options);
395 var method = this.isNew() ? 'create' : 'update';
396 var xhr = (this.sync || Backbone.sync).call(this, method, this, options);
397 if (options.wait) this.set(current, silentOptions);
398 return xhr;
399 },
400
401 // Destroy this model on the server if it was already persisted.
402 // Optimistically removes the model from its collection, if it has one.
403 // If `wait: true` is passed, waits for the server to respond before removal.
404 destroy: function(options) {
405 options = options ? _.clone(options) : {};
406 var model = this;
407 var success = options.success;
408
409 var triggerDestroy = function() {
410 model.trigger('destroy', model, model.collection, options);
411 };
412
413 if (this.isNew()) {
414 triggerDestroy();
415 return false;
416 }
417
418 options.success = function(resp) {
419 if (options.wait) triggerDestroy();
420 if (success) {
421 success(model, resp);
422 } else {
423 model.trigger('sync', model, resp, options);
424 }
425 };
426
427 options.error = Backbone.wrapError(options.error, model, options);
428 var xhr = (this.sync || Backbone.sync).call(this, 'delete', this, options);
429 if (!options.wait) triggerDestroy();
430 return xhr;
431 },
432
433 // Default URL for the model's representation on the server -- if you're
434 // using Backbone's restful methods, override this to change the endpoint
435 // that will be called.
436 url: function() {
437 var base = getValue(this, 'urlRoot') || getValue(this.collection, 'url') || urlError();
438 if (this.isNew()) return base;
439 return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
440 },
441
442 // **parse** converts a response into the hash of attributes to be `set` on
443 // the model. The default implementation is just to pass the response along.
444 parse: function(resp, xhr) {
445 return resp;
446 },
447
448 // Create a new model with identical attributes to this one.
449 clone: function() {
450 return new this.constructor(this.attributes);
451 },
452
453 // A model is new if it has never been saved to the server, and lacks an id.
454 isNew: function() {
455 return this.id == null;
456 },
457
458 // Call this method to manually fire a `"change"` event for this model and
459 // a `"change:attribute"` event for each changed attribute.
460 // Calling this will cause all objects observing the model to update.
461 change: function(options) {
462 options || (options = {});
463 var changing = this._changing;
464 this._changing = true;
465
466 // Silent changes become pending changes.
467 for (var attr in this._silent) this._pending[attr] = true;
468
469 // Silent changes are triggered.
470 var changes = _.extend({}, options.changes, this._silent);
471 this._silent = {};
472 for (var attr in changes) {
473 this.trigger('change:' + attr, this, this.get(attr), options);
474 }
475 if (changing) return this;
476
477 // Continue firing `"change"` events while there are pending changes.
478 while (!_.isEmpty(this._pending)) {
479 this._pending = {};
480 this.trigger('change', this, options);
481 // Pending and silent changes still remain.
482 for (var attr in this.changed) {
483 if (this._pending[attr] || this._silent[attr]) continue;
484 delete this.changed[attr];
485 }
486 this._previousAttributes = _.clone(this.attributes);
487 }
488
489 this._changing = false;
490 return this;
491 },
492
493 // Determine if the model has changed since the last `"change"` event.
494 // If you specify an attribute name, determine if that attribute has changed.
495 hasChanged: function(attr) {
496 if (!arguments.length) return !_.isEmpty(this.changed);
497 return _.has(this.changed, attr);
498 },
499
500 // Return an object containing all the attributes that have changed, or
501 // false if there are no changed attributes. Useful for determining what
502 // parts of a view need to be updated and/or what attributes need to be
503 // persisted to the server. Unset attributes will be set to undefined.
504 // You can also pass an attributes object to diff against the model,
505 // determining if there *would be* a change.
506 changedAttributes: function(diff) {
507 if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
508 var val, changed = false, old = this._previousAttributes;
509 for (var attr in diff) {
510 if (_.isEqual(old[attr], (val = diff[attr]))) continue;
511 (changed || (changed = {}))[attr] = val;
512 }
513 return changed;
514 },
515
516 // Get the previous value of an attribute, recorded at the time the last
517 // `"change"` event was fired.
518 previous: function(attr) {
519 if (!arguments.length || !this._previousAttributes) return null;
520 return this._previousAttributes[attr];
521 },
522
523 // Get all of the attributes of the model at the time of the previous
524 // `"change"` event.
525 previousAttributes: function() {
526 return _.clone(this._previousAttributes);
527 },
528
529 // Check if the model is currently in a valid state. It's only possible to
530 // get into an *invalid* state if you're using silent changes.
531 isValid: function() {
532 return !this.validate(this.attributes);
533 },
534
535 // Run validation against the next complete set of model attributes,
536 // returning `true` if all is well. If a specific `error` callback has
537 // been passed, call that instead of firing the general `"error"` event.
538 _validate: function(attrs, options) {
539 if (options.silent || !this.validate) return true;
540 attrs = _.extend({}, this.attributes, attrs);
541 var error = this.validate(attrs, options);
542 if (!error) return true;
543 if (options && options.error) {
544 options.error(this, error, options);
545 } else {
546 this.trigger('error', this, error, options);
547 }
548 return false;
549 }
550
551 });
552
553 // Backbone.Collection
554 // -------------------
555
556 // Provides a standard collection class for our sets of models, ordered
557 // or unordered. If a `comparator` is specified, the Collection will maintain
558 // its models in sort order, as they're added and removed.
559 var Collection = Backbone.Collection = function(models, options) {
560 options || (options = {});
561 if (options.model) this.model = options.model;
562 if (options.comparator) this.comparator = options.comparator;
563 this._reset();
564 this.initialize.apply(this, arguments);
565 if (models) this.reset(models, {silent: true, parse: options.parse});
566 };
567
568 // Define the Collection's inheritable methods.
569 _.extend(Collection.prototype, Events, {
570
571 // The default model for a collection is just a **Backbone.Model**.
572 // This should be overridden in most cases.
573 model: Model,
574
575 // Initialize is an empty function by default. Override it with your own
576 // initialization logic.
577 initialize: function(){},
578
579 // The JSON representation of a Collection is an array of the
580 // models' attributes.
581 toJSON: function(options) {
582 return this.map(function(model){ return model.toJSON(options); });
583 },
584
585 // Add a model, or list of models to the set. Pass **silent** to avoid
586 // firing the `add` event for every new model.
587 add: function(models, options) {
588 var i, index, length, model, cid, id, cids = {}, ids = {}, dups = [];
589 options || (options = {});
590 models = _.isArray(models) ? models.slice() : [models];
591
592 // Begin by turning bare objects into model references, and preventing
593 // invalid models or duplicate models from being added.
594 for (i = 0, length = models.length; i < length; i++) {
595 if (!(model = models[i] = this._prepareModel(models[i], options))) {
596 throw new Error("Can't add an invalid model to a collection");
597 }
598 cid = model.cid;
599 id = model.id;
600 if (cids[cid] || this._byCid[cid] || ((id != null) && (ids[id] || this._byId[id]))) {
601 dups.push(i);
602 continue;
603 }
604 cids[cid] = ids[id] = model;
605 }
606
607 // Remove duplicates.
608 i = dups.length;
609 while (i--) {
610 models.splice(dups[i], 1);
611 }
612
613 // Listen to added models' events, and index models for lookup by
614 // `id` and by `cid`.
615 for (i = 0, length = models.length; i < length; i++) {
616 (model = models[i]).on('all', this._onModelEvent, this);
617 this._byCid[model.cid] = model;
618 if (model.id != null) this._byId[model.id] = model;
619 }
620
621 // Insert models into the collection, re-sorting if needed, and triggering
622 // `add` events unless silenced.
623 this.length += length;
624 index = options.at != null ? options.at : this.models.length;
625 splice.apply(this.models, [index, 0].concat(models));
626 if (this.comparator) this.sort({silent: true});
627 if (options.silent) return this;
628 for (i = 0, length = this.models.length; i < length; i++) {
629 if (!cids[(model = this.models[i]).cid]) continue;
630 options.index = i;
631 model.trigger('add', model, this, options);
632 }
633 return this;
634 },
635
636 // Remove a model, or a list of models from the set. Pass silent to avoid
637 // firing the `remove` event for every model removed.
638 remove: function(models, options) {
639 var i, l, index, model;
640 options || (options = {});
641 models = _.isArray(models) ? models.slice() : [models];
642 for (i = 0, l = models.length; i < l; i++) {
643 model = this.getByCid(models[i]) || this.get(models[i]);
644 if (!model) continue;
645 delete this._byId[model.id];
646 delete this._byCid[model.cid];
647 index = this.indexOf(model);
648 this.models.splice(index, 1);
649 this.length--;
650 if (!options.silent) {
651 options.index = index;
652 model.trigger('remove', model, this, options);
653 }
654 this._removeReference(model);
655 }
656 return this;
657 },
658
659 // Add a model to the end of the collection.
660 push: function(model, options) {
661 model = this._prepareModel(model, options);
662 this.add(model, options);
663 return model;
664 },
665
666 // Remove a model from the end of the collection.
667 pop: function(options) {
668 var model = this.at(this.length - 1);
669 this.remove(model, options);
670 return model;
671 },
672
673 // Add a model to the beginning of the collection.
674 unshift: function(model, options) {
675 model = this._prepareModel(model, options);
676 this.add(model, _.extend({at: 0}, options));
677 return model;
678 },
679
680 // Remove a model from the beginning of the collection.
681 shift: function(options) {
682 var model = this.at(0);
683 this.remove(model, options);
684 return model;
685 },
686
687 // Get a model from the set by id.
688 get: function(id) {
689 if (id == null) return void 0;
690 return this._byId[id.id != null ? id.id : id];
691 },
692
693 // Get a model from the set by client id.
694 getByCid: function(cid) {
695 return cid && this._byCid[cid.cid || cid];
696 },
697
698 // Get the model at the given index.
699 at: function(index) {
700 return this.models[index];
701 },
702
703 // Return models with matching attributes. Useful for simple cases of `filter`.
704 where: function(attrs) {
705 if (_.isEmpty(attrs)) return [];
706 return this.filter(function(model) {
707 for (var key in attrs) {
708 if (attrs[key] !== model.get(key)) return false;
709 }
710 return true;
711 });
712 },
713
714 // Force the collection to re-sort itself. You don't need to call this under
715 // normal circumstances, as the set will maintain sort order as each item
716 // is added.
717 sort: function(options) {
718 options || (options = {});
719 if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
720 var boundComparator = _.bind(this.comparator, this);
721 if (this.comparator.length == 1) {
722 this.models = this.sortBy(boundComparator);
723 } else {
724 this.models.sort(boundComparator);
725 }
726 if (!options.silent) this.trigger('reset', this, options);
727 return this;
728 },
729
730 // Pluck an attribute from each model in the collection.
731 pluck: function(attr) {
732 return _.map(this.models, function(model){ return model.get(attr); });
733 },
734
735 // When you have more items than you want to add or remove individually,
736 // you can reset the entire set with a new list of models, without firing
737 // any `add` or `remove` events. Fires `reset` when finished.
738 reset: function(models, options) {
739 models || (models = []);
740 options || (options = {});
741 for (var i = 0, l = this.models.length; i < l; i++) {
742 this._removeReference(this.models[i]);
743 }
744 this._reset();
745 this.add(models, _.extend({silent: true}, options));
746 if (!options.silent) this.trigger('reset', this, options);
747 return this;
748 },
749
750 // Fetch the default set of models for this collection, resetting the
751 // collection when they arrive. If `add: true` is passed, appends the
752 // models to the collection instead of resetting.
753 fetch: function(options) {
754 options = options ? _.clone(options) : {};
755 if (options.parse === undefined) options.parse = true;
756 var collection = this;
757 var success = options.success;
758 options.success = function(resp, status, xhr) {
759 collection[options.add ? 'add' : 'reset'](collection.parse(resp, xhr), options);
760 if (success) success(collection, resp);
761 };
762 options.error = Backbone.wrapError(options.error, collection, options);
763 return (this.sync || Backbone.sync).call(this, 'read', this, options);
764 },
765
766 // Create a new instance of a model in this collection. Add the model to the
767 // collection immediately, unless `wait: true` is passed, in which case we
768 // wait for the server to agree.
769 create: function(model, options) {
770 var coll = this;
771 options = options ? _.clone(options) : {};
772 model = this._prepareModel(model, options);
773 if (!model) return false;
774 if (!options.wait) coll.add(model, options);
775 var success = options.success;
776 options.success = function(nextModel, resp, xhr) {
777 if (options.wait) coll.add(nextModel, options);
778 if (success) {
779 success(nextModel, resp);
780 } else {
781 nextModel.trigger('sync', model, resp, options);
782 }
783 };
784 model.save(null, options);
785 return model;
786 },
787
788 // **parse** converts a response into a list of models to be added to the
789 // collection. The default implementation is just to pass it through.
790 parse: function(resp, xhr) {
791 return resp;
792 },
793
794 // Proxy to _'s chain. Can't be proxied the same way the rest of the
795 // underscore methods are proxied because it relies on the underscore
796 // constructor.
797 chain: function () {
798 return _(this.models).chain();
799 },
800
801 // Reset all internal state. Called when the collection is reset.
802 _reset: function(options) {
803 this.length = 0;
804 this.models = [];
805 this._byId = {};
806 this._byCid = {};
807 },
808
809 // Prepare a model or hash of attributes to be added to this collection.
810 _prepareModel: function(model, options) {
811 options || (options = {});
812 if (!(model instanceof Model)) {
813 var attrs = model;
814 options.collection = this;
815 model = new this.model(attrs, options);
816 if (!model._validate(model.attributes, options)) model = false;
817 } else if (!model.collection) {
818 model.collection = this;
819 }
820 return model;
821 },
822
823 // Internal method to remove a model's ties to a collection.
824 _removeReference: function(model) {
825 if (this == model.collection) {
826 delete model.collection;
827 }
828 model.off('all', this._onModelEvent, this);
829 },
830
831 // Internal method called every time a model in the set fires an event.
832 // Sets need to update their indexes when models change ids. All other
833 // events simply proxy through. "add" and "remove" events that originate
834 // in other collections are ignored.
835 _onModelEvent: function(event, model, collection, options) {
836 if ((event == 'add' || event == 'remove') && collection != this) return;
837 if (event == 'destroy') {
838 this.remove(model, options);
839 }
840 if (model && event === 'change:' + model.idAttribute) {
841 delete this._byId[model.previous(model.idAttribute)];
842 this._byId[model.id] = model;
843 }
844 this.trigger.apply(this, arguments);
845 }
846
847 });
848
849 // Underscore methods that we want to implement on the Collection.
850 var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find',
851 'detect', 'filter', 'select', 'reject', 'every', 'all', 'some', 'any',
852 'include', 'contains', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex',
853 'toArray', 'size', 'first', 'initial', 'rest', 'last', 'without', 'indexOf',
854 'shuffle', 'lastIndexOf', 'isEmpty', 'groupBy'];
855
856 // Mix in each Underscore method as a proxy to `Collection#models`.
857 _.each(methods, function(method) {
858 Collection.prototype[method] = function() {
859 return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
860 };
861 });
862
863 // Backbone.Router
864 // -------------------
865
866 // Routers map faux-URLs to actions, and fire events when routes are
867 // matched. Creating a new one sets its `routes` hash, if not set statically.
868 var Router = Backbone.Router = function(options) {
869 options || (options = {});
870 if (options.routes) this.routes = options.routes;
871 this._bindRoutes();
872 this.initialize.apply(this, arguments);
873 };
874
875 // Cached regular expressions for matching named param parts and splatted
876 // parts of route strings.
877 var namedParam = /:\w+/g;
878 var splatParam = /\*\w+/g;
879 var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
880
881 // Set up all inheritable **Backbone.Router** properties and methods.
882 _.extend(Router.prototype, Events, {
883
884 // Initialize is an empty function by default. Override it with your own
885 // initialization logic.
886 initialize: function(){},
887
888 // Manually bind a single named route to a callback. For example:
889 //
890 // this.route('search/:query/p:num', 'search', function(query, num) {
891 // ...
892 // });
893 //
894 route: function(route, name, callback) {
895 Backbone.history || (Backbone.history = new History);
896 if (!_.isRegExp(route)) route = this._routeToRegExp(route);
897 if (!callback) callback = this[name];
898 Backbone.history.route(route, _.bind(function(fragment) {
899 var args = this._extractParameters(route, fragment);
900 callback && callback.apply(this, args);
901 this.trigger.apply(this, ['route:' + name].concat(args));
902 Backbone.history.trigger('route', this, name, args);
903 }, this));
904 return this;
905 },
906
907 // Simple proxy to `Backbone.history` to save a fragment into the history.
908 navigate: function(fragment, options) {
909 Backbone.history.navigate(fragment, options);
910 },
911
912 // Bind all defined routes to `Backbone.history`. We have to reverse the
913 // order of the routes here to support behavior where the most general
914 // routes can be defined at the bottom of the route map.
915 _bindRoutes: function() {
916 if (!this.routes) return;
917 var routes = [];
918 for (var route in this.routes) {
919 routes.unshift([route, this.routes[route]]);
920 }
921 for (var i = 0, l = routes.length; i < l; i++) {
922 this.route(routes[i][0], routes[i][1], this[routes[i][1]]);
923 }
924 },
925
926 // Convert a route string into a regular expression, suitable for matching
927 // against the current location hash.
928 _routeToRegExp: function(route) {
929 route = route.replace(escapeRegExp, '\\$&')
930 .replace(namedParam, '([^\/]+)')
931 .replace(splatParam, '(.*?)');
932 return new RegExp('^' + route + '$');
933 },
934
935 // Given a route, and a URL fragment that it matches, return the array of
936 // extracted parameters.
937 _extractParameters: function(route, fragment) {
938 return route.exec(fragment).slice(1);
939 }
940
941 });
942
943 // Backbone.History
944 // ----------------
945
946 // Handles cross-browser history management, based on URL fragments. If the
947 // browser does not support `onhashchange`, falls back to polling.
948 var History = Backbone.History = function() {
949 this.handlers = [];
950 _.bindAll(this, 'checkUrl');
951 };
952
953 // Cached regex for cleaning leading hashes and slashes .
954 var routeStripper = /^[#\/]/;
955
956 // Cached regex for detecting MSIE.
957 var isExplorer = /msie [\w.]+/;
958
959 // Has the history handling already been started?
960 History.started = false;
961
962 // Set up all inheritable **Backbone.History** properties and methods.
963 _.extend(History.prototype, Events, {
964
965 // The default interval to poll for hash changes, if necessary, is
966 // twenty times a second.
967 interval: 50,
968
969 // Gets the true hash value. Cannot use location.hash directly due to bug
970 // in Firefox where location.hash will always be decoded.
971 getHash: function(windowOverride) {
972 var loc = windowOverride ? windowOverride.location : window.location;
973 var match = loc.href.match(/#(.*)$/);
974 return match ? match[1] : '';
975 },
976
977 // Get the cross-browser normalized URL fragment, either from the URL,
978 // the hash, or the override.
979 getFragment: function(fragment, forcePushState) {
980 if (fragment == null) {
981 if (this._hasPushState || forcePushState) {
982 fragment = window.location.pathname;
983 var search = window.location.search;
984 if (search) fragment += search;
985 } else {
986 fragment = this.getHash();
987 }
988 }
989 if (!fragment.indexOf(this.options.root)) fragment = fragment.substr(this.options.root.length);
990 return fragment.replace(routeStripper, '');
991 },
992
993 // Start the hash change handling, returning `true` if the current URL matches
994 // an existing route, and `false` otherwise.
995 start: function(options) {
996 if (History.started) throw new Error("Backbone.history has already been started");
997 History.started = true;
998
999 // Figure out the initial configuration. Do we need an iframe?
1000 // Is pushState desired ... is it available?
1001 this.options = _.extend({}, {root: '/'}, this.options, options);
1002 this._wantsHashChange = this.options.hashChange !== false;
1003 this._wantsPushState = !!this.options.pushState;
1004 this._hasPushState = !!(this.options.pushState && window.history && window.history.pushState);
1005 var fragment = this.getFragment();
1006 var docMode = document.documentMode;
1007 var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
1008
1009 if (oldIE) {
1010 this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
1011 this.navigate(fragment);
1012 }
1013
1014 // Depending on whether we're using pushState or hashes, and whether
1015 // 'onhashchange' is supported, determine how we check the URL state.
1016 if (this._hasPushState) {
1017 $(window).bind('popstate', this.checkUrl);
1018 } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
1019 $(window).bind('hashchange', this.checkUrl);
1020 } else if (this._wantsHashChange) {
1021 this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
1022 }
1023
1024 // Determine if we need to change the base url, for a pushState link
1025 // opened by a non-pushState browser.
1026 this.fragment = fragment;
1027 var loc = window.location;
1028 var atRoot = loc.pathname == this.options.root;
1029
1030 // If we've started off with a route from a `pushState`-enabled browser,
1031 // but we're currently in a browser that doesn't support it...
1032 if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
1033 this.fragment = this.getFragment(null, true);
1034 window.location.replace(this.options.root + '#' + this.fragment);
1035 // Return immediately as browser will do redirect to new url
1036 return true;
1037
1038 // Or if we've started out with a hash-based route, but we're currently
1039 // in a browser where it could be `pushState`-based instead...
1040 } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
1041 this.fragment = this.getHash().replace(routeStripper, '');
1042 window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
1043 }
1044
1045 if (!this.options.silent) {
1046 return this.loadUrl();
1047 }
1048 },
1049
1050 // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
1051 // but possibly useful for unit testing Routers.
1052 stop: function() {
1053 $(window).unbind('popstate', this.checkUrl).unbind('hashchange', this.checkUrl);
1054 clearInterval(this._checkUrlInterval);
1055 History.started = false;
1056 },
1057
1058 // Add a route to be tested when the fragment changes. Routes added later
1059 // may override previous routes.
1060 route: function(route, callback) {
1061 this.handlers.unshift({route: route, callback: callback});
1062 },
1063
1064 // Checks the current URL to see if it has changed, and if it has,
1065 // calls `loadUrl`, normalizing across the hidden iframe.
1066 checkUrl: function(e) {
1067 var current = this.getFragment();
1068 if (current == this.fragment && this.iframe) current = this.getFragment(this.getHash(this.iframe));
1069 if (current == this.fragment) return false;
1070 if (this.iframe) this.navigate(current);
1071 this.loadUrl() || this.loadUrl(this.getHash());
1072 },
1073
1074 // Attempt to load the current URL fragment. If a route succeeds with a
1075 // match, returns `true`. If no defined routes matches the fragment,
1076 // returns `false`.
1077 loadUrl: function(fragmentOverride) {
1078 var fragment = this.fragment = this.getFragment(fragmentOverride);
1079 var matched = _.any(this.handlers, function(handler) {
1080 if (handler.route.test(fragment)) {
1081 handler.callback(fragment);
1082 return true;
1083 }
1084 });
1085 return matched;
1086 },
1087
1088 // Save a fragment into the hash history, or replace the URL state if the
1089 // 'replace' option is passed. You are responsible for properly URL-encoding
1090 // the fragment in advance.
1091 //
1092 // The options object can contain `trigger: true` if you wish to have the
1093 // route callback be fired (not usually desirable), or `replace: true`, if
1094 // you wish to modify the current URL without adding an entry to the history.
1095 navigate: function(fragment, options) {
1096 if (!History.started) return false;
1097 if (!options || options === true) options = {trigger: options};
1098 var frag = (fragment || '').replace(routeStripper, '');
1099 if (this.fragment == frag) return;
1100
1101 // If pushState is available, we use it to set the fragment as a real URL.
1102 if (this._hasPushState) {
1103 if (frag.indexOf(this.options.root) != 0) frag = this.options.root + frag;
1104 this.fragment = frag;
1105 window.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, frag);
1106
1107 // If hash changes haven't been explicitly disabled, update the hash
1108 // fragment to store history.
1109 } else if (this._wantsHashChange) {
1110 this.fragment = frag;
1111 this._updateHash(window.location, frag, options.replace);
1112 if (this.iframe && (frag != this.getFragment(this.getHash(this.iframe)))) {
1113 // Opening and closing the iframe tricks IE7 and earlier to push a history entry on hash-tag change.
1114 // When replace is true, we don't want this.
1115 if(!options.replace) this.iframe.document.open().close();
1116 this._updateHash(this.iframe.location, frag, options.replace);
1117 }
1118
1119 // If you've told us that you explicitly don't want fallback hashchange-
1120 // based history, then `navigate` becomes a page refresh.
1121 } else {
1122 window.location.assign(this.options.root + fragment);
1123 }
1124 if (options.trigger) this.loadUrl(fragment);
1125 },
1126
1127 // Update the hash location, either replacing the current entry, or adding
1128 // a new one to the browser history.
1129 _updateHash: function(location, fragment, replace) {
1130 if (replace) {
1131 location.replace(location.toString().replace(/(javascript:|#).*$/, '') + '#' + fragment);
1132 } else {
1133 location.hash = fragment;
1134 }
1135 }
1136 });
1137
1138 // Backbone.View
1139 // -------------
1140
1141 // Creating a Backbone.View creates its initial element outside of the DOM,
1142 // if an existing element is not provided...
1143 var View = Backbone.View = function(options) {
1144 this.cid = _.uniqueId('view');
1145 this._configure(options || {});
1146 this._ensureElement();
1147 this.initialize.apply(this, arguments);
1148 this.delegateEvents();
1149 };
1150
1151 // Cached regex to split keys for `delegate`.
1152 var delegateEventSplitter = /^(\S+)\s*(.*)$/;
1153
1154 // List of view options to be merged as properties.
1155 var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];
1156
1157 // Set up all inheritable **Backbone.View** properties and methods.
1158 _.extend(View.prototype, Events, {
1159
1160 // The default `tagName` of a View's element is `"div"`.
1161 tagName: 'div',
1162
1163 // jQuery delegate for element lookup, scoped to DOM elements within the
1164 // current view. This should be prefered to global lookups where possible.
1165 $: function(selector) {
1166 return this.$el.find(selector);
1167 },
1168
1169 // Initialize is an empty function by default. Override it with your own
1170 // initialization logic.
1171 initialize: function(){},
1172
1173 // **render** is the core function that your view should override, in order
1174 // to populate its element (`this.el`), with the appropriate HTML. The
1175 // convention is for **render** to always return `this`.
1176 render: function() {
1177 return this;
1178 },
1179
1180 // Remove this view from the DOM. Note that the view isn't present in the
1181 // DOM by default, so calling this method may be a no-op.
1182 remove: function() {
1183 this.$el.remove();
1184 return this;
1185 },
1186
1187 // For small amounts of DOM Elements, where a full-blown template isn't
1188 // needed, use **make** to manufacture elements, one at a time.
1189 //
1190 // var el = this.make('li', {'class': 'row'}, this.model.escape('title'));
1191 //
1192 make: function(tagName, attributes, content) {
1193 var el = document.createElement(tagName);
1194 if (attributes) $(el).attr(attributes);
1195 if (content) $(el).html(content);
1196 return el;
1197 },
1198
1199 // Change the view's element (`this.el` property), including event
1200 // re-delegation.
1201 setElement: function(element, delegate) {
1202 if (this.$el) this.undelegateEvents();
1203 this.$el = (element instanceof $) ? element : $(element);
1204 this.el = this.$el[0];
1205 if (delegate !== false) this.delegateEvents();
1206 return this;
1207 },
1208
1209 // Set callbacks, where `this.events` is a hash of
1210 //
1211 // *{"event selector": "callback"}*
1212 //
1213 // {
1214 // 'mousedown .title': 'edit',
1215 // 'click .button': 'save'
1216 // 'click .open': function(e) { ... }
1217 // }
1218 //
1219 // pairs. Callbacks will be bound to the view, with `this` set properly.
1220 // Uses event delegation for efficiency.
1221 // Omitting the selector binds the event to `this.el`.
1222 // This only works for delegate-able events: not `focus`, `blur`, and
1223 // not `change`, `submit`, and `reset` in Internet Explorer.
1224 delegateEvents: function(events) {
1225 if (!(events || (events = getValue(this, 'events')))) return;
1226 this.undelegateEvents();
1227 for (var key in events) {
1228 var method = events[key];
1229 if (!_.isFunction(method)) method = this[events[key]];
1230 if (!method) throw new Error('Method "' + events[key] + '" does not exist');
1231 var match = key.match(delegateEventSplitter);
1232 var eventName = match[1], selector = match[2];
1233 method = _.bind(method, this);
1234 eventName += '.delegateEvents' + this.cid;
1235 if (selector === '') {
1236 this.$el.bind(eventName, method);
1237 } else {
1238 this.$el.delegate(selector, eventName, method);
1239 }
1240 }
1241 },
1242
1243 // Clears all callbacks previously bound to the view with `delegateEvents`.
1244 // You usually don't need to use this, but may wish to if you have multiple
1245 // Backbone views attached to the same DOM element.
1246 undelegateEvents: function() {
1247 this.$el.unbind('.delegateEvents' + this.cid);
1248 },
1249
1250 // Performs the initial configuration of a View with a set of options.
1251 // Keys with special meaning *(model, collection, id, className)*, are
1252 // attached directly to the view.
1253 _configure: function(options) {
1254 if (this.options) options = _.extend({}, this.options, options);
1255 for (var i = 0, l = viewOptions.length; i < l; i++) {
1256 var attr = viewOptions[i];
1257 if (options[attr]) this[attr] = options[attr];
1258 }
1259 this.options = options;
1260 },
1261
1262 // Ensure that the View has a DOM element to render into.
1263 // If `this.el` is a string, pass it through `$()`, take the first
1264 // matching element, and re-assign it to `el`. Otherwise, create
1265 // an element from the `id`, `className` and `tagName` properties.
1266 _ensureElement: function() {
1267 if (!this.el) {
1268 var attrs = getValue(this, 'attributes') || {};
1269 if (this.id) attrs.id = this.id;
1270 if (this.className) attrs['class'] = this.className;
1271 this.setElement(this.make(this.tagName, attrs), false);
1272 } else {
1273 this.setElement(this.el, false);
1274 }
1275 }
1276
1277 });
1278
1279 // The self-propagating extend function that Backbone classes use.
1280 var extend = function (protoProps, classProps) {
1281 var child = inherits(this, protoProps, classProps);
1282 child.extend = this.extend;
1283 return child;
1284 };
1285
1286 // Set up inheritance for the model, collection, and view.
1287 Model.extend = Collection.extend = Router.extend = View.extend = extend;
1288
1289 // Backbone.sync
1290 // -------------
1291
1292 // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
1293 var methodMap = {
1294 'create': 'POST',
1295 'update': 'PUT',
1296 'delete': 'DELETE',
1297 'read': 'GET'
1298 };
1299
1300 // Override this function to change the manner in which Backbone persists
1301 // models to the server. You will be passed the type of request, and the
1302 // model in question. By default, makes a RESTful Ajax request
1303 // to the model's `url()`. Some possible customizations could be:
1304 //
1305 // * Use `setTimeout` to batch rapid-fire updates into a single request.
1306 // * Send up the models as XML instead of JSON.
1307 // * Persist models via WebSockets instead of Ajax.
1308 //
1309 // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
1310 // as `POST`, with a `_method` parameter containing the true HTTP method,
1311 // as well as all requests with the body as `application/x-www-form-urlencoded`
1312 // instead of `application/json` with the model in a param named `model`.
1313 // Useful when interfacing with server-side languages like **PHP** that make
1314 // it difficult to read the body of `PUT` requests.
1315 Backbone.sync = function(method, model, options) {
1316 var type = methodMap[method];
1317
1318 // Default options, unless specified.
1319 options || (options = {});
1320
1321 // Default JSON-request options.
1322 var params = {type: type, dataType: 'json'};
1323
1324 // Ensure that we have a URL.
1325 if (!options.url) {
1326 params.url = getValue(model, 'url') || urlError();
1327 }
1328
1329 // Ensure that we have the appropriate request data.
1330 if (!options.data && model && (method == 'create' || method == 'update')) {
1331 params.contentType = 'application/json';
1332 params.data = JSON.stringify(model.toJSON());
1333 }
1334
1335 // For older servers, emulate JSON by encoding the request into an HTML-form.
1336 if (Backbone.emulateJSON) {
1337 params.contentType = 'application/x-www-form-urlencoded';
1338 params.data = params.data ? {model: params.data} : {};
1339 }
1340
1341 // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
1342 // And an `X-HTTP-Method-Override` header.
1343 if (Backbone.emulateHTTP) {
1344 if (type === 'PUT' || type === 'DELETE') {
1345 if (Backbone.emulateJSON) params.data._method = type;
1346 params.type = 'POST';
1347 params.beforeSend = function(xhr) {
1348 xhr.setRequestHeader('X-HTTP-Method-Override', type);
1349 };
1350 }
1351 }
1352
1353 // Don't process data on a non-GET request.
1354 if (params.type !== 'GET' && !Backbone.emulateJSON) {
1355 params.processData = false;
1356 }
1357
1358 // Make the request, allowing the user to override any Ajax options.
1359 return $.ajax(_.extend(params, options));
1360 };
1361
1362 // Wrap an optional error callback with a fallback error event.
1363 Backbone.wrapError = function(onError, originalModel, options) {
1364 return function(model, resp) {
1365 resp = model === originalModel ? resp : model;
1366 if (onError) {
1367 onError(originalModel, resp, options);
1368 } else {
1369 originalModel.trigger('error', originalModel, resp, options);
1370 }
1371 };
1372 };
1373
1374 // Helpers
1375 // -------
1376
1377 // Shared empty constructor function to aid in prototype-chain creation.
1378 var ctor = function(){};
1379
1380 // Helper function to correctly set up the prototype chain, for subclasses.
1381 // Similar to `goog.inherits`, but uses a hash of prototype properties and
1382 // class properties to be extended.
1383 var inherits = function(parent, protoProps, staticProps) {
1384 var child;
1385
1386 // The constructor function for the new subclass is either defined by you
1387 // (the "constructor" property in your `extend` definition), or defaulted
1388 // by us to simply call the parent's constructor.
1389 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1390 child = protoProps.constructor;
1391 } else {
1392 child = function(){ parent.apply(this, arguments); };
1393 }
1394
1395 // Inherit class (static) properties from parent.
1396 _.extend(child, parent);
1397
1398 // Set the prototype chain to inherit from `parent`, without calling
1399 // `parent`'s constructor function.
1400 ctor.prototype = parent.prototype;
1401 child.prototype = new ctor();
1402
1403 // Add prototype properties (instance properties) to the subclass,
1404 // if supplied.
1405 if (protoProps) _.extend(child.prototype, protoProps);
1406
1407 // Add static properties to the constructor function, if supplied.
1408 if (staticProps) _.extend(child, staticProps);
1409
1410 // Correctly set child's `prototype.constructor`.
1411 child.prototype.constructor = child;
1412
1413 // Set a convenience property in case the parent's prototype is needed later.
1414 child.__super__ = parent.prototype;
1415
1416 return child;
1417 };
1418
1419 // Helper function to get a value from a Backbone object as a property
1420 // or as a function.
1421 var getValue = function(object, prop) {
1422 if (!(object && object[prop])) return null;
1423 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
1424 };
1425
1426 // Throw an error when a URL is needed, and none is supplied.
1427 var urlError = function() {
1428 throw new Error('A "url" property or function must be specified');
1429 };
1430
1431}).call(this);
  
1/* ===================================================
2 * bootstrap-transition.js v2.2.1
3 * http://twitter.github.com/bootstrap/javascript.html#transitions
4 * ===================================================
5 * Copyright 2012 Twitter, Inc.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================================================== */
19
20
21!function ($) {
22
23 "use strict"; // jshint ;_;
24
25
26 /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27 * ======================================================= */
28
29 $(function () {
30
31 $.support.transition = (function () {
32
33 var transitionEnd = (function () {
34
35 var el = document.createElement('bootstrap')
36 , transEndEventNames = {
37 'WebkitTransition' : 'webkitTransitionEnd'
38 , 'MozTransition' : 'transitionend'
39 , 'OTransition' : 'oTransitionEnd otransitionend'
40 , 'transition' : 'transitionend'
41 }
42 , name
43
44 for (name in transEndEventNames){
45 if (el.style[name] !== undefined) {
46 return transEndEventNames[name]
47 }
48 }
49
50 }())
51
52 return transitionEnd && {
53 end: transitionEnd
54 }
55
56 })()
57
58 })
59
60}(window.jQuery);/* ==========================================================
61 * bootstrap-alert.js v2.2.1
62 * http://twitter.github.com/bootstrap/javascript.html#alerts
63 * ==========================================================
64 * Copyright 2012 Twitter, Inc.
65 *
66 * Licensed under the Apache License, Version 2.0 (the "License");
67 * you may not use this file except in compliance with the License.
68 * You may obtain a copy of the License at
69 *
70 * http://www.apache.org/licenses/LICENSE-2.0
71 *
72 * Unless required by applicable law or agreed to in writing, software
73 * distributed under the License is distributed on an "AS IS" BASIS,
74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 * See the License for the specific language governing permissions and
76 * limitations under the License.
77 * ========================================================== */
78
79
80!function ($) {
81
82 "use strict"; // jshint ;_;
83
84
85 /* ALERT CLASS DEFINITION
86 * ====================== */
87
88 var dismiss = '[data-dismiss="alert"]'
89 , Alert = function (el) {
90 $(el).on('click', dismiss, this.close)
91 }
92
93 Alert.prototype.close = function (e) {
94 var $this = $(this)
95 , selector = $this.attr('data-target')
96 , $parent
97
98 if (!selector) {
99 selector = $this.attr('href')
100 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
101 }
102
103 $parent = $(selector)
104
105 e && e.preventDefault()
106
107 $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
108
109 $parent.trigger(e = $.Event('close'))
110
111 if (e.isDefaultPrevented()) return
112
113 $parent.removeClass('in')
114
115 function removeElement() {
116 $parent
117 .trigger('closed')
118 .remove()
119 }
120
121 $.support.transition && $parent.hasClass('fade') ?
122 $parent.on($.support.transition.end, removeElement) :
123 removeElement()
124 }
125
126
127 /* ALERT PLUGIN DEFINITION
128 * ======================= */
129
130 $.fn.alert = function (option) {
131 return this.each(function () {
132 var $this = $(this)
133 , data = $this.data('alert')
134 if (!data) $this.data('alert', (data = new Alert(this)))
135 if (typeof option == 'string') data[option].call($this)
136 })
137 }
138
139 $.fn.alert.Constructor = Alert
140
141
142 /* ALERT DATA-API
143 * ============== */
144
145 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
146
147}(window.jQuery);/* ============================================================
148 * bootstrap-button.js v2.2.1
149 * http://twitter.github.com/bootstrap/javascript.html#buttons
150 * ============================================================
151 * Copyright 2012 Twitter, Inc.
152 *
153 * Licensed under the Apache License, Version 2.0 (the "License");
154 * you may not use this file except in compliance with the License.
155 * You may obtain a copy of the License at
156 *
157 * http://www.apache.org/licenses/LICENSE-2.0
158 *
159 * Unless required by applicable law or agreed to in writing, software
160 * distributed under the License is distributed on an "AS IS" BASIS,
161 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
162 * See the License for the specific language governing permissions and
163 * limitations under the License.
164 * ============================================================ */
165
166
167!function ($) {
168
169 "use strict"; // jshint ;_;
170
171
172 /* BUTTON PUBLIC CLASS DEFINITION
173 * ============================== */
174
175 var Button = function (element, options) {
176 this.$element = $(element)
177 this.options = $.extend({}, $.fn.button.defaults, options)
178 }
179
180 Button.prototype.setState = function (state) {
181 var d = 'disabled'
182 , $el = this.$element
183 , data = $el.data()
184 , val = $el.is('input') ? 'val' : 'html'
185
186 state = state + 'Text'
187 data.resetText || $el.data('resetText', $el[val]())
188
189 $el[val](data[state] || this.options[state])
190
191 // push to event loop to allow forms to submit
192 setTimeout(function () {
193 state == 'loadingText' ?
194 $el.addClass(d).attr(d, d) :
195 $el.removeClass(d).removeAttr(d)
196 }, 0)
197 }
198
199 Button.prototype.toggle = function () {
200 var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
201
202 $parent && $parent
203 .find('.active')
204 .removeClass('active')
205
206 this.$element.toggleClass('active')
207 }
208
209
210 /* BUTTON PLUGIN DEFINITION
211 * ======================== */
212
213 $.fn.button = function (option) {
214 return this.each(function () {
215 var $this = $(this)
216 , data = $this.data('button')
217 , options = typeof option == 'object' && option
218 if (!data) $this.data('button', (data = new Button(this, options)))
219 if (option == 'toggle') data.toggle()
220 else if (option) data.setState(option)
221 })
222 }
223
224 $.fn.button.defaults = {
225 loadingText: 'loading...'
226 }
227
228 $.fn.button.Constructor = Button
229
230
231 /* BUTTON DATA-API
232 * =============== */
233
234 $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
235 var $btn = $(e.target)
236 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
237 $btn.button('toggle')
238 })
239
240}(window.jQuery);/* ==========================================================
241 * bootstrap-carousel.js v2.2.1
242 * http://twitter.github.com/bootstrap/javascript.html#carousel
243 * ==========================================================
244 * Copyright 2012 Twitter, Inc.
245 *
246 * Licensed under the Apache License, Version 2.0 (the "License");
247 * you may not use this file except in compliance with the License.
248 * You may obtain a copy of the License at
249 *
250 * http://www.apache.org/licenses/LICENSE-2.0
251 *
252 * Unless required by applicable law or agreed to in writing, software
253 * distributed under the License is distributed on an "AS IS" BASIS,
254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255 * See the License for the specific language governing permissions and
256 * limitations under the License.
257 * ========================================================== */
258
259
260!function ($) {
261
262 "use strict"; // jshint ;_;
263
264
265 /* CAROUSEL CLASS DEFINITION
266 * ========================= */
267
268 var Carousel = function (element, options) {
269 this.$element = $(element)
270 this.options = options
271 this.options.slide && this.slide(this.options.slide)
272 this.options.pause == 'hover' && this.$element
273 .on('mouseenter', $.proxy(this.pause, this))
274 .on('mouseleave', $.proxy(this.cycle, this))
275 }
276
277 Carousel.prototype = {
278
279 cycle: function (e) {
280 if (!e) this.paused = false
281 this.options.interval
282 && !this.paused
283 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
284 return this
285 }
286
287 , to: function (pos) {
288 var $active = this.$element.find('.item.active')
289 , children = $active.parent().children()
290 , activePos = children.index($active)
291 , that = this
292
293 if (pos > (children.length - 1) || pos < 0) return
294
295 if (this.sliding) {
296 return this.$element.one('slid', function () {
297 that.to(pos)
298 })
299 }
300
301 if (activePos == pos) {
302 return this.pause().cycle()
303 }
304
305 return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
306 }
307
308 , pause: function (e) {
309 if (!e) this.paused = true
310 if (this.$element.find('.next, .prev').length && $.support.transition.end) {
311 this.$element.trigger($.support.transition.end)
312 this.cycle()
313 }
314 clearInterval(this.interval)
315 this.interval = null
316 return this
317 }
318
319 , next: function () {
320 if (this.sliding) return
321 return this.slide('next')
322 }
323
324 , prev: function () {
325 if (this.sliding) return
326 return this.slide('prev')
327 }
328
329 , slide: function (type, next) {
330 var $active = this.$element.find('.item.active')
331 , $next = next || $active[type]()
332 , isCycling = this.interval
333 , direction = type == 'next' ? 'left' : 'right'
334 , fallback = type == 'next' ? 'first' : 'last'
335 , that = this
336 , e
337
338 this.sliding = true
339
340 isCycling && this.pause()
341
342 $next = $next.length ? $next : this.$element.find('.item')[fallback]()
343
344 e = $.Event('slide', {
345 relatedTarget: $next[0]
346 })
347
348 if ($next.hasClass('active')) return
349
350 if ($.support.transition && this.$element.hasClass('slide')) {
351 this.$element.trigger(e)
352 if (e.isDefaultPrevented()) return
353 $next.addClass(type)
354 $next[0].offsetWidth // force reflow
355 $active.addClass(direction)
356 $next.addClass(direction)
357 this.$element.one($.support.transition.end, function () {
358 $next.removeClass([type, direction].join(' ')).addClass('active')
359 $active.removeClass(['active', direction].join(' '))
360 that.sliding = false
361 setTimeout(function () { that.$element.trigger('slid') }, 0)
362 })
363 } else {
364 this.$element.trigger(e)
365 if (e.isDefaultPrevented()) return
366 $active.removeClass('active')
367 $next.addClass('active')
368 this.sliding = false
369 this.$element.trigger('slid')
370 }
371
372 isCycling && this.cycle()
373
374 return this
375 }
376
377 }
378
379
380 /* CAROUSEL PLUGIN DEFINITION
381 * ========================== */
382
383 $.fn.carousel = function (option) {
384 return this.each(function () {
385 var $this = $(this)
386 , data = $this.data('carousel')
387 , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
388 , action = typeof option == 'string' ? option : options.slide
389 if (!data) $this.data('carousel', (data = new Carousel(this, options)))
390 if (typeof option == 'number') data.to(option)
391 else if (action) data[action]()
392 else if (options.interval) data.cycle()
393 })
394 }
395
396 $.fn.carousel.defaults = {
397 interval: 5000
398 , pause: 'hover'
399 }
400
401 $.fn.carousel.Constructor = Carousel
402
403
404 /* CAROUSEL DATA-API
405 * ================= */
406
407 $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
408 var $this = $(this), href
409 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
410 , options = $.extend({}, $target.data(), $this.data())
411 $target.carousel(options)
412 e.preventDefault()
413 })
414
415}(window.jQuery);/* =============================================================
416 * bootstrap-collapse.js v2.2.1
417 * http://twitter.github.com/bootstrap/javascript.html#collapse
418 * =============================================================
419 * Copyright 2012 Twitter, Inc.
420 *
421 * Licensed under the Apache License, Version 2.0 (the "License");
422 * you may not use this file except in compliance with the License.
423 * You may obtain a copy of the License at
424 *
425 * http://www.apache.org/licenses/LICENSE-2.0
426 *
427 * Unless required by applicable law or agreed to in writing, software
428 * distributed under the License is distributed on an "AS IS" BASIS,
429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430 * See the License for the specific language governing permissions and
431 * limitations under the License.
432 * ============================================================ */
433
434
435!function ($) {
436
437 "use strict"; // jshint ;_;
438
439
440 /* COLLAPSE PUBLIC CLASS DEFINITION
441 * ================================ */
442
443 var Collapse = function (element, options) {
444 this.$element = $(element)
445 this.options = $.extend({}, $.fn.collapse.defaults, options)
446
447 if (this.options.parent) {
448 this.$parent = $(this.options.parent)
449 }
450
451 this.options.toggle && this.toggle()
452 }
453
454 Collapse.prototype = {
455
456 constructor: Collapse
457
458 , dimension: function () {
459 var hasWidth = this.$element.hasClass('width')
460 return hasWidth ? 'width' : 'height'
461 }
462
463 , show: function () {
464 var dimension
465 , scroll
466 , actives
467 , hasData
468
469 if (this.transitioning) return
470
471 dimension = this.dimension()
472 scroll = $.camelCase(['scroll', dimension].join('-'))
473 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
474
475 if (actives && actives.length) {
476 hasData = actives.data('collapse')
477 if (hasData && hasData.transitioning) return
478 actives.collapse('hide')
479 hasData || actives.data('collapse', null)
480 }
481
482 this.$element[dimension](0)
483 this.transition('addClass', $.Event('show'), 'shown')
484 $.support.transition && this.$element[dimension](this.$element[0][scroll])
485 }
486
487 , hide: function () {
488 var dimension
489 if (this.transitioning) return
490 dimension = this.dimension()
491 this.reset(this.$element[dimension]())
492 this.transition('removeClass', $.Event('hide'), 'hidden')
493 this.$element[dimension](0)
494 }
495
496 , reset: function (size) {
497 var dimension = this.dimension()
498
499 this.$element
500 .removeClass('collapse')
501 [dimension](size || 'auto')
502 [0].offsetWidth
503
504 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
505
506 return this
507 }
508
509 , transition: function (method, startEvent, completeEvent) {
510 var that = this
511 , complete = function () {
512 if (startEvent.type == 'show') that.reset()
513 that.transitioning = 0
514 that.$element.trigger(completeEvent)
515 }
516
517 this.$element.trigger(startEvent)
518
519 if (startEvent.isDefaultPrevented()) return
520
521 this.transitioning = 1
522
523 this.$element[method]('in')
524
525 $.support.transition && this.$element.hasClass('collapse') ?
526 this.$element.one($.support.transition.end, complete) :
527 complete()
528 }
529
530 , toggle: function () {
531 this[this.$element.hasClass('in') ? 'hide' : 'show']()
532 }
533
534 }
535
536
537 /* COLLAPSIBLE PLUGIN DEFINITION
538 * ============================== */
539
540 $.fn.collapse = function (option) {
541 return this.each(function () {
542 var $this = $(this)
543 , data = $this.data('collapse')
544 , options = typeof option == 'object' && option
545 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
546 if (typeof option == 'string') data[option]()
547 })
548 }
549
550 $.fn.collapse.defaults = {
551 toggle: true
552 }
553
554 $.fn.collapse.Constructor = Collapse
555
556
557 /* COLLAPSIBLE DATA-API
558 * ==================== */
559
560 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
561 var $this = $(this), href
562 , target = $this.attr('data-target')
563 || e.preventDefault()
564 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
565 , option = $(target).data('collapse') ? 'toggle' : $this.data()
566 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
567 $(target).collapse(option)
568 })
569
570}(window.jQuery);/* ============================================================
571 * bootstrap-dropdown.js v2.2.1
572 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
573 * ============================================================
574 * Copyright 2012 Twitter, Inc.
575 *
576 * Licensed under the Apache License, Version 2.0 (the "License");
577 * you may not use this file except in compliance with the License.
578 * You may obtain a copy of the License at
579 *
580 * http://www.apache.org/licenses/LICENSE-2.0
581 *
582 * Unless required by applicable law or agreed to in writing, software
583 * distributed under the License is distributed on an "AS IS" BASIS,
584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
585 * See the License for the specific language governing permissions and
586 * limitations under the License.
587 * ============================================================ */
588
589
590!function ($) {
591
592 "use strict"; // jshint ;_;
593
594
595 /* DROPDOWN CLASS DEFINITION
596 * ========================= */
597
598 var toggle = '[data-toggle=dropdown]'
599 , Dropdown = function (element) {
600 var $el = $(element).on('click.dropdown.data-api', this.toggle)
601 $('html').on('click.dropdown.data-api', function () {
602 $el.parent().removeClass('open')
603 })
604 }
605
606 Dropdown.prototype = {
607
608 constructor: Dropdown
609
610 , toggle: function (e) {
611 var $this = $(this)
612 , $parent
613 , isActive
614
615 if ($this.is('.disabled, :disabled')) return
616
617 $parent = getParent($this)
618
619 isActive = $parent.hasClass('open')
620
621 clearMenus()
622
623 if (!isActive) {
624 $parent.toggleClass('open')
625 $this.focus()
626 }
627
628 return false
629 }
630
631 , keydown: function (e) {
632 var $this
633 , $items
634 , $active
635 , $parent
636 , isActive
637 , index
638
639 if (!/(38|40|27)/.test(e.keyCode)) return
640
641 $this = $(this)
642
643 e.preventDefault()
644 e.stopPropagation()
645
646 if ($this.is('.disabled, :disabled')) return
647
648 $parent = getParent($this)
649
650 isActive = $parent.hasClass('open')
651
652 if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
653
654 $items = $('[role=menu] li:not(.divider) a', $parent)
655
656 if (!$items.length) return
657
658 index = $items.index($items.filter(':focus'))
659
660 if (e.keyCode == 38 && index > 0) index-- // up
661 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
662 if (!~index) index = 0
663
664 $items
665 .eq(index)
666 .focus()
667 }
668
669 }
670
671 function clearMenus() {
672 $(toggle).each(function () {
673 getParent($(this)).removeClass('open')
674 })
675 }
676
677 function getParent($this) {
678 var selector = $this.attr('data-target')
679 , $parent
680
681 if (!selector) {
682 selector = $this.attr('href')
683 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
684 }
685
686 $parent = $(selector)
687 $parent.length || ($parent = $this.parent())
688
689 return $parent
690 }
691
692
693 /* DROPDOWN PLUGIN DEFINITION
694 * ========================== */
695
696 $.fn.dropdown = function (option) {
697 return this.each(function () {
698 var $this = $(this)
699 , data = $this.data('dropdown')
700 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
701 if (typeof option == 'string') data[option].call($this)
702 })
703 }
704
705 $.fn.dropdown.Constructor = Dropdown
706
707
708 /* APPLY TO STANDARD DROPDOWN ELEMENTS
709 * =================================== */
710
711 $(document)
712 .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
713 .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
714 .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
715 .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
716
717}(window.jQuery);/* =========================================================
718 * bootstrap-modal.js v2.2.1
719 * http://twitter.github.com/bootstrap/javascript.html#modals
720 * =========================================================
721 * Copyright 2012 Twitter, Inc.
722 *
723 * Licensed under the Apache License, Version 2.0 (the "License");
724 * you may not use this file except in compliance with the License.
725 * You may obtain a copy of the License at
726 *
727 * http://www.apache.org/licenses/LICENSE-2.0
728 *
729 * Unless required by applicable law or agreed to in writing, software
730 * distributed under the License is distributed on an "AS IS" BASIS,
731 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
732 * See the License for the specific language governing permissions and
733 * limitations under the License.
734 * ========================================================= */
735
736
737!function ($) {
738
739 "use strict"; // jshint ;_;
740
741
742 /* MODAL CLASS DEFINITION
743 * ====================== */
744
745 var Modal = function (element, options) {
746 this.options = options
747 this.$element = $(element)
748 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
749 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
750 }
751
752 Modal.prototype = {
753
754 constructor: Modal
755
756 , toggle: function () {
757 return this[!this.isShown ? 'show' : 'hide']()
758 }
759
760 , show: function () {
761 var that = this
762 , e = $.Event('show')
763
764 this.$element.trigger(e)
765
766 if (this.isShown || e.isDefaultPrevented()) return
767
768 this.isShown = true
769
770 this.escape()
771
772 this.backdrop(function () {
773 var transition = $.support.transition && that.$element.hasClass('fade')
774
775 if (!that.$element.parent().length) {
776 that.$element.appendTo(document.body) //don't move modals dom position
777 }
778
779 that.$element
780 .show()
781
782 if (transition) {
783 that.$element[0].offsetWidth // force reflow
784 }
785
786 that.$element
787 .addClass('in')
788 .attr('aria-hidden', false)
789
790 that.enforceFocus()
791
792 transition ?
793 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
794 that.$element.focus().trigger('shown')
795
796 })
797 }
798
799 , hide: function (e) {
800 e && e.preventDefault()
801
802 var that = this
803
804 e = $.Event('hide')
805
806 this.$element.trigger(e)
807
808 if (!this.isShown || e.isDefaultPrevented()) return
809
810 this.isShown = false
811
812 this.escape()
813
814 $(document).off('focusin.modal')
815
816 this.$element
817 .removeClass('in')
818 .attr('aria-hidden', true)
819
820 $.support.transition && this.$element.hasClass('fade') ?
821 this.hideWithTransition() :
822 this.hideModal()
823 }
824
825 , enforceFocus: function () {
826 var that = this
827 $(document).on('focusin.modal', function (e) {
828 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
829 that.$element.focus()
830 }
831 })
832 }
833
834 , escape: function () {
835 var that = this
836 if (this.isShown && this.options.keyboard) {
837 this.$element.on('keyup.dismiss.modal', function ( e ) {
838 e.which == 27 && that.hide()
839 })
840 } else if (!this.isShown) {
841 this.$element.off('keyup.dismiss.modal')
842 }
843 }
844
845 , hideWithTransition: function () {
846 var that = this
847 , timeout = setTimeout(function () {
848 that.$element.off($.support.transition.end)
849 that.hideModal()
850 }, 500)
851
852 this.$element.one($.support.transition.end, function () {
853 clearTimeout(timeout)
854 that.hideModal()
855 })
856 }
857
858 , hideModal: function (that) {
859 this.$element
860 .hide()
861 .trigger('hidden')
862
863 this.backdrop()
864 }
865
866 , removeBackdrop: function () {
867 this.$backdrop.remove()
868 this.$backdrop = null
869 }
870
871 , backdrop: function (callback) {
872 var that = this
873 , animate = this.$element.hasClass('fade') ? 'fade' : ''
874
875 if (this.isShown && this.options.backdrop) {
876 var doAnimate = $.support.transition && animate
877
878 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
879 .appendTo(document.body)
880
881 this.$backdrop.click(
882 this.options.backdrop == 'static' ?
883 $.proxy(this.$element[0].focus, this.$element[0])
884 : $.proxy(this.hide, this)
885 )
886
887 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
888
889 this.$backdrop.addClass('in')
890
891 doAnimate ?
892 this.$backdrop.one($.support.transition.end, callback) :
893 callback()
894
895 } else if (!this.isShown && this.$backdrop) {
896 this.$backdrop.removeClass('in')
897
898 $.support.transition && this.$element.hasClass('fade')?
899 this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
900 this.removeBackdrop()
901
902 } else if (callback) {
903 callback()
904 }
905 }
906 }
907
908
909 /* MODAL PLUGIN DEFINITION
910 * ======================= */
911
912 $.fn.modal = function (option) {
913 return this.each(function () {
914 var $this = $(this)
915 , data = $this.data('modal')
916 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
917 if (!data) $this.data('modal', (data = new Modal(this, options)))
918 if (typeof option == 'string') data[option]()
919 else if (options.show) data.show()
920 })
921 }
922
923 $.fn.modal.defaults = {
924 backdrop: true
925 , keyboard: true
926 , show: true
927 }
928
929 $.fn.modal.Constructor = Modal
930
931
932 /* MODAL DATA-API
933 * ============== */
934
935 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
936 var $this = $(this)
937 , href = $this.attr('href')
938 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
939 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
940
941 e.preventDefault()
942
943 $target
944 .modal(option)
945 .one('hide', function () {
946 $this.focus()
947 })
948 })
949
950}(window.jQuery);
951/* ===========================================================
952 * bootstrap-tooltip.js v2.2.1
953 * http://twitter.github.com/bootstrap/javascript.html#tooltips
954 * Inspired by the original jQuery.tipsy by Jason Frame
955 * ===========================================================
956 * Copyright 2012 Twitter, Inc.
957 *
958 * Licensed under the Apache License, Version 2.0 (the "License");
959 * you may not use this file except in compliance with the License.
960 * You may obtain a copy of the License at
961 *
962 * http://www.apache.org/licenses/LICENSE-2.0
963 *
964 * Unless required by applicable law or agreed to in writing, software
965 * distributed under the License is distributed on an "AS IS" BASIS,
966 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
967 * See the License for the specific language governing permissions and
968 * limitations under the License.
969 * ========================================================== */
970
971
972!function ($) {
973
974 "use strict"; // jshint ;_;
975
976
977 /* TOOLTIP PUBLIC CLASS DEFINITION
978 * =============================== */
979
980 var Tooltip = function (element, options) {
981 this.init('tooltip', element, options)
982 }
983
984 Tooltip.prototype = {
985
986 constructor: Tooltip
987
988 , init: function (type, element, options) {
989 var eventIn
990 , eventOut
991
992 this.type = type
993 this.$element = $(element)
994 this.options = this.getOptions(options)
995 this.enabled = true
996
997 if (this.options.trigger == 'click') {
998 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
999 } else if (this.options.trigger != 'manual') {
1000 eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
1001 eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
1002 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1003 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1004 }
1005
1006 this.options.selector ?
1007 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1008 this.fixTitle()
1009 }
1010
1011 , getOptions: function (options) {
1012 options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
1013
1014 if (options.delay && typeof options.delay == 'number') {
1015 options.delay = {
1016 show: options.delay
1017 , hide: options.delay
1018 }
1019 }
1020
1021 return options
1022 }
1023
1024 , enter: function (e) {
1025 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1026
1027 if (!self.options.delay || !self.options.delay.show) return self.show()
1028
1029 clearTimeout(this.timeout)
1030 self.hoverState = 'in'
1031 this.timeout = setTimeout(function() {
1032 if (self.hoverState == 'in') self.show()
1033 }, self.options.delay.show)
1034 }
1035
1036 , leave: function (e) {
1037 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1038
1039 if (this.timeout) clearTimeout(this.timeout)
1040 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1041
1042 self.hoverState = 'out'
1043 this.timeout = setTimeout(function() {
1044 if (self.hoverState == 'out') self.hide()
1045 }, self.options.delay.hide)
1046 }
1047
1048 , show: function () {
1049 var $tip
1050 , inside
1051 , pos
1052 , actualWidth
1053 , actualHeight
1054 , placement
1055 , tp
1056
1057 if (this.hasContent() && this.enabled) {
1058 $tip = this.tip()
1059 this.setContent()
1060
1061 if (this.options.animation) {
1062 $tip.addClass('fade')
1063 }
1064
1065 placement = typeof this.options.placement == 'function' ?
1066 this.options.placement.call(this, $tip[0], this.$element[0]) :
1067 this.options.placement
1068
1069 inside = /in/.test(placement)
1070
1071 $tip
1072 .detach()
1073 .css({ top: 0, left: 0, display: 'block' })
1074 .insertAfter(this.$element)
1075
1076 pos = this.getPosition(inside)
1077
1078 actualWidth = $tip[0].offsetWidth
1079 actualHeight = $tip[0].offsetHeight
1080
1081 switch (inside ? placement.split(' ')[1] : placement) {
1082 case 'bottom':
1083 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1084 break
1085 case 'top':
1086 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1087 break
1088 case 'left':
1089 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1090 break
1091 case 'right':
1092 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1093 break
1094 }
1095
1096 $tip
1097 .offset(tp)
1098 .addClass(placement)
1099 .addClass('in')
1100 }
1101 }
1102
1103 , setContent: function () {
1104 var $tip = this.tip()
1105 , title = this.getTitle()
1106
1107 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1108 $tip.removeClass('fade in top bottom left right')
1109 }
1110
1111 , hide: function () {
1112 var that = this
1113 , $tip = this.tip()
1114
1115 $tip.removeClass('in')
1116
1117 function removeWithAnimation() {
1118 var timeout = setTimeout(function () {
1119 $tip.off($.support.transition.end).detach()
1120 }, 500)
1121
1122 $tip.one($.support.transition.end, function () {
1123 clearTimeout(timeout)
1124 $tip.detach()
1125 })
1126 }
1127
1128 $.support.transition && this.$tip.hasClass('fade') ?
1129 removeWithAnimation() :
1130 $tip.detach()
1131
1132 return this
1133 }
1134
1135 , fixTitle: function () {
1136 var $e = this.$element
1137 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1138 $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1139 }
1140 }
1141
1142 , hasContent: function () {
1143 return this.getTitle()
1144 }
1145
1146 , getPosition: function (inside) {
1147 return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1148 width: this.$element[0].offsetWidth
1149 , height: this.$element[0].offsetHeight
1150 })
1151 }
1152
1153 , getTitle: function () {
1154 var title
1155 , $e = this.$element
1156 , o = this.options
1157
1158 title = $e.attr('data-original-title')
1159 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1160
1161 return title
1162 }
1163
1164 , tip: function () {
1165 return this.$tip = this.$tip || $(this.options.template)
1166 }
1167
1168 , validate: function () {
1169 if (!this.$element[0].parentNode) {
1170 this.hide()
1171 this.$element = null
1172 this.options = null
1173 }
1174 }
1175
1176 , enable: function () {
1177 this.enabled = true
1178 }
1179
1180 , disable: function () {
1181 this.enabled = false
1182 }
1183
1184 , toggleEnabled: function () {
1185 this.enabled = !this.enabled
1186 }
1187
1188 , toggle: function (e) {
1189 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1190 self[self.tip().hasClass('in') ? 'hide' : 'show']()
1191 }
1192
1193 , destroy: function () {
1194 this.hide().$element.off('.' + this.type).removeData(this.type)
1195 }
1196
1197 }
1198
1199
1200 /* TOOLTIP PLUGIN DEFINITION
1201 * ========================= */
1202
1203 $.fn.tooltip = function ( option ) {
1204 return this.each(function () {
1205 var $this = $(this)
1206 , data = $this.data('tooltip')
1207 , options = typeof option == 'object' && option
1208 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1209 if (typeof option == 'string') data[option]()
1210 })
1211 }
1212
1213 $.fn.tooltip.Constructor = Tooltip
1214
1215 $.fn.tooltip.defaults = {
1216 animation: true
1217 , placement: 'top'
1218 , selector: false
1219 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1220 , trigger: 'hover'
1221 , title: ''
1222 , delay: 0
1223 , html: false
1224 }
1225
1226}(window.jQuery);/* ===========================================================
1227 * bootstrap-popover.js v2.2.1
1228 * http://twitter.github.com/bootstrap/javascript.html#popovers
1229 * ===========================================================
1230 * Copyright 2012 Twitter, Inc.
1231 *
1232 * Licensed under the Apache License, Version 2.0 (the "License");
1233 * you may not use this file except in compliance with the License.
1234 * You may obtain a copy of the License at
1235 *
1236 * http://www.apache.org/licenses/LICENSE-2.0
1237 *
1238 * Unless required by applicable law or agreed to in writing, software
1239 * distributed under the License is distributed on an "AS IS" BASIS,
1240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1241 * See the License for the specific language governing permissions and
1242 * limitations under the License.
1243 * =========================================================== */
1244
1245
1246!function ($) {
1247
1248 "use strict"; // jshint ;_;
1249
1250
1251 /* POPOVER PUBLIC CLASS DEFINITION
1252 * =============================== */
1253
1254 var Popover = function (element, options) {
1255 this.init('popover', element, options)
1256 }
1257
1258
1259 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1260 ========================================== */
1261
1262 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1263
1264 constructor: Popover
1265
1266 , setContent: function () {
1267 var $tip = this.tip()
1268 , title = this.getTitle()
1269 , content = this.getContent()
1270
1271 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1272 $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
1273
1274 $tip.removeClass('fade top bottom left right in')
1275 }
1276
1277 , hasContent: function () {
1278 return this.getTitle() || this.getContent()
1279 }
1280
1281 , getContent: function () {
1282 var content
1283 , $e = this.$element
1284 , o = this.options
1285
1286 content = $e.attr('data-content')
1287 || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1288
1289 return content
1290 }
1291
1292 , tip: function () {
1293 if (!this.$tip) {
1294 this.$tip = $(this.options.template)
1295 }
1296 return this.$tip
1297 }
1298
1299 , destroy: function () {
1300 this.hide().$element.off('.' + this.type).removeData(this.type)
1301 }
1302
1303 })
1304
1305
1306 /* POPOVER PLUGIN DEFINITION
1307 * ======================= */
1308
1309 $.fn.popover = function (option) {
1310 return this.each(function () {
1311 var $this = $(this)
1312 , data = $this.data('popover')
1313 , options = typeof option == 'object' && option
1314 if (!data) $this.data('popover', (data = new Popover(this, options)))
1315 if (typeof option == 'string') data[option]()
1316 })
1317 }
1318
1319 $.fn.popover.Constructor = Popover
1320
1321 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1322 placement: 'right'
1323 , trigger: 'click'
1324 , content: ''
1325 , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
1326 })
1327
1328}(window.jQuery);/* =============================================================
1329 * bootstrap-scrollspy.js v2.2.1
1330 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1331 * =============================================================
1332 * Copyright 2012 Twitter, Inc.
1333 *
1334 * Licensed under the Apache License, Version 2.0 (the "License");
1335 * you may not use this file except in compliance with the License.
1336 * You may obtain a copy of the License at
1337 *
1338 * http://www.apache.org/licenses/LICENSE-2.0
1339 *
1340 * Unless required by applicable law or agreed to in writing, software
1341 * distributed under the License is distributed on an "AS IS" BASIS,
1342 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1343 * See the License for the specific language governing permissions and
1344 * limitations under the License.
1345 * ============================================================== */
1346
1347
1348!function ($) {
1349
1350 "use strict"; // jshint ;_;
1351
1352
1353 /* SCROLLSPY CLASS DEFINITION
1354 * ========================== */
1355
1356 function ScrollSpy(element, options) {
1357 var process = $.proxy(this.process, this)
1358 , $element = $(element).is('body') ? $(window) : $(element)
1359 , href
1360 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1361 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1362 this.selector = (this.options.target
1363 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1364 || '') + ' .nav li > a'
1365 this.$body = $('body')
1366 this.refresh()
1367 this.process()
1368 }
1369
1370 ScrollSpy.prototype = {
1371
1372 constructor: ScrollSpy
1373
1374 , refresh: function () {
1375 var self = this
1376 , $targets
1377
1378 this.offsets = $([])
1379 this.targets = $([])
1380
1381 $targets = this.$body
1382 .find(this.selector)
1383 .map(function () {
1384 var $el = $(this)
1385 , href = $el.data('target') || $el.attr('href')
1386 , $href = /^#\w/.test(href) && $(href)
1387 return ( $href
1388 && $href.length
1389 && [[ $href.position().top, href ]] ) || null
1390 })
1391 .sort(function (a, b) { return a[0] - b[0] })
1392 .each(function () {
1393 self.offsets.push(this[0])
1394 self.targets.push(this[1])
1395 })
1396 }
1397
1398 , process: function () {
1399 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1400 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1401 , maxScroll = scrollHeight - this.$scrollElement.height()
1402 , offsets = this.offsets
1403 , targets = this.targets
1404 , activeTarget = this.activeTarget
1405 , i
1406
1407 if (scrollTop >= maxScroll) {
1408 return activeTarget != (i = targets.last()[0])
1409 && this.activate ( i )
1410 }
1411
1412 for (i = offsets.length; i--;) {
1413 activeTarget != targets[i]
1414 && scrollTop >= offsets[i]
1415 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1416 && this.activate( targets[i] )
1417 }
1418 }
1419
1420 , activate: function (target) {
1421 var active
1422 , selector
1423
1424 this.activeTarget = target
1425
1426 $(this.selector)
1427 .parent('.active')
1428 .removeClass('active')
1429
1430 selector = this.selector
1431 + '[data-target="' + target + '"],'
1432 + this.selector + '[href="' + target + '"]'
1433
1434 active = $(selector)
1435 .parent('li')
1436 .addClass('active')
1437
1438 if (active.parent('.dropdown-menu').length) {
1439 active = active.closest('li.dropdown').addClass('active')
1440 }
1441
1442 active.trigger('activate')
1443 }
1444
1445 }
1446
1447
1448 /* SCROLLSPY PLUGIN DEFINITION
1449 * =========================== */
1450
1451 $.fn.scrollspy = function (option) {
1452 return this.each(function () {
1453 var $this = $(this)
1454 , data = $this.data('scrollspy')
1455 , options = typeof option == 'object' && option
1456 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1457 if (typeof option == 'string') data[option]()
1458 })
1459 }
1460
1461 $.fn.scrollspy.Constructor = ScrollSpy
1462
1463 $.fn.scrollspy.defaults = {
1464 offset: 10
1465 }
1466
1467
1468 /* SCROLLSPY DATA-API
1469 * ================== */
1470
1471 $(window).on('load', function () {
1472 $('[data-spy="scroll"]').each(function () {
1473 var $spy = $(this)
1474 $spy.scrollspy($spy.data())
1475 })
1476 })
1477
1478}(window.jQuery);/* ========================================================
1479 * bootstrap-tab.js v2.2.1
1480 * http://twitter.github.com/bootstrap/javascript.html#tabs
1481 * ========================================================
1482 * Copyright 2012 Twitter, Inc.
1483 *
1484 * Licensed under the Apache License, Version 2.0 (the "License");
1485 * you may not use this file except in compliance with the License.
1486 * You may obtain a copy of the License at
1487 *
1488 * http://www.apache.org/licenses/LICENSE-2.0
1489 *
1490 * Unless required by applicable law or agreed to in writing, software
1491 * distributed under the License is distributed on an "AS IS" BASIS,
1492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1493 * See the License for the specific language governing permissions and
1494 * limitations under the License.
1495 * ======================================================== */
1496
1497
1498!function ($) {
1499
1500 "use strict"; // jshint ;_;
1501
1502
1503 /* TAB CLASS DEFINITION
1504 * ==================== */
1505
1506 var Tab = function (element) {
1507 this.element = $(element)
1508 }
1509
1510 Tab.prototype = {
1511
1512 constructor: Tab
1513
1514 , show: function () {
1515 var $this = this.element
1516 , $ul = $this.closest('ul:not(.dropdown-menu)')
1517 , selector = $this.attr('data-target')
1518 , previous
1519 , $target
1520 , e
1521
1522 if (!selector) {
1523 selector = $this.attr('href')
1524 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1525 }
1526
1527 if ( $this.parent('li').hasClass('active') ) return
1528
1529 previous = $ul.find('.active:last a')[0]
1530
1531 e = $.Event('show', {
1532 relatedTarget: previous
1533 })
1534
1535 $this.trigger(e)
1536
1537 if (e.isDefaultPrevented()) return
1538
1539 $target = $(selector)
1540
1541 this.activate($this.parent('li'), $ul)
1542 this.activate($target, $target.parent(), function () {
1543 $this.trigger({
1544 type: 'shown'
1545 , relatedTarget: previous
1546 })
1547 })
1548 }
1549
1550 , activate: function ( element, container, callback) {
1551 var $active = container.find('> .active')
1552 , transition = callback
1553 && $.support.transition
1554 && $active.hasClass('fade')
1555
1556 function next() {
1557 $active
1558 .removeClass('active')
1559 .find('> .dropdown-menu > .active')
1560 .removeClass('active')
1561
1562 element.addClass('active')
1563
1564 if (transition) {
1565 element[0].offsetWidth // reflow for transition
1566 element.addClass('in')
1567 } else {
1568 element.removeClass('fade')
1569 }
1570
1571 if ( element.parent('.dropdown-menu') ) {
1572 element.closest('li.dropdown').addClass('active')
1573 }
1574
1575 callback && callback()
1576 }
1577
1578 transition ?
1579 $active.one($.support.transition.end, next) :
1580 next()
1581
1582 $active.removeClass('in')
1583 }
1584 }
1585
1586
1587 /* TAB PLUGIN DEFINITION
1588 * ===================== */
1589
1590 $.fn.tab = function ( option ) {
1591 return this.each(function () {
1592 var $this = $(this)
1593 , data = $this.data('tab')
1594 if (!data) $this.data('tab', (data = new Tab(this)))
1595 if (typeof option == 'string') data[option]()
1596 })
1597 }
1598
1599 $.fn.tab.Constructor = Tab
1600
1601
1602 /* TAB DATA-API
1603 * ============ */
1604
1605 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1606 e.preventDefault()
1607 $(this).tab('show')
1608 })
1609
1610}(window.jQuery);/* =============================================================
1611 * bootstrap-typeahead.js v2.2.1
1612 * http://twitter.github.com/bootstrap/javascript.html#typeahead
1613 * =============================================================
1614 * Copyright 2012 Twitter, Inc.
1615 *
1616 * Licensed under the Apache License, Version 2.0 (the "License");
1617 * you may not use this file except in compliance with the License.
1618 * You may obtain a copy of the License at
1619 *
1620 * http://www.apache.org/licenses/LICENSE-2.0
1621 *
1622 * Unless required by applicable law or agreed to in writing, software
1623 * distributed under the License is distributed on an "AS IS" BASIS,
1624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1625 * See the License for the specific language governing permissions and
1626 * limitations under the License.
1627 * ============================================================ */
1628
1629
1630!function($){
1631
1632 "use strict"; // jshint ;_;
1633
1634
1635 /* TYPEAHEAD PUBLIC CLASS DEFINITION
1636 * ================================= */
1637
1638 var Typeahead = function (element, options) {
1639 this.$element = $(element)
1640 this.options = $.extend({}, $.fn.typeahead.defaults, options)
1641 this.matcher = this.options.matcher || this.matcher
1642 this.sorter = this.options.sorter || this.sorter
1643 this.highlighter = this.options.highlighter || this.highlighter
1644 this.updater = this.options.updater || this.updater
1645 this.$menu = $(this.options.menu).appendTo('body')
1646 this.source = this.options.source
1647 this.shown = false
1648 this.listen()
1649 }
1650
1651 Typeahead.prototype = {
1652
1653 constructor: Typeahead
1654
1655 , select: function () {
1656 var val = this.$menu.find('.active').attr('data-value')
1657 this.$element
1658 .val(this.updater(val))
1659 .change()
1660 return this.hide()
1661 }
1662
1663 , updater: function (item) {
1664 return item
1665 }
1666
1667 , show: function () {
1668 var pos = $.extend({}, this.$element.offset(), {
1669 height: this.$element[0].offsetHeight
1670 })
1671
1672 this.$menu.css({
1673 top: pos.top + pos.height
1674 , left: pos.left
1675 })
1676
1677 this.$menu.show()
1678 this.shown = true
1679 return this
1680 }
1681
1682 , hide: function () {
1683 this.$menu.hide()
1684 this.shown = false
1685 return this
1686 }
1687
1688 , lookup: function (event) {
1689 var items
1690
1691 this.query = this.$element.val()
1692
1693 if (!this.query || this.query.length < this.options.minLength) {
1694 return this.shown ? this.hide() : this
1695 }
1696
1697 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1698
1699 return items ? this.process(items) : this
1700 }
1701
1702 , process: function (items) {
1703 var that = this
1704
1705 items = $.grep(items, function (item) {
1706 return that.matcher(item)
1707 })
1708
1709 items = this.sorter(items)
1710
1711 if (!items.length) {
1712 return this.shown ? this.hide() : this
1713 }
1714
1715 return this.render(items.slice(0, this.options.items)).show()
1716 }
1717
1718 , matcher: function (item) {
1719 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1720 }
1721
1722 , sorter: function (items) {
1723 var beginswith = []
1724 , caseSensitive = []
1725 , caseInsensitive = []
1726 , item
1727
1728 while (item = items.shift()) {
1729 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1730 else if (~item.indexOf(this.query)) caseSensitive.push(item)
1731 else caseInsensitive.push(item)
1732 }
1733
1734 return beginswith.concat(caseSensitive, caseInsensitive)
1735 }
1736
1737 , highlighter: function (item) {
1738 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1739 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1740 return '<strong>' + match + '</strong>'
1741 })
1742 }
1743
1744 , render: function (items) {
1745 var that = this
1746
1747 items = $(items).map(function (i, item) {
1748 i = $(that.options.item).attr('data-value', item)
1749 i.find('a').html(that.highlighter(item))
1750 return i[0]
1751 })
1752
1753 items.first().addClass('active')
1754 this.$menu.html(items)
1755 return this
1756 }
1757
1758 , next: function (event) {
1759 var active = this.$menu.find('.active').removeClass('active')
1760 , next = active.next()
1761
1762 if (!next.length) {
1763 next = $(this.$menu.find('li')[0])
1764 }
1765
1766 next.addClass('active')
1767 }
1768
1769 , prev: function (event) {
1770 var active = this.$menu.find('.active').removeClass('active')
1771 , prev = active.prev()
1772
1773 if (!prev.length) {
1774 prev = this.$menu.find('li').last()
1775 }
1776
1777 prev.addClass('active')
1778 }
1779
1780 , listen: function () {
1781 this.$element
1782 .on('blur', $.proxy(this.blur, this))
1783 .on('keypress', $.proxy(this.keypress, this))
1784 .on('keyup', $.proxy(this.keyup, this))
1785
1786 if (this.eventSupported('keydown')) {
1787 this.$element.on('keydown', $.proxy(this.keydown, this))
1788 }
1789
1790 this.$menu
1791 .on('click', $.proxy(this.click, this))
1792 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1793 }
1794
1795 , eventSupported: function(eventName) {
1796 var isSupported = eventName in this.$element
1797 if (!isSupported) {
1798 this.$element.setAttribute(eventName, 'return;')
1799 isSupported = typeof this.$element[eventName] === 'function'
1800 }
1801 return isSupported
1802 }
1803
1804 , move: function (e) {
1805 if (!this.shown) return
1806
1807 switch(e.keyCode) {
1808 case 9: // tab
1809 case 13: // enter
1810 case 27: // escape
1811 e.preventDefault()
1812 break
1813
1814 case 38: // up arrow
1815 e.preventDefault()
1816 this.prev()
1817 break
1818
1819 case 40: // down arrow
1820 e.preventDefault()
1821 this.next()
1822 break
1823 }
1824
1825 e.stopPropagation()
1826 }
1827
1828 , keydown: function (e) {
1829 this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
1830 this.move(e)
1831 }
1832
1833 , keypress: function (e) {
1834 if (this.suppressKeyPressRepeat) return
1835 this.move(e)
1836 }
1837
1838 , keyup: function (e) {
1839 switch(e.keyCode) {
1840 case 40: // down arrow
1841 case 38: // up arrow
1842 case 16: // shift
1843 case 17: // ctrl
1844 case 18: // alt
1845 break
1846
1847 case 9: // tab
1848 case 13: // enter
1849 if (!this.shown) return
1850 this.select()
1851 break
1852
1853 case 27: // escape
1854 if (!this.shown) return
1855 this.hide()
1856 break
1857
1858 default:
1859 this.lookup()
1860 }
1861
1862 e.stopPropagation()
1863 e.preventDefault()
1864 }
1865
1866 , blur: function (e) {
1867 var that = this
1868 setTimeout(function () { that.hide() }, 150)
1869 }
1870
1871 , click: function (e) {
1872 e.stopPropagation()
1873 e.preventDefault()
1874 this.select()
1875 }
1876
1877 , mouseenter: function (e) {
1878 this.$menu.find('.active').removeClass('active')
1879 $(e.currentTarget).addClass('active')
1880 }
1881
1882 }
1883
1884
1885 /* TYPEAHEAD PLUGIN DEFINITION
1886 * =========================== */
1887
1888 $.fn.typeahead = function (option) {
1889 return this.each(function () {
1890 var $this = $(this)
1891 , data = $this.data('typeahead')
1892 , options = typeof option == 'object' && option
1893 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1894 if (typeof option == 'string') data[option]()
1895 })
1896 }
1897
1898 $.fn.typeahead.defaults = {
1899 source: []
1900 , items: 8
1901 , menu: '<ul class="typeahead dropdown-menu"></ul>'
1902 , item: '<li><a href="#"></a></li>'
1903 , minLength: 1
1904 }
1905
1906 $.fn.typeahead.Constructor = Typeahead
1907
1908
1909 /* TYPEAHEAD DATA-API
1910 * ================== */
1911
1912 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1913 var $this = $(this)
1914 if ($this.data('typeahead')) return
1915 e.preventDefault()
1916 $this.typeahead($this.data())
1917 })
1918
1919}(window.jQuery);
1920/* ==========================================================
1921 * bootstrap-affix.js v2.2.1
1922 * http://twitter.github.com/bootstrap/javascript.html#affix
1923 * ==========================================================
1924 * Copyright 2012 Twitter, Inc.
1925 *
1926 * Licensed under the Apache License, Version 2.0 (the "License");
1927 * you may not use this file except in compliance with the License.
1928 * You may obtain a copy of the License at
1929 *
1930 * http://www.apache.org/licenses/LICENSE-2.0
1931 *
1932 * Unless required by applicable law or agreed to in writing, software
1933 * distributed under the License is distributed on an "AS IS" BASIS,
1934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1935 * See the License for the specific language governing permissions and
1936 * limitations under the License.
1937 * ========================================================== */
1938
1939
1940!function ($) {
1941
1942 "use strict"; // jshint ;_;
1943
1944
1945 /* AFFIX CLASS DEFINITION
1946 * ====================== */
1947
1948 var Affix = function (element, options) {
1949 this.options = $.extend({}, $.fn.affix.defaults, options)
1950 this.$window = $(window)
1951 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1952 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
1953 this.$element = $(element)
1954 this.checkPosition()
1955 }
1956
1957 Affix.prototype.checkPosition = function () {
1958 if (!this.$element.is(':visible')) return
1959
1960 var scrollHeight = $(document).height()
1961 , scrollTop = this.$window.scrollTop()
1962 , position = this.$element.offset()
1963 , offset = this.options.offset
1964 , offsetBottom = offset.bottom
1965 , offsetTop = offset.top
1966 , reset = 'affix affix-top affix-bottom'
1967 , affix
1968
1969 if (typeof offset != 'object') offsetBottom = offsetTop = offset
1970 if (typeof offsetTop == 'function') offsetTop = offset.top()
1971 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1972
1973 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1974 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1975 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1976 'top' : false
1977
1978 if (this.affixed === affix) return
1979
1980 this.affixed = affix
1981 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1982
1983 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1984 }
1985
1986
1987 /* AFFIX PLUGIN DEFINITION
1988 * ======================= */
1989
1990 $.fn.affix = function (option) {
1991 return this.each(function () {
1992 var $this = $(this)
1993 , data = $this.data('affix')
1994 , options = typeof option == 'object' && option
1995 if (!data) $this.data('affix', (data = new Affix(this, options)))
1996 if (typeof option == 'string') data[option]()
1997 })
1998 }
1999
2000 $.fn.affix.Constructor = Affix
2001
2002 $.fn.affix.defaults = {
2003 offset: 0
2004 }
2005
2006
2007 /* AFFIX DATA-API
2008 * ============== */
2009
2010 $(window).on('load', function () {
2011 $('[data-spy="affix"]').each(function () {
2012 var $spy = $(this)
2013 , data = $spy.data()
2014
2015 data.offset = data.offset || {}
2016
2017 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2018 data.offsetTop && (data.offset.top = data.offsetTop)
2019
2020 $spy.affix(data)
2021 })
2022 })
2023
2024
2025}(window.jQuery);
  
1/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
2(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.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=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",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){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);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{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._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,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.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,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.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):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.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;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),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){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(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(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);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=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.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){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),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(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),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)}}),p.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){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=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}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.propHooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cQ.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:cZ("show"),slideUp:cZ("hide"),slideToggle:cZ("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cY.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cN&&(cN=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cN),cN=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c$=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j,k,l,m=this[0],n=m&&m.ownerDocument;if(!n)return;return(e=n.body)===m?p.offset.bodyOffset(m):(d=n.documentElement,p.contains(d,m)?(c=m.getBoundingClientRect(),f=c_(n),g=d.clientTop||e.clientTop||0,h=d.clientLeft||e.clientLeft||0,i=f.pageYOffset||d.scrollTop,j=f.pageXOffset||d.scrollLeft,k=c.top+i-g,l=c.left+j-h,{top:k,left:l}):{top:0,left:0})},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
  
1/* Modernizr 2.6.1 (Custom Build) | MIT & BSD
2 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
3 */
4;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),k.id=h,(l?k:m).innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(['#modernizr:after{content:"',l,'";visibility:hidden}'].join(""),function(b){a=b.offsetHeight>=1}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
  
1(function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var r,i=this;if(e!==n)t.call(i),i.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(i.length>0&&(r=tinymce.get(i[0].id)))return r.getContent()}function i(e){var t=null;return e&&e.id&&o.tinymce&&(t=tinymce.get(e.id)),t}function a(e){return!!(e&&e.length&&o.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,o){var l=s[o]=e.fn[o],c="text"===o;e.fn[o]=function(t){var o=this;if(!a(o))return l.apply(o,arguments);if(t!==n)return r.call(o.filter(":tinymce"),t),l.apply(o.not(":tinymce"),arguments),o;var s="",u=arguments;return(c?o:o.eq(0)).each(function(t,n){var r=i(n);s+=r?c?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),u)}),s}}),e.each(["append","prepend"],function(t,r){var o=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return a(t)?e!==n?(t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),o.apply(t.not(":tinymce"),arguments),t):void 0:o.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,o){var l=this,c=arguments;if(!t||"value"!==t||!a(l))return o!==n?s.attr.apply(l,c):s.attr.apply(l,c);if(o!==n)return r.call(l.filter(":tinymce"),o),s.attr.apply(l.not(":tinymce"),c),l;var u=l[0],d=i(u);return d?d.getContent({save:!0}):s.attr.apply(e(u),c)}}var n,r,i=[],o=window;e.fn.tinymce=function(n){function a(){var r=[],i=0;t&&(t(),t=null),u.each(function(e,t){var o,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),o=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(o),o.on("init",function(){var e,t=s;u.css("visibility",""),s&&++i==r.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))})}),e.each(r,function(e,t){t.render()})}var s,l,c,u=this,d="";if(!u.length)return u;if(!n)return tinymce.get(u[0].id);if(u.css("visibility","hidden"),o.tinymce||r||!(s=n.script_url))1===r?i.push(a):a();else{r=1,l=s.substring(0,s.lastIndexOf("/")),-1!=s.indexOf(".min")&&(d=".min"),o.tinymce=o.tinyMCEPreInit||{base:l,suffix:d},-1!=s.indexOf("gzip")&&(c=n.language||"en",s=s+(/\?/.test(s)?"&":"?")+"js=true&core=true&suffix="+escape(d)+"&themes="+escape(n.theme)+"&plugins="+escape(n.plugins)+"&languages="+c,o.tinyMCE_GZ||(o.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+c+".js"),t("themes/"+n.theme+"/theme"+d+".js"),t("themes/"+n.theme+"/langs/"+c+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+d+".js"),t("plugins/"+n+"/langs/"+c+".js"))})},end:function(){}}));var f=document.createElement("script");f.type="text/javascript",f.onload=f.onreadystatechange=function(t){t=t||event,("load"==t.type||/complete|loaded/.test(f.readyState))&&(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),a(),e.each(i,function(e,t){t()}))},f.src=s,document.body.appendChild(f)}return u},e.extend(e.expr[":"],{tinymce:function(e){return!!(e.id&&"tinymce"in window&&tinymce.get(e.id))}})})(jQuery);
  
1This is where language files should be placed.
  
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9[This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16freedom to share and change it. By contrast, the GNU General Public
17Licenses are intended to guarantee your freedom to share and change
18free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21specially designated software packages--typically libraries--of the
22Free Software Foundation and other authors who decide to use it. You
23can use it too, but we suggest you first think carefully about whether
24this license or the ordinary General Public License is the better
25strategy to use in any particular case, based on the explanations below.
26
27 When we speak of free software, we are referring to freedom of use,
28not price. Our General Public Licenses are designed to make sure that
29you have the freedom to distribute copies of free software (and charge
30for this service if you wish); that you receive source code or can get
31it if you want it; that you can change the software and use pieces of
32it in new free programs; and that you are informed that you can do
33these things.
34
35 To protect your rights, we need to make restrictions that forbid
36distributors to deny you these rights or to ask you to surrender these
37rights. These restrictions translate to certain responsibilities for
38you if you distribute copies of the library or if you modify it.
39
40 For example, if you distribute copies of the library, whether gratis
41or for a fee, you must give the recipients all the rights that we gave
42you. You must make sure that they, too, receive or can get the source
43code. If you link other code with the library, you must provide
44complete object files to the recipients, so that they can relink them
45with the library after making changes to the library and recompiling
46it. And you must show them these terms so they know their rights.
47
48 We protect your rights with a two-step method: (1) we copyright the
49library, and (2) we offer you this license, which gives you legal
50permission to copy, distribute and/or modify the library.
51
52 To protect each distributor, we want to make it very clear that
53there is no warranty for the free library. Also, if the library is
54modified by someone else and passed on, the recipients should know
55that what they have is not the original version, so that the original
56author's reputation will not be affected by problems that might be
57introduced by others.
58
59 Finally, software patents pose a constant threat to the existence of
60any free program. We wish to make sure that a company cannot
61effectively restrict the users of a free program by obtaining a
62restrictive license from a patent holder. Therefore, we insist that
63any patent license obtained for a version of the library must be
64consistent with the full freedom of use specified in this license.
65
66 Most GNU software, including some libraries, is covered by the
67ordinary GNU General Public License. This license, the GNU Lesser
68General Public License, applies to certain designated libraries, and
69is quite different from the ordinary General Public License. We use
70this license for certain libraries in order to permit linking those
71libraries into non-free programs.
72
73 When a program is linked with a library, whether statically or using
74a shared library, the combination of the two is legally speaking a
75combined work, a derivative of the original library. The ordinary
76General Public License therefore permits such linking only if the
77entire combination fits its criteria of freedom. The Lesser General
78Public License permits more lax criteria for linking other code with
79the library.
80
81 We call this license the "Lesser" General Public License because it
82does Less to protect the user's freedom than the ordinary General
83Public License. It also provides other free software developers Less
84of an advantage over competing non-free programs. These disadvantages
85are the reason we use the ordinary General Public License for many
86libraries. However, the Lesser license provides advantages in certain
87special circumstances.
88
89 For example, on rare occasions, there may be a special need to
90encourage the widest possible use of a certain library, so that it becomes
91a de-facto standard. To achieve this, non-free programs must be
92allowed to use the library. A more frequent case is that a free
93library does the same job as widely used non-free libraries. In this
94case, there is little to gain by limiting the free library to free
95software only, so we use the Lesser General Public License.
96
97 In other cases, permission to use a particular library in non-free
98programs enables a greater number of people to use a large body of
99free software. For example, permission to use the GNU C Library in
100non-free programs enables many more people to use the whole GNU
101operating system, as well as its variant, the GNU/Linux operating
102system.
103
104 Although the Lesser General Public License is Less protective of the
105users' freedom, it does ensure that the user of a program that is
106linked with the Library has the freedom and the wherewithal to run
107that program using a modified version of the Library.
108
109 The precise terms and conditions for copying, distribution and
110modification follow. Pay close attention to the difference between a
111"work based on the library" and a "work that uses the library". The
112former contains code derived from the library, whereas the latter must
113be combined with the library in order to run.
114
115 GNU LESSER GENERAL PUBLIC LICENSE
116 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
118 0. This License Agreement applies to any software library or other
119program which contains a notice placed by the copyright holder or
120other authorized party saying it may be distributed under the terms of
121this Lesser General Public License (also called "this License").
122Each licensee is addressed as "you".
123
124 A "library" means a collection of software functions and/or data
125prepared so as to be conveniently linked with application programs
126(which use some of those functions and data) to form executables.
127
128 The "Library", below, refers to any such software library or work
129which has been distributed under these terms. A "work based on the
130Library" means either the Library or any derivative work under
131copyright law: that is to say, a work containing the Library or a
132portion of it, either verbatim or with modifications and/or translated
133straightforwardly into another language. (Hereinafter, translation is
134included without limitation in the term "modification".)
135
136 "Source code" for a work means the preferred form of the work for
137making modifications to it. For a library, complete source code means
138all the source code for all modules it contains, plus any associated
139interface definition files, plus the scripts used to control compilation
140and installation of the library.
141
142 Activities other than copying, distribution and modification are not
143covered by this License; they are outside its scope. The act of
144running a program using the Library is not restricted, and output from
145such a program is covered only if its contents constitute a work based
146on the Library (independent of the use of the Library in a tool for
147writing it). Whether that is true depends on what the Library does
148and what the program that uses the Library does.
149
150 1. You may copy and distribute verbatim copies of the Library's
151complete source code as you receive it, in any medium, provided that
152you conspicuously and appropriately publish on each copy an
153appropriate copyright notice and disclaimer of warranty; keep intact
154all the notices that refer to this License and to the absence of any
155warranty; and distribute a copy of this License along with the
156Library.
157
158 You may charge a fee for the physical act of transferring a copy,
159and you may at your option offer warranty protection in exchange for a
160fee.
161
162 2. You may modify your copy or copies of the Library or any portion
163of it, thus forming a work based on the Library, and copy and
164distribute such modifications or work under the terms of Section 1
165above, provided that you also meet all of these conditions:
166
167 a) The modified work must itself be a software library.
168
169 b) You must cause the files modified to carry prominent notices
170 stating that you changed the files and the date of any change.
171
172 c) You must cause the whole of the work to be licensed at no
173 charge to all third parties under the terms of this License.
174
175 d) If a facility in the modified Library refers to a function or a
176 table of data to be supplied by an application program that uses
177 the facility, other than as an argument passed when the facility
178 is invoked, then you must make a good faith effort to ensure that,
179 in the event an application does not supply such function or
180 table, the facility still operates, and performs whatever part of
181 its purpose remains meaningful.
182
183 (For example, a function in a library to compute square roots has
184 a purpose that is entirely well-defined independent of the
185 application. Therefore, Subsection 2d requires that any
186 application-supplied function or table used by this function must
187 be optional: if the application does not supply it, the square
188 root function must still compute square roots.)
189
190These requirements apply to the modified work as a whole. If
191identifiable sections of that work are not derived from the Library,
192and can be reasonably considered independent and separate works in
193themselves, then this License, and its terms, do not apply to those
194sections when you distribute them as separate works. But when you
195distribute the same sections as part of a whole which is a work based
196on the Library, the distribution of the whole must be on the terms of
197this License, whose permissions for other licensees extend to the
198entire whole, and thus to each and every part regardless of who wrote
199it.
200
201Thus, it is not the intent of this section to claim rights or contest
202your rights to work written entirely by you; rather, the intent is to
203exercise the right to control the distribution of derivative or
204collective works based on the Library.
205
206In addition, mere aggregation of another work not based on the Library
207with the Library (or with a work based on the Library) on a volume of
208a storage or distribution medium does not bring the other work under
209the scope of this License.
210
211 3. You may opt to apply the terms of the ordinary GNU General Public
212License instead of this License to a given copy of the Library. To do
213this, you must alter all the notices that refer to this License, so
214that they refer to the ordinary GNU General Public License, version 2,
215instead of to this License. (If a newer version than version 2 of the
216ordinary GNU General Public License has appeared, then you can specify
217that version instead if you wish.) Do not make any other change in
218these notices.
219
220 Once this change is made in a given copy, it is irreversible for
221that copy, so the ordinary GNU General Public License applies to all
222subsequent copies and derivative works made from that copy.
223
224 This option is useful when you wish to copy part of the code of
225the Library into a program that is not a library.
226
227 4. You may copy and distribute the Library (or a portion or
228derivative of it, under Section 2) in object code or executable form
229under the terms of Sections 1 and 2 above provided that you accompany
230it with the complete corresponding machine-readable source code, which
231must be distributed under the terms of Sections 1 and 2 above on a
232medium customarily used for software interchange.
233
234 If distribution of object code is made by offering access to copy
235from a designated place, then offering equivalent access to copy the
236source code from the same place satisfies the requirement to
237distribute the source code, even though third parties are not
238compelled to copy the source along with the object code.
239
240 5. A program that contains no derivative of any portion of the
241Library, but is designed to work with the Library by being compiled or
242linked with it, is called a "work that uses the Library". Such a
243work, in isolation, is not a derivative work of the Library, and
244therefore falls outside the scope of this License.
245
246 However, linking a "work that uses the Library" with the Library
247creates an executable that is a derivative of the Library (because it
248contains portions of the Library), rather than a "work that uses the
249library". The executable is therefore covered by this License.
250Section 6 states terms for distribution of such executables.
251
252 When a "work that uses the Library" uses material from a header file
253that is part of the Library, the object code for the work may be a
254derivative work of the Library even though the source code is not.
255Whether this is true is especially significant if the work can be
256linked without the Library, or if the work is itself a library. The
257threshold for this to be true is not precisely defined by law.
258
259 If such an object file uses only numerical parameters, data
260structure layouts and accessors, and small macros and small inline
261functions (ten lines or less in length), then the use of the object
262file is unrestricted, regardless of whether it is legally a derivative
263work. (Executables containing this object code plus portions of the
264Library will still fall under Section 6.)
265
266 Otherwise, if the work is a derivative of the Library, you may
267distribute the object code for the work under the terms of Section 6.
268Any executables containing that work also fall under Section 6,
269whether or not they are linked directly with the Library itself.
270
271 6. As an exception to the Sections above, you may also combine or
272link a "work that uses the Library" with the Library to produce a
273work containing portions of the Library, and distribute that work
274under terms of your choice, provided that the terms permit
275modification of the work for the customer's own use and reverse
276engineering for debugging such modifications.
277
278 You must give prominent notice with each copy of the work that the
279Library is used in it and that the Library and its use are covered by
280this License. You must supply a copy of this License. If the work
281during execution displays copyright notices, you must include the
282copyright notice for the Library among them, as well as a reference
283directing the user to the copy of this License. Also, you must do one
284of these things:
285
286 a) Accompany the work with the complete corresponding
287 machine-readable source code for the Library including whatever
288 changes were used in the work (which must be distributed under
289 Sections 1 and 2 above); and, if the work is an executable linked
290 with the Library, with the complete machine-readable "work that
291 uses the Library", as object code and/or source code, so that the
292 user can modify the Library and then relink to produce a modified
293 executable containing the modified Library. (It is understood
294 that the user who changes the contents of definitions files in the
295 Library will not necessarily be able to recompile the application
296 to use the modified definitions.)
297
298 b) Use a suitable shared library mechanism for linking with the
299 Library. A suitable mechanism is one that (1) uses at run time a
300 copy of the library already present on the user's computer system,
301 rather than copying library functions into the executable, and (2)
302 will operate properly with a modified version of the library, if
303 the user installs one, as long as the modified version is
304 interface-compatible with the version that the work was made with.
305
306 c) Accompany the work with a written offer, valid for at
307 least three years, to give the same user the materials
308 specified in Subsection 6a, above, for a charge no more
309 than the cost of performing this distribution.
310
311 d) If distribution of the work is made by offering access to copy
312 from a designated place, offer equivalent access to copy the above
313 specified materials from the same place.
314
315 e) Verify that the user has already received a copy of these
316 materials or that you have already sent this user a copy.
317
318 For an executable, the required form of the "work that uses the
319Library" must include any data and utility programs needed for
320reproducing the executable from it. However, as a special exception,
321the materials to be distributed need not include anything that is
322normally distributed (in either source or binary form) with the major
323components (compiler, kernel, and so on) of the operating system on
324which the executable runs, unless that component itself accompanies
325the executable.
326
327 It may happen that this requirement contradicts the license
328restrictions of other proprietary libraries that do not normally
329accompany the operating system. Such a contradiction means you cannot
330use both them and the Library together in an executable that you
331distribute.
332
333 7. You may place library facilities that are a work based on the
334Library side-by-side in a single library together with other library
335facilities not covered by this License, and distribute such a combined
336library, provided that the separate distribution of the work based on
337the Library and of the other library facilities is otherwise
338permitted, and provided that you do these two things:
339
340 a) Accompany the combined library with a copy of the same work
341 based on the Library, uncombined with any other library
342 facilities. This must be distributed under the terms of the
343 Sections above.
344
345 b) Give prominent notice with the combined library of the fact
346 that part of it is a work based on the Library, and explaining
347 where to find the accompanying uncombined form of the same work.
348
349 8. You may not copy, modify, sublicense, link with, or distribute
350the Library except as expressly provided under this License. Any
351attempt otherwise to copy, modify, sublicense, link with, or
352distribute the Library is void, and will automatically terminate your
353rights under this License. However, parties who have received copies,
354or rights, from you under this License will not have their licenses
355terminated so long as such parties remain in full compliance.
356
357 9. You are not required to accept this License, since you have not
358signed it. However, nothing else grants you permission to modify or
359distribute the Library or its derivative works. These actions are
360prohibited by law if you do not accept this License. Therefore, by
361modifying or distributing the Library (or any work based on the
362Library), you indicate your acceptance of this License to do so, and
363all its terms and conditions for copying, distributing or modifying
364the Library or works based on it.
365
366 10. Each time you redistribute the Library (or any work based on the
367Library), the recipient automatically receives a license from the
368original licensor to copy, distribute, link with or modify the Library
369subject to these terms and conditions. You may not impose any further
370restrictions on the recipients' exercise of the rights granted herein.
371You are not responsible for enforcing compliance by third parties with
372this License.
373
374 11. If, as a consequence of a court judgment or allegation of patent
375infringement or for any other reason (not limited to patent issues),
376conditions are imposed on you (whether by court order, agreement or
377otherwise) that contradict the conditions of this License, they do not
378excuse you from the conditions of this License. If you cannot
379distribute so as to satisfy simultaneously your obligations under this
380License and any other pertinent obligations, then as a consequence you
381may not distribute the Library at all. For example, if a patent
382license would not permit royalty-free redistribution of the Library by
383all those who receive copies directly or indirectly through you, then
384the only way you could satisfy both it and this License would be to
385refrain entirely from distribution of the Library.
386
387If any portion of this section is held invalid or unenforceable under any
388particular circumstance, the balance of the section is intended to apply,
389and the section as a whole is intended to apply in other circumstances.
390
391It is not the purpose of this section to induce you to infringe any
392patents or other property right claims or to contest validity of any
393such claims; this section has the sole purpose of protecting the
394integrity of the free software distribution system which is
395implemented by public license practices. Many people have made
396generous contributions to the wide range of software distributed
397through that system in reliance on consistent application of that
398system; it is up to the author/donor to decide if he or she is willing
399to distribute software through any other system and a licensee cannot
400impose that choice.
401
402This section is intended to make thoroughly clear what is believed to
403be a consequence of the rest of this License.
404
405 12. If the distribution and/or use of the Library is restricted in
406certain countries either by patents or by copyrighted interfaces, the
407original copyright holder who places the Library under this License may add
408an explicit geographical distribution limitation excluding those countries,
409so that distribution is permitted only in or among countries not thus
410excluded. In such case, this License incorporates the limitation as if
411written in the body of this License.
412
413 13. The Free Software Foundation may publish revised and/or new
414versions of the Lesser General Public License from time to time.
415Such new versions will be similar in spirit to the present version,
416but may differ in detail to address new problems or concerns.
417
418Each version is given a distinguishing version number. If the Library
419specifies a version number of this License which applies to it and
420"any later version", you have the option of following the terms and
421conditions either of that version or of any later version published by
422the Free Software Foundation. If the Library does not specify a
423license version number, you may choose any version ever published by
424the Free Software Foundation.
425
426 14. If you wish to incorporate parts of the Library into other free
427programs whose distribution conditions are incompatible with these,
428write to the author to ask for permission. For software which is
429copyrighted by the Free Software Foundation, write to the Free
430Software Foundation; we sometimes make exceptions for this. Our
431decision will be guided by the two goals of preserving the free status
432of all derivatives of our free software and of promoting the sharing
433and reuse of software generally.
434
435 NO WARRANTY
436
437 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
447 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456DAMAGES.
457
458 END OF TERMS AND CONDITIONS
459
460 How to Apply These Terms to Your New Libraries
461
462 If you develop a new library, and you want it to be of the greatest
463possible use to the public, we recommend making it free software that
464everyone can redistribute and change. You can do so by permitting
465redistribution under these terms (or, alternatively, under the terms of the
466ordinary General Public License).
467
468 To apply these terms, attach the following notices to the library. It is
469safest to attach them to the start of each source file to most effectively
470convey the exclusion of warranty; and each file should have at least the
471"copyright" line and a pointer to where the full notice is found.
472
473 <one line to give the library's name and a brief idea of what it does.>
474 Copyright (C) <year> <name of author>
475
476 This library is free software; you can redistribute it and/or
477 modify it under the terms of the GNU Lesser General Public
478 License as published by the Free Software Foundation; either
479 version 2.1 of the License, or (at your option) any later version.
480
481 This library is distributed in the hope that it will be useful,
482 but WITHOUT ANY WARRANTY; without even the implied warranty of
483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 Lesser General Public License for more details.
485
486 You should have received a copy of the GNU Lesser General Public
487 License along with this library; if not, write to the Free Software
488 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489
490Also add information on how to contact you by electronic and paper mail.
491
492You should also get your employer (if you work as a programmer) or your
493school, if any, to sign a "copyright disclaimer" for the library, if
494necessary. Here is a sample; alter the names:
495
496 Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
499 <signature of Ty Coon>, 1 April 1990
500 Ty Coon, President of Vice
501
502That's all there is to it!
  
1tinymce.PluginManager.add("advlist",function(e){function t(e,t){var n=[];return tinymce.each(t.split(/[ ,]/),function(e){n.push({text:e.replace(/\-/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),data:"default"==e?"":e})}),n}function n(t,n){var r,i=e.dom,o=e.selection;r=i.getParent(o.getNode(),"ol,ul"),r&&r.nodeName==t&&n!==!1||e.execCommand("UL"==t?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?a[t]:n,a[t]=n,r=i.getParent(o.getNode(),"ol,ul"),r&&(i.setStyle(r,"listStyleType",n),r.removeAttribute("data-mce-style")),e.focus()}function r(t){var n=e.dom.getStyle(e.dom.getParent(e.selection.getNode(),"ol,ul"),"listStyleType")||"";t.control.items().each(function(e){e.active(e.settings.data===n)})}var i,o,a={};i=t("OL",e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),o=t("UL",e.getParam("advlist_bullet_styles","default,circle,disc,square")),e.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:i,onshow:r,onselect:function(e){n("OL",e.control.settings.data)},onclick:function(){n("OL",!1)}}),e.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:o,onshow:r,onselect:function(e){n("UL",e.control.settings.data)},onclick:function(){n("UL",!1)}})});
  
1tinymce.PluginManager.add("anchor",function(e){function t(){e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:e.selection.getNode().id},onsubmit:function(t){e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t.data.name}))}})}e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:t,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:t})});
  
1tinymce.PluginManager.add("autolink",function(e){function t(e){i(e,-1,"(",!0)}function n(e){i(e,0,"",!0)}function r(e){i(e,-1,"",!1)}function i(e,t,n){var r,i,o,a,s,l,c,u,d;if(r=e.selection.getRng(!0).cloneRange(),5>r.startOffset){if(u=r.endContainer.previousSibling,!u){if(!r.endContainer.firstChild||!r.endContainer.firstChild.nextSibling)return;u=r.endContainer.firstChild.nextSibling}if(d=u.length,r.setStart(u,d),r.setEnd(u,d),5>r.endOffset)return;i=r.endOffset,a=u}else{if(a=r.endContainer,3!=a.nodeType&&a.firstChild){for(;3!=a.nodeType&&a.firstChild;)a=a.firstChild;3==a.nodeType&&(r.setStart(a,0),r.setEnd(a,a.nodeValue.length))}i=1==r.endOffset?2:r.endOffset-1-t}o=i;do r.setStart(a,i>=2?i-2:0),r.setEnd(a,i>=1?i-1:0),i-=1;while(" "!=""+r&&""!=""+r&&160!=(""+r).charCodeAt(0)&&i-2>=0&&""+r!=n);if(""+r==n||160==(""+r).charCodeAt(0)?(r.setStart(a,i),r.setEnd(a,o),i+=1):0===r.startOffset?(r.setStart(a,0),r.setEnd(a,o)):(r.setStart(a,i),r.setEnd(a,o)),l=""+r,"."==l.charAt(l.length-1)&&r.setEnd(a,o-1),l=""+r,c=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),c&&("www."==c[1]?c[1]="http://www.":/@$/.test(c[1])&&!/^mailto:/.test(c[1])&&(c[1]="mailto:"+c[1]),s=e.selection.getBookmark(),e.selection.setRng(r),e.execCommand("createlink",!1,c[1]+c[2]),e.selection.moveToBookmark(s),e.nodeChanged(),tinymce.Env.webkit)){e.selection.collapse(!1);var f=Math.min(a.length,o+1);r.setStart(a,f),r.setEnd(a,f),e.selection.setRng(r)}}e.on("keydown",function(t){return 13==t.keyCode?r(e):void 0}),tinymce.Env.ie||(e.on("keypress",function(n){return 41==n.which?t(e):void 0}),e.on("keyup",function(t){return 32==t.keyCode?n(e):void 0}))});
  
1tinymce.PluginManager.add("autoresize",function(e){function t(i){var o,a,s=e.getDoc(),l=s.body,c=s.documentElement,u=tinymce.DOM,d=n.autoresize_min_height;"setcontent"==i.type&&i.initial||e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()||(a=tinymce.Env.ie?l.scrollHeight:tinymce.Env.webkit&&0===l.clientHeight?0:l.offsetHeight,a>n.autoresize_min_height&&(d=a),n.autoresize_max_height&&a>n.autoresize_max_height?(d=n.autoresize_max_height,l.style.overflowY="auto",c.style.overflowY="auto"):(l.style.overflowY="hidden",c.style.overflowY="hidden",l.scrollTop=0),d!==r&&(o=d-r,u.setStyle(u.get(e.id+"_ifr"),"height",d+"px"),r=d,tinymce.isWebKit&&0>o&&t(i)))}var n=e.settings,r=0;n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){e.dom.setStyle(e.getBody(),"paddingBottom",e.getParam("autoresize_bottom_margin",50)+"px")}),e.on("change setcontent paste keyup",t),e.getParam("autoresize_on_init",!0)&&e.on("load",t),e.addCommand("mceAutoResize",t)});
  
1tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(f.getItem(p+"autosave.time"),10)||0;return(new Date).getTime()-e>d.autosave_retention?(r(),!1):!0}function r(){f.removeItem(p+"autosave.draft"),f.removeItem(p+"autosave.time")}function i(){u&&e.isDirty()&&(f.setItem(p+"autosave.draft",e.getContent({format:"raw",no_events:!0})),f.setItem(p+"autosave.time",(new Date).getTime()),e.fire("StoreDraft"))}function o(){n()&&(e.setContent(f.getItem(p+"autosave.draft"),{format:"raw"}),r(),e.fire("RestoreDraft"))}function a(){u||(setInterval(function(){e.removed||i()},d.autosave_interval),u=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft",function(){t.disabled(!n())}),a()}function l(){e.undoManager.beforeChange(),o(),e.undoManager.add()}function c(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e}var u,d=e.settings,f=tinymce.util.LocalStorage,p=e.id;d.autosave_interval=t(d.autosave_interval,"30s"),d.autosave_retention=t(d.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),this.storeDraft=i,window.onbeforeunload=c});
  
1(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/<font>(.*?)<\/font>/gi,"$1"),t(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),t(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),t(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),t(/<u>/gi,"[u]"),t(/<blockquote[^>]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/<br \/>/gi,"\n"),t(/<br\/>/gi,"\n"),t(/<br>/gi,"\n"),t(/<p>/gi,""),t(/<\/p>/gi,"\n"),t(/&nbsp;|\u00a0/gi," "),t(/&quot;/gi,'"'),t(/&lt;/gi,"<"),t(/&gt;/gi,">"),t(/&amp;/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"<br />"),t(/\[b\]/gi,"<strong>"),t(/\[\/b\]/gi,"</strong>"),t(/\[i\]/gi,"<em>"),t(/\[\/i\]/gi,"</em>"),t(/\[u\]/gi,"<u>"),t(/\[\/u\]/gi,"</u>"),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),t(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),t(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),t(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
  
1tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var r,i,o,a;r='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var s=25;for(o=0;10>o;o++){for(r+="<tr>",i=0;s>i;i++){var l=n[o*s+i],c="g"+(o*s+i);r+='<td title="'+l[1]+'"><div id="'+c+'" tabIndex="-1">'+(l?String.fromCharCode(parseInt(l[0],10)):"&nbsp;")+"</div></td>"}r+="</tr>"}r+="</tbody></table>";var u={type:"container",html:r,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&a.find("#preview").text(n.firstChild.firstChild.data)}};a=e.windowManager.open({title:"Special characters",spacing:10,padding:10,items:[u,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){a.close()}}]})}var n=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Insert special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,context:"insert"})});
  
1tinymce.PluginManager.add("code",function(e){function t(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:600,minHeight:500,value:e.getContent(),spellcheck:!1},onSubmit:function(t){e.setContent(t.data.code)}})}e.addButton("code",{icon:"code",tooltip:"Source code",onclick:t}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:t})});
  
1/**
2 * editable_selects.js
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11var TinyMCE_EditableSelects = {
12 editSelectElm : null,
13
14 init : function() {
15 var nl = document.getElementsByTagName("select"), i, d = document, o;
16
17 for (i=0; i<nl.length; i++) {
18 if (nl[i].className.indexOf('mceEditableSelect') != -1) {
19 o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
20
21 o.className = 'mceAddSelectValue';
22
23 nl[i].options[nl[i].options.length] = o;
24 nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
25 }
26 }
27 },
28
29 onChangeEditableSelect : function(e) {
30 var d = document, ne, se = window.event ? window.event.srcElement : e.target;
31
32 if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
33 ne = d.createElement("input");
34 ne.id = se.id + "_custom";
35 ne.name = se.name + "_custom";
36 ne.type = "text";
37
38 ne.style.width = se.offsetWidth + 'px';
39 se.parentNode.insertBefore(ne, se);
40 se.style.display = 'none';
41 ne.focus();
42 ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
43 ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
44 TinyMCE_EditableSelects.editSelectElm = se;
45 }
46 },
47
48 onBlurEditableSelectInput : function() {
49 var se = TinyMCE_EditableSelects.editSelectElm;
50
51 if (se) {
52 if (se.previousSibling.value != '') {
53 addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
54 selectByValue(document.forms[0], se.id, se.previousSibling.value);
55 } else
56 selectByValue(document.forms[0], se.id, '');
57
58 se.style.display = 'inline';
59 se.parentNode.removeChild(se.previousSibling);
60 TinyMCE_EditableSelects.editSelectElm = null;
61 }
62 },
63
64 onKeyDown : function(e) {
65 e = e || window.event;
66
67 if (e.keyCode == 13)
68 TinyMCE_EditableSelects.onBlurEditableSelectInput();
69 }
70};
  
1/**
2 * form_utils.js
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
12
13function getColorPickerHTML(id, target_form_element) {
14 var h = "", dom = tinyMCEPopup.dom;
15
16 if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
17 label.id = label.id || dom.uniqueId();
18 }
19
20 h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
21 h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
22
23 return h;
24}
25
26function updateColor(img_id, form_element_id) {
27 document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
28}
29
30function setBrowserDisabled(id, state) {
31 var img = document.getElementById(id);
32 var lnk = document.getElementById(id + "_link");
33
34 if (lnk) {
35 if (state) {
36 lnk.setAttribute("realhref", lnk.getAttribute("href"));
37 lnk.removeAttribute("href");
38 tinyMCEPopup.dom.addClass(img, 'disabled');
39 } else {
40 if (lnk.getAttribute("realhref"))
41 lnk.setAttribute("href", lnk.getAttribute("realhref"));
42
43 tinyMCEPopup.dom.removeClass(img, 'disabled');
44 }
45 }
46}
47
48function getBrowserHTML(id, target_form_element, type, prefix) {
49 var option = prefix + "_" + type + "_browser_callback", cb, html;
50
51 cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
52
53 if (!cb)
54 return "";
55
56 html = "";
57 html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
58 html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
59
60 return html;
61}
62
63function openBrowser(img_id, target_form_element, type, option) {
64 var img = document.getElementById(img_id);
65
66 if (img.className != "mceButtonDisabled")
67 tinyMCEPopup.openBrowser(target_form_element, type, option);
68}
69
70function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
71 if (!form_obj || !form_obj.elements[field_name])
72 return;
73
74 if (!value)
75 value = "";
76
77 var sel = form_obj.elements[field_name];
78
79 var found = false;
80 for (var i=0; i<sel.options.length; i++) {
81 var option = sel.options[i];
82
83 if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
84 option.selected = true;
85 found = true;
86 } else
87 option.selected = false;
88 }
89
90 if (!found && add_custom && value != '') {
91 var option = new Option(value, value);
92 option.selected = true;
93 sel.options[sel.options.length] = option;
94 sel.selectedIndex = sel.options.length - 1;
95 }
96
97 return found;
98}
99
100function getSelectValue(form_obj, field_name) {
101 var elm = form_obj.elements[field_name];
102
103 if (elm == null || elm.options == null || elm.selectedIndex === -1)
104 return "";
105
106 return elm.options[elm.selectedIndex].value;
107}
108
109function addSelectValue(form_obj, field_name, name, value) {
110 var s = form_obj.elements[field_name];
111 var o = new Option(name, value);
112 s.options[s.options.length] = o;
113}
114
115function addClassesToList(list_id, specific_option) {
116 // Setup class droplist
117 var styleSelectElm = document.getElementById(list_id);
118 var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
119 styles = tinyMCEPopup.getParam(specific_option, styles);
120
121 if (styles) {
122 var stylesAr = styles.split(';');
123
124 for (var i=0; i<stylesAr.length; i++) {
125 if (stylesAr != "") {
126 var key, value;
127
128 key = stylesAr[i].split('=')[0];
129 value = stylesAr[i].split('=')[1];
130
131 styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
132 }
133 }
134 } else {
135 tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
136 styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
137 });
138 }
139}
140
141function isVisible(element_id) {
142 var elm = document.getElementById(element_id);
143
144 return elm && elm.style.display != "none";
145}
146
147function convertRGBToHex(col) {
148 var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
149
150 var rgb = col.replace(re, "$1,$2,$3").split(',');
151 if (rgb.length == 3) {
152 r = parseInt(rgb[0]).toString(16);
153 g = parseInt(rgb[1]).toString(16);
154 b = parseInt(rgb[2]).toString(16);
155
156 r = r.length == 1 ? '0' + r : r;
157 g = g.length == 1 ? '0' + g : g;
158 b = b.length == 1 ? '0' + b : b;
159
160 return "#" + r + g + b;
161 }
162
163 return col;
164}
165
166function convertHexToRGB(col) {
167 if (col.indexOf('#') != -1) {
168 col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
169
170 r = parseInt(col.substring(0, 2), 16);
171 g = parseInt(col.substring(2, 4), 16);
172 b = parseInt(col.substring(4, 6), 16);
173
174 return "rgb(" + r + "," + g + "," + b + ")";
175 }
176
177 return col;
178}
179
180function trimSize(size) {
181 return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
182}
183
184function getCSSSize(size) {
185 size = trimSize(size);
186
187 if (size == "")
188 return "";
189
190 // Add px
191 if (/^[0-9]+$/.test(size))
192 size += 'px';
193 // Sanity check, IE doesn't like broken values
194 else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
195 return "";
196
197 return size;
198}
199
200function getStyle(elm, attrib, style) {
201 var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
202
203 if (val != '')
204 return '' + val;
205
206 if (typeof(style) == 'undefined')
207 style = attrib;
208
209 return tinyMCEPopup.dom.getStyle(elm, style);
210}
  
1/**
2 * mctabs.js
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11function MCTabs() {
12 this.settings = [];
13 this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
14};
15
16MCTabs.prototype.init = function(settings) {
17 this.settings = settings;
18};
19
20MCTabs.prototype.getParam = function(name, default_value) {
21 var value = null;
22
23 value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
24
25 // Fix bool values
26 if (value == "true" || value == "false")
27 return (value == "true");
28
29 return value;
30};
31
32MCTabs.prototype.showTab =function(tab){
33 tab.className = 'current';
34 tab.setAttribute("aria-selected", true);
35 tab.setAttribute("aria-expanded", true);
36 tab.tabIndex = 0;
37};
38
39MCTabs.prototype.hideTab =function(tab){
40 var t=this;
41
42 tab.className = '';
43 tab.setAttribute("aria-selected", false);
44 tab.setAttribute("aria-expanded", false);
45 tab.tabIndex = -1;
46};
47
48MCTabs.prototype.showPanel = function(panel) {
49 panel.className = 'current';
50 panel.setAttribute("aria-hidden", false);
51};
52
53MCTabs.prototype.hidePanel = function(panel) {
54 panel.className = 'panel';
55 panel.setAttribute("aria-hidden", true);
56};
57
58MCTabs.prototype.getPanelForTab = function(tabElm) {
59 return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
60};
61
62MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
63 var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
64
65 tabElm = document.getElementById(tab_id);
66
67 if (panel_id === undefined) {
68 panel_id = t.getPanelForTab(tabElm);
69 }
70
71 panelElm= document.getElementById(panel_id);
72 panelContainerElm = panelElm ? panelElm.parentNode : null;
73 tabContainerElm = tabElm ? tabElm.parentNode : null;
74 selectionClass = t.getParam('selection_class', 'current');
75
76 if (tabElm && tabContainerElm) {
77 nodes = tabContainerElm.childNodes;
78
79 // Hide all other tabs
80 for (i = 0; i < nodes.length; i++) {
81 if (nodes[i].nodeName == "LI") {
82 t.hideTab(nodes[i]);
83 }
84 }
85
86 // Show selected tab
87 t.showTab(tabElm);
88 }
89
90 if (panelElm && panelContainerElm) {
91 nodes = panelContainerElm.childNodes;
92
93 // Hide all other panels
94 for (i = 0; i < nodes.length; i++) {
95 if (nodes[i].nodeName == "DIV")
96 t.hidePanel(nodes[i]);
97 }
98
99 if (!avoid_focus) {
100 tabElm.focus();
101 }
102
103 // Show selected panel
104 t.showPanel(panelElm);
105 }
106};
107
108MCTabs.prototype.getAnchor = function() {
109 var pos, url = document.location.href;
110
111 if ((pos = url.lastIndexOf('#')) != -1)
112 return url.substring(pos + 1);
113
114 return "";
115};
116
117
118//Global instance
119var mcTabs = new MCTabs();
120
121tinyMCEPopup.onInit.add(function() {
122 var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
123
124 each(dom.select('div.tabs'), function(tabContainerElm) {
125 var keyNav;
126
127 dom.setAttrib(tabContainerElm, "role", "tablist");
128
129 var items = tinyMCEPopup.dom.select('li', tabContainerElm);
130 var action = function(id) {
131 mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
132 mcTabs.onChange.dispatch(id);
133 };
134
135 each(items, function(item) {
136 dom.setAttrib(item, 'role', 'tab');
137 dom.bind(item, 'click', function(evt) {
138 action(item.id);
139 });
140 });
141
142 dom.bind(dom.getRoot(), 'keydown', function(evt) {
143 if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
144 keyNav.moveFocus(evt.shiftKey ? -1 : 1);
145 tinymce.dom.Event.cancel(evt);
146 }
147 });
148
149 each(dom.select('a', tabContainerElm), function(a) {
150 dom.setAttrib(a, 'tabindex', '-1');
151 });
152
153 keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
154 root: tabContainerElm,
155 items: items,
156 onAction: action,
157 actOnFocus: true,
158 enableLeftRight: true,
159 enableUpDown: true
160 }, tinyMCEPopup.dom);
161 });
162});
  
1/**
2 * Popup.js
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11// Some global instances
12var tinymce = null, tinyMCEPopup, tinyMCE;
13
14/**
15 * TinyMCE popup/dialog helper class. This gives you easy access to the
16 * parent editor instance and a bunch of other things. It's higly recommended
17 * that you load this script into your dialogs.
18 *
19 * @static
20 * @class tinyMCEPopup
21 */
22tinyMCEPopup = {
23 /**
24 * Initializes the popup this will be called automatically.
25 *
26 * @method init
27 */
28 init : function() {
29 var t = this, w, ti, settings;
30
31 // Find window & API
32 w = t.getWin();
33 tinymce = w.tinymce;
34 tinyMCE = w.tinyMCE;
35 t.editor = tinymce.EditorManager.activeEditor;
36 t.params = t.editor.windowManager.params;
37 t.features = t.editor.windowManager.features;
38 settings = t.editor.settings;
39
40 // Setup popup CSS path(s)
41 if (settings.popup_css !== false) {
42 if (settings.popup_css) {
43 settings.popup_css = t.documentBaseURI.toAbsolute(settings.popup_css);
44 } else {
45 settings.popup_css = t.baseURI.toAbsolute("themes/" + settings.theme + "/skins/" + settings.skin + "/dialog.css");
46 }
47 }
48
49 if (settings.popup_css_add) {
50 settings.popup_css += ',' + t.documentBaseURI.toAbsolute(settings.popup_css_add);
51 }
52
53 // Setup local DOM
54 t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document, {ownEvents: true, proxy: tinyMCEPopup._eventProxy});
55 t.dom.bind(window, 'ready', t._onDOMLoaded, t);
56
57 // Enables you to skip loading the default css
58 if (t.features.popup_css !== false)
59 t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css);
60
61 // Setup on init listeners
62 t.listeners = [];
63
64 /**
65 * Fires when the popup is initialized.
66 *
67 * @event onInit
68 * @param {tinymce.Editor} editor Editor instance.
69 * @example
70 * // Alerts the selected contents when the dialog is loaded
71 * tinyMCEPopup.onInit.add(function(ed) {
72 * alert(ed.selection.getContent());
73 * });
74 *
75 * // Executes the init method on page load in some object using the SomeObject scope
76 * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject);
77 */
78 t.onInit = {
79 add : function(f, s) {
80 t.listeners.push({func : f, scope : s});
81 }
82 };
83
84 t.isWindow = !t.getWindowArg('mce_inline');
85 t.id = t.getWindowArg('mce_window_id');
86 },
87
88 /**
89 * Returns the reference to the parent window that opened the dialog.
90 *
91 * @method getWin
92 * @return {Window} Reference to the parent window that opened the dialog.
93 */
94 getWin : function() {
95 // Added frameElement check to fix bug: #2817583
96 return (!window.frameElement && window.dialogArguments) || opener || parent || top;
97 },
98
99 /**
100 * Returns a window argument/parameter by name.
101 *
102 * @method getWindowArg
103 * @param {String} n Name of the window argument to retrive.
104 * @param {String} dv Optional default value to return.
105 * @return {String} Argument value or default value if it wasn't found.
106 */
107 getWindowArg : function(n, dv) {
108 var v = this.params[n];
109
110 return tinymce.is(v) ? v : dv;
111 },
112
113 /**
114 * Returns a editor parameter/config option value.
115 *
116 * @method getParam
117 * @param {String} n Name of the editor config option to retrive.
118 * @param {String} dv Optional default value to return.
119 * @return {String} Parameter value or default value if it wasn't found.
120 */
121 getParam : function(n, dv) {
122 return this.editor.getParam(n, dv);
123 },
124
125 /**
126 * Returns a language item by key.
127 *
128 * @method getLang
129 * @param {String} n Language item like mydialog.something.
130 * @param {String} dv Optional default value to return.
131 * @return {String} Language value for the item like "my string" or the default value if it wasn't found.
132 */
133 getLang : function(n, dv) {
134 return this.editor.getLang(n, dv);
135 },
136
137 /**
138 * Executed a command on editor that opened the dialog/popup.
139 *
140 * @method execCommand
141 * @param {String} cmd Command to execute.
142 * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not.
143 * @param {Object} val Optional value to pass with the comman like an URL.
144 * @param {Object} a Optional arguments object.
145 */
146 execCommand : function(cmd, ui, val, a) {
147 a = a || {};
148 a.skip_focus = 1;
149
150 this.restoreSelection();
151 return this.editor.execCommand(cmd, ui, val, a);
152 },
153
154 /**
155 * Resizes the dialog to the inner size of the window. This is needed since various browsers
156 * have different border sizes on windows.
157 *
158 * @method resizeToInnerSize
159 */
160 resizeToInnerSize : function() {
161 var t = this;
162
163 // Detach it to workaround a Chrome specific bug
164 // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281
165 setTimeout(function() {
166 var vp = t.dom.getViewPort(window);
167
168 t.editor.windowManager.resizeBy(
169 t.getWindowArg('mce_width') - vp.w,
170 t.getWindowArg('mce_height') - vp.h,
171 t.id || window
172 );
173 }, 10);
174 },
175
176 /**
177 * Will executed the specified string when the page has been loaded. This function
178 * was added for compatibility with the 2.x branch.
179 *
180 * @method executeOnLoad
181 * @param {String} s String to evalutate on init.
182 */
183 executeOnLoad : function(s) {
184 this.onInit.add(function() {
185 eval(s);
186 });
187 },
188
189 /**
190 * Stores the current editor selection for later restoration. This can be useful since some browsers
191 * looses it's selection if a control element is selected/focused inside the dialogs.
192 *
193 * @method storeSelection
194 */
195 storeSelection : function() {
196 this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1);
197 },
198
199 /**
200 * Restores any stored selection. This can be useful since some browsers
201 * looses it's selection if a control element is selected/focused inside the dialogs.
202 *
203 * @method restoreSelection
204 */
205 restoreSelection : function() {
206 var t = tinyMCEPopup;
207
208 if (!t.isWindow && tinymce.isIE)
209 t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
210 },
211
212 /**
213 * Loads a specific dialog language pack. If you pass in plugin_url as a arugment
214 * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
215 *
216 * @method requireLangPack
217 */
218 requireLangPack : function() {
219 var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url');
220
221 if (u && t.editor.settings.language && t.features.translate_i18n !== false && t.editor.settings.language_load !== false) {
222 u += '/langs/' + t.editor.settings.language + '_dlg.js';
223
224 if (!tinymce.ScriptLoader.isDone(u)) {
225 document.write('<script type="text/javascript" src="' + u + '"></script>');
226 tinymce.ScriptLoader.markDone(u);
227 }
228 }
229 },
230
231 /**
232 * Executes a color picker on the specified element id. When the user
233 * then selects a color it will be set as the value of the specified element.
234 *
235 * @method pickColor
236 * @param {DOMEvent} e DOM event object.
237 * @param {string} element_id Element id to be filled with the color value from the picker.
238 */
239 pickColor : function(e, element_id) {
240 this.execCommand('mceColorPicker', true, {
241 color : document.getElementById(element_id).value,
242 func : function(c) {
243 document.getElementById(element_id).value = c;
244
245 try {
246 document.getElementById(element_id).onchange();
247 } catch (ex) {
248 // Try fire event, ignore errors
249 }
250 }
251 });
252 },
253
254 /**
255 * Opens a filebrowser/imagebrowser this will set the output value from
256 * the browser as a value on the specified element.
257 *
258 * @method openBrowser
259 * @param {string} element_id Id of the element to set value in.
260 * @param {string} type Type of browser to open image/file/flash.
261 * @param {string} option Option name to get the file_broswer_callback function name from.
262 */
263 openBrowser : function(element_id, type, option) {
264 tinyMCEPopup.restoreSelection();
265 this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
266 },
267
268 /**
269 * Creates a confirm dialog. Please don't use the blocking behavior of this
270 * native version use the callback method instead then it can be extended.
271 *
272 * @method confirm
273 * @param {String} t Title for the new confirm dialog.
274 * @param {function} cb Callback function to be executed after the user has selected ok or cancel.
275 * @param {Object} s Optional scope to execute the callback in.
276 */
277 confirm : function(t, cb, s) {
278 this.editor.windowManager.confirm(t, cb, s, window);
279 },
280
281 /**
282 * Creates a alert dialog. Please don't use the blocking behavior of this
283 * native version use the callback method instead then it can be extended.
284 *
285 * @method alert
286 * @param {String} t Title for the new alert dialog.
287 * @param {function} cb Callback function to be executed after the user has selected ok.
288 * @param {Object} s Optional scope to execute the callback in.
289 */
290 alert : function(tx, cb, s) {
291 this.editor.windowManager.alert(tx, cb, s, window);
292 },
293
294 /**
295 * Closes the current window.
296 *
297 * @method close
298 */
299 close : function() {
300 var t = this;
301
302 // To avoid domain relaxing issue in Opera
303 function close() {
304 t.editor.windowManager.close(window);
305 tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
306 };
307
308 if (tinymce.isOpera)
309 t.getWin().setTimeout(close, 0);
310 else
311 close();
312 },
313
314 // Internal functions
315
316 _restoreSelection : function() {
317 var e = window.event.srcElement;
318
319 if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
320 tinyMCEPopup.restoreSelection();
321 },
322
323/* _restoreSelection : function() {
324 var e = window.event.srcElement;
325
326 // If user focus a non text input or textarea
327 if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
328 tinyMCEPopup.restoreSelection();
329 },*/
330
331 _onDOMLoaded : function() {
332 var t = tinyMCEPopup, ti = document.title, bm, h, nv;
333
334 // Translate page
335 if (t.features.translate_i18n !== false) {
336 h = document.body.innerHTML;
337
338 // Replace a=x with a="x" in IE
339 if (tinymce.isIE)
340 h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
341
342 document.dir = t.editor.getParam('directionality','');
343
344 if ((nv = t.editor.translate(h)) && nv != h)
345 document.body.innerHTML = nv;
346
347 if ((nv = t.editor.translate(ti)) && nv != ti)
348 document.title = ti = nv;
349 }
350
351 if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow)
352 t.dom.addClass(document.body, 'forceColors');
353
354 document.body.style.display = '';
355
356 // Restore selection in IE when focus is placed on a non textarea or input element of the type text
357 if (tinymce.isIE) {
358 document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
359
360 // Add base target element for it since it would fail with modal dialogs
361 t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'});
362 }
363
364 t.restoreSelection();
365 t.resizeToInnerSize();
366
367 // Set inline title
368 if (!t.isWindow)
369 t.editor.windowManager.setTitle(window, ti);
370 else
371 window.focus();
372
373 if (!tinymce.isIE && !t.isWindow) {
374 t.dom.bind(document, 'focus', function() {
375 t.editor.windowManager.focus(t.id);
376 });
377 }
378
379 // Patch for accessibility
380 tinymce.each(t.dom.select('select'), function(e) {
381 e.onkeydown = tinyMCEPopup._accessHandler;
382 });
383
384 // Call onInit
385 // Init must be called before focus so the selection won't get lost by the focus call
386 tinymce.each(t.listeners, function(o) {
387 o.func.call(o.scope, t.editor);
388 });
389
390 // Move focus to window
391 if (t.getWindowArg('mce_auto_focus', true)) {
392 window.focus();
393
394 // Focus element with mceFocus class
395 tinymce.each(document.forms, function(f) {
396 tinymce.each(f.elements, function(e) {
397 if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
398 e.focus();
399 return false; // Break loop
400 }
401 });
402 });
403 }
404
405 document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
406 },
407
408 _accessHandler : function(e) {
409 e = e || window.event;
410
411 if (e.keyCode == 13 || e.keyCode == 32) {
412 var elm = e.target || e.srcElement;
413
414 if (elm.onchange)
415 elm.onchange();
416
417 return tinymce.dom.Event.cancel(e);
418 }
419 },
420
421 _closeWinKeyHandler : function(e) {
422 e = e || window.event;
423
424 if (e.keyCode == 27)
425 tinyMCEPopup.close();
426 },
427
428 _eventProxy: function(id) {
429 return function(evt) {
430 tinyMCEPopup.dom.events.callNativeHandler(id, evt);
431 };
432 }
433};
434
435tinyMCEPopup.init();
  
1/**
2 * validate.js
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11/**
12 // String validation:
13
14 if (!Validator.isEmail('myemail'))
15 alert('Invalid email.');
16
17 // Form validation:
18
19 var f = document.forms['myform'];
20
21 if (!Validator.isEmail(f.myemail))
22 alert('Invalid email.');
23*/
24
25var Validator = {
26 isEmail : function(s) {
27 return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
28 },
29
30 isAbsUrl : function(s) {
31 return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
32 },
33
34 isSize : function(s) {
35 return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
36 },
37
38 isId : function(s) {
39 return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
40 },
41
42 isEmpty : function(s) {
43 var nl, i;
44
45 if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
46 return true;
47
48 if (s.type == 'checkbox' && !s.checked)
49 return true;
50
51 if (s.type == 'radio') {
52 for (i=0, nl = s.form.elements; i<nl.length; i++) {
53 if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
54 return false;
55 }
56
57 return true;
58 }
59
60 return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
61 },
62
63 isNumber : function(s, d) {
64 return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
65 },
66
67 test : function(s, p) {
68 s = s.nodeType == 1 ? s.value : s;
69
70 return s == '' || new RegExp(p).test(s);
71 }
72};
73
74var AutoValidator = {
75 settings : {
76 id_cls : 'id',
77 int_cls : 'int',
78 url_cls : 'url',
79 number_cls : 'number',
80 email_cls : 'email',
81 size_cls : 'size',
82 required_cls : 'required',
83 invalid_cls : 'invalid',
84 min_cls : 'min',
85 max_cls : 'max'
86 },
87
88 init : function(s) {
89 var n;
90
91 for (n in s)
92 this.settings[n] = s[n];
93 },
94
95 validate : function(f) {
96 var i, nl, s = this.settings, c = 0;
97
98 nl = this.tags(f, 'label');
99 for (i=0; i<nl.length; i++) {
100 this.removeClass(nl[i], s.invalid_cls);
101 nl[i].setAttribute('aria-invalid', false);
102 }
103
104 c += this.validateElms(f, 'input');
105 c += this.validateElms(f, 'select');
106 c += this.validateElms(f, 'textarea');
107
108 return c == 3;
109 },
110
111 invalidate : function(n) {
112 this.mark(n.form, n);
113 },
114
115 getErrorMessages : function(f) {
116 var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
117 nl = this.tags(f, "label");
118 for (i=0; i<nl.length; i++) {
119 if (this.hasClass(nl[i], s.invalid_cls)) {
120 field = document.getElementById(nl[i].getAttribute("for"));
121 values = { field: nl[i].textContent };
122 if (this.hasClass(field, s.min_cls, true)) {
123 message = ed.getLang('invalid_data_min');
124 values.min = this.getNum(field, s.min_cls);
125 } else if (this.hasClass(field, s.number_cls)) {
126 message = ed.getLang('invalid_data_number');
127 } else if (this.hasClass(field, s.size_cls)) {
128 message = ed.getLang('invalid_data_size');
129 } else {
130 message = ed.getLang('invalid_data');
131 }
132
133 message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
134 return values[b] || '{#' + b + '}';
135 });
136 messages.push(message);
137 }
138 }
139 return messages;
140 },
141
142 reset : function(e) {
143 var t = ['label', 'input', 'select', 'textarea'];
144 var i, j, nl, s = this.settings;
145
146 if (e == null)
147 return;
148
149 for (i=0; i<t.length; i++) {
150 nl = this.tags(e.form ? e.form : e, t[i]);
151 for (j=0; j<nl.length; j++) {
152 this.removeClass(nl[j], s.invalid_cls);
153 nl[j].setAttribute('aria-invalid', false);
154 }
155 }
156 },
157
158 validateElms : function(f, e) {
159 var nl, i, n, s = this.settings, st = true, va = Validator, v;
160
161 nl = this.tags(f, e);
162 for (i=0; i<nl.length; i++) {
163 n = nl[i];
164
165 this.removeClass(n, s.invalid_cls);
166
167 if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
168 st = this.mark(f, n);
169
170 if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
171 st = this.mark(f, n);
172
173 if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
174 st = this.mark(f, n);
175
176 if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
177 st = this.mark(f, n);
178
179 if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
180 st = this.mark(f, n);
181
182 if (this.hasClass(n, s.size_cls) && !va.isSize(n))
183 st = this.mark(f, n);
184
185 if (this.hasClass(n, s.id_cls) && !va.isId(n))
186 st = this.mark(f, n);
187
188 if (this.hasClass(n, s.min_cls, true)) {
189 v = this.getNum(n, s.min_cls);
190
191 if (isNaN(v) || parseInt(n.value) < parseInt(v))
192 st = this.mark(f, n);
193 }
194
195 if (this.hasClass(n, s.max_cls, true)) {
196 v = this.getNum(n, s.max_cls);
197
198 if (isNaN(v) || parseInt(n.value) > parseInt(v))
199 st = this.mark(f, n);
200 }
201 }
202
203 return st;
204 },
205
206 hasClass : function(n, c, d) {
207 return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
208 },
209
210 getNum : function(n, c) {
211 c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
212 c = c.replace(/[^0-9]/g, '');
213
214 return c;
215 },
216
217 addClass : function(n, c, b) {
218 var o = this.removeClass(n, c);
219 n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
220 },
221
222 removeClass : function(n, c) {
223 c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
224 return n.className = c != ' ' ? c : '';
225 },
226
227 tags : function(f, s) {
228 return f.getElementsByTagName(s);
229 },
230
231 mark : function(f, n) {
232 var s = this.settings;
233
234 this.addClass(n, s.invalid_cls);
235 n.setAttribute('aria-invalid', 'true');
236 this.markLabels(f, n, s.invalid_cls);
237
238 return false;
239 },
240
241 markLabels : function(f, n, ic) {
242 var nl, i;
243
244 nl = this.tags(f, "label");
245 for (i=0; i<nl.length; i++) {
246 if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
247 this.addClass(nl[i], ic);
248 }
249
250 return null;
251 }
252};
  
1tinymce.PluginManager.add("contextmenu",function(e){var t;e.on("contextmenu",function(n){var r;if(n.preventDefault(),r=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var i=[];tinymce.each(r.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var o=0;i.length>o;o++)"|"==i[o].text&&(0===o||o==i.length-1)&&i.splice(o,1);t=new tinymce.ui.Menu({items:i,context:"contextmenu"}),t.renderTo(document.body)}var a=tinymce.DOM.getPos(e.getContentAreaContainer());a.x+=n.clientX,a.y+=n.clientY,t.moveTo(a.x,a.y),e.on("remove",function(){t.remove(),t=null})})});
  
1tinymce.PluginManager.add("directionality",function(e){function t(t){var n,r=e.dom,i=e.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),tinymce.each(i,function(e){r.getParent(e.parentNode,"*[dir='"+t+"']",r.getRoot())||(n!=t?r.setAttrib(e,"dir",t):r.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})});
  
1tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='<table role="presentation" class="mce-grid">',tinymce.each(r,function(n){e+="<tr>",tinymce.each(n,function(n){var r=t+"/img/smiley-"+n+".gif";e+='<td><a href="#" data-mce-url="'+r+'" tabindex="-1"><img src="'+r+'" style="width: 18px; height: 18px"></a></td>'}),e+="</tr>"}),e+="</table>"}var r=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent('<img src="'+n.getAttribute("data-mce-url")+'" />'),this.hide())}},tooltip:"Emoticons"})});
  
1tinymce.PluginManager.add("example",function(){});
  
1tinymce.PluginManager.add("example_dependency",function(){},["example"]);
  
1tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){r(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,r,o=i(),a={};return a.fontface=e.getParam("fullpage_default_fontface",""),a.fontsize=e.getParam("fullpage_default_fontsize",""),n=o.firstChild,7==n.type&&(a.xml_pi=!0,r=/encoding="([^"]+)"/.exec(n.value),r&&(a.docencoding=r[1])),n=o.getAll("#doctype")[0],n&&(a.doctype="<!DOCTYPE"+n.value+">"),n=o.getAll("title")[0],n&&n.firstChild&&(a.title=n.firstChild.value),u(o.getAll("meta"),function(e){var t,n=e.attr("name"),r=e.attr("http-equiv");n?a[n.toLowerCase()]=e.attr("content"):"Content-Type"==r&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(a.docencoding=t[1]))}),n=o.getAll("html")[0],n&&(a.langcode=t(n,"lang")||t(n,"xml:lang")),n=o.getAll("link")[0],n&&"stylesheet"==n.attr("rel")&&(a.stylesheet=n.attr("href")),n=o.getAll("body")[0],n&&(a.langdir=t(n,"dir"),a.style=t(n,"style"),a.visited_color=t(n,"vlink"),a.link_color=t(n,"link"),a.active_color=t(n,"alink")),a}function r(t){function n(e,t,n){e.attr(t,n?n:void 0)}function r(e){a.firstChild?a.insert(e,a.firstChild):a.append(e)}var o,a,s,c,f,p=e.dom;o=i(),a=o.getAll("head")[0],a||(c=o.getAll("html")[0],a=new d("head",1),c.firstChild?c.insert(a,c.firstChild,!0):c.append(a)),c=o.firstChild,t.xml_pi?(f='version="1.0"',t.docencoding&&(f+=' encoding="'+t.docencoding+'"'),7!=c.type&&(c=new d("xml",7),o.insert(c,o.firstChild,!0)),c.value=f):c&&7==c.type&&c.remove(),c=o.getAll("#doctype")[0],t.doctype?(c||(c=new d("#doctype",10),t.xml_pi?o.insert(c,o.firstChild):r(c)),c.value=t.doctype.substring(9,t.doctype.length-1)):c&&c.remove(),t.docencoding&&(c=null,u(o.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(c=e)}),c||(c=new d("meta",1),c.attr("http-equiv","Content-Type"),c.shortEnded=!0,r(c)),c.attr("content","text/html; charset="+t.docencoding)),c=o.getAll("title")[0],t.title?c||(c=new d("title",1),c.append(new d("#text",3)).value=t.title,r(c)):c&&c.remove(),u("keywords,description,author,copyright,robots".split(","),function(e){var n,i,a=o.getAll("meta"),s=t[e];for(n=0;a.length>n;n++)if(i=a[n],i.attr("name")==e)return s?i.attr("content",s):i.remove(),void 0;s&&(c=new d("meta",1),c.attr("name",e),c.attr("content",s),c.shortEnded=!0,r(c))}),c=o.getAll("link")[0],c&&"stylesheet"==c.attr("rel")?t.stylesheet?c.attr("href",t.stylesheet):c.remove():t.stylesheet&&(c=new d("link",1),c.attr({rel:"stylesheet",text:"text/css",href:t.stylesheet}),c.shortEnded=!0,r(c)),c=o.getAll("body")[0],c&&(n(c,"dir",t.langdir),n(c,"style",t.style),n(c,"vlink",t.visited_color),n(c,"link",t.link_color),n(c,"alink",t.active_color),p.setAttribs(e.getBody(),{style:t.style,dir:t.dir,vLink:t.visited_color,link:t.link_color,aLink:t.active_color})),c=o.getAll("html")[0],c&&(n(c,"lang",t.langcode),n(c,"xml:lang",t.langcode)),a.firstChild||a.remove(),s=new tinymce.html.Serializer({validate:!1,indent:!0,apply_source_formatting:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(o),l=s.substring(0,s.indexOf("</body>"))}function i(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(l)}function o(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var r,o,s,d,f=t.content,p="",m=e.dom;"raw"==t.format&&l||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(f=f.replace(/<(\/?)BODY/gi,"<$1body"),r=f.indexOf("<body"),-1!=r?(r=f.indexOf(">",r),l=n(f.substring(0,r+1)),o=f.indexOf("</body",r),-1==o&&(o=f.length),t.content=f.substring(r+1,o),c=n(f.substring(o))):(l=a(),c="\n</body>\n</html>"),s=i(),u(s.getAll("style"),function(e){e.firstChild&&(p+=e.firstChild.value)}),d=s.getAll("body")[0],d&&m.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),m.remove("fullpage_styles"),p&&(m.add(e.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},p),d=m.get("fullpage_styles"),d.styleSheet&&(d.styleSheet.cssText=p)))}function a(){var t,n="",r="";return e.getParam("fullpage_default_xml_pi")&&(n+='<?xml version="1.0" encoding="'+e.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),n+=e.getParam("fullpage_default_doctype","<!DOCTYPE html>"),n+="\n<html>\n<head>\n",(t=e.getParam("fullpage_default_title"))&&(n+="<title>"+t+"</title>\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=e.getParam("fullpage_default_font_family"))&&(r+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(r+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(r+="color: "+t+";"),n+="</head>\n<body"+(r?' style="'+r+'"':"")+">\n"}function s(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(l)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(c))}var l,c,u=tinymce.each,d=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",o),e.on("GetContent",s)});
  
1tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,r=document,i=r.body;return i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){s.setStyle(c,"height",t().h-(l.clientHeight-c.clientHeight))}var l,c,u,d=document.body,f=document.documentElement;a=!a,l=e.getContainer().firstChild,c=e.getContentAreaContainer().firstChild,u=c.style,a?(i=u.width,o=u.height,r=l.clientHeight-c.clientHeight,u.width=u.height="100%",s.addClass(d,"mce-fullscreen"),s.addClass(f,"mce-fullscreen"),s.addClass(l,"mce-fullscreen"),s.bind(window,"resize",n),n()):(u.width=i,u.height=o,s.removeClass(d,"mce-fullscreen"),s.removeClass(f,"mce-fullscreen"),s.removeClass(l,"mce-fullscreen"),s.unbind(window,"resize",n)),e.fire("FullscreenStateChanged",{state:a})}var r,i,o,a=!1,s=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return a}}});
  
1tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Insert horizontal ruler",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
  
1tinymce.PluginManager.add("image",function(e){function t(){function t(){var t=[{text:"None",value:""}];return tinymce.each(e.settings.image_list,function(e){t.push({text:e.text||e.title,value:e.value||e.url,menu:e.menu})}),t}function n(e){var t,n,i,s;t=r.find("#width")[0],n=r.find("#height")[0],i=t.value(),s=n.value(),r.find("#constrain")[0].checked()&&o&&a&&i&&s&&(e.control==t?(s=Math.round(i/o*s),n.value(s)):(i=Math.round(s/a*i),t.value(i))),o=i,a=s}var r,i,o,a,s,l=e.dom,c=e.selection.getNode();o=l.getAttrib(c,"width"),a=l.getAttrib(c,"height"),"IMG"!=c.nodeName||c.getAttribute("data-mce-object")?c=null:i={src:l.getAttrib(c,"src"),alt:l.getAttrib(c,"alt"),width:o,height:a},e.settings.image_list&&(s={name:"target",type:"listbox",label:"Image list",values:t(),onselect:function(e){var t=r.find("#alt");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),r.find("#src").value(e.control.value())}}),r=e.windowManager.open({title:"Edit image",data:i,body:[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0},s,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:n},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:n},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}],onSubmit:function(t){var n=t.data;""===n.width&&delete n.width,""===n.height&&delete n.height,c?l.setAttribs(c,n):e.insertContent(l.createHTML("img",n))}})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:t,stateSelector:"img:not([data-mce-object])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:t,context:"insert",prependToContext:!0})});
  
1tinymce.PluginManager.add("insertdatetime",function(e){function t(t,n){function s(e,t){if(e=""+e,t>e.length)for(var n=0;t-e.length>n;n++)e="0"+e;return e}return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",s(n.getMonth()+1,2)),t=t.replace("%d",s(n.getDate(),2)),t=t.replace("%H",""+s(n.getHours(),2)),t=t.replace("%M",""+s(n.getMinutes(),2)),t=t.replace("%S",""+s(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(12>n.getHours()?"AM":"PM")),t=t.replace("%B",""+e.translate(a[n.getMonth()])),t=t.replace("%b",""+e.translate(o[n.getMonth()])),t=t.replace("%A",""+e.translate(i[n.getDay()])),t=t.replace("%a",""+e.translate(r[n.getDay()])),t=t.replace("%%","%")}var n,r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),a="January February March April May June July August September October November December".split(" "),s=[];e.addCommand("mceInsertDate",function(){var n=t(e.getParam("plugin_insertdate_dateFormat",e.translate("%Y-%m-%d")));e.execCommand("mceInsertContent",!1,n)}),e.addCommand("mceInsertTime",function(){var n=t(e.getParam("plugin_insertdate_timeFormat",e.translate("%H:%M:%S")));e.execCommand("mceInsertContent",!1,n)}),e.addButton("inserttime",{type:"splitbutton",title:"Insert time",onclick:function(){e.insertContent(t(n||"%H:%M:%S"))},menu:s}),tinymce.each(["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(r){s.push({text:t(r),onclick:function(){n=r,e.insertContent(t(r))}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:s,context:"insert"})});
  
1tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function r(n){var r,i,o=[],a=t(e.selection.getNode()),s=-1,l=-1;for(i=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&i.push(e)},"childNodes"),r=0;i.length>r;r++)o[r]=i[r].style.zIndex?parseInt(i[r].style.zIndex,10):0,0>s&&i[r]==a&&(s=r);if(0>n){for(r=0;o.length>r;r++)if(o[r]<o[s]){l=r;break}l>-1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):o[s]>0&&(i[s].style.zIndex=o[s]-1)}else{for(r=0;o.length>r;r++)if(o[r]>o[s]){l=r;break}l>-1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):i[s].style.zIndex=o[s]+1}e.execCommand("mceRepaint")}function i(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),r=e.getBody();e.dom.add(r,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(r,r.innerHTML)}function o(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",i),e.addCommand("mceMoveForward",function(){r(1)}),e.addCommand("mceMoveBackward",function(){r(-1)}),e.addCommand("mceMakeAbsolute",function(){o()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var r=t(n.target);r&&e.dom.setAttrib(r,"data-mce-style","")}),e.on("mousedown",function(n){var r,i=n.target,o=e.getDoc();tinymce.Env.gecko&&(t(i)?"on"!==o.designMode&&(o.designMode="on",i=o.body,r=i.parentNode,r.removeChild(i),r.appendChild(i)):"on"==o.designMode&&(o.designMode="off"))}),e.on("NodeChange",n)});
  
1(function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",r=e.explode(t.settings.font_size_style_values),i=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(r,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){i.addValidElements(e+"[*]")}),i.getElementRule("font")||i.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=i.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})})(tinymce);
  
1tinymce.PluginManager.add("link",function(e){function t(){function t(){var t=[{text:"None",value:""}];return tinymce.each(e.settings.link_list,function(e){t.push({text:e.text||e.title,value:e.value||e.url,menu:e.menu})}),t}function n(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[{text:"None",value:""}];return e.settings.target_list||n.push({text:"New window",value:"_blank"}),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function i(){s||0!==f.text.length||this.parent().parent().find("#text")[0].value(this.value())}var o,a,s,l,c,u,d,f={},p=e.selection,h=e.dom;o=p.getNode(),a=h.getParent(o,"a[href]"),a&&p.select(a),f.text=s=p.getContent({format:"text"}),f.href=a?h.getAttrib(a,"href"):"",f.target=a?h.getAttrib(a,"target"):"",f.rel=a?h.getAttrib(a,"rel"):"","IMG"==o.nodeName&&(f.text=s=" "),e.settings.link_list&&(c={type:"listbox",label:"Link list",values:t(),onselect:function(e){var t=l.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),l.find("#href").value(e.control.value())}}),e.settings.target_list!==!1&&(d={name:"target",type:"listbox",label:"Target",values:r(f.target)}),e.settings.rel_list&&(u={name:"rel",type:"listbox",label:"Rel",values:n(f.rel)}),l=e.windowManager.open({title:"Insert link",data:f,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:i,onkeyup:i},{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){f.text=this.value()}},c,u,d],onSubmit:function(t){var n=t.data;return n.href?(n.text!=s?a?(e.focus(),a.innerHTML=n.text,h.setAttribs(a,{href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null}),p.select(a)):e.insertContent(h.createHTML("a",{href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null},n.text)):e.execCommand("mceInsertLink",!1,{href:n.href,target:n.target,rel:n.rel?n.rel:null}),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t,stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link(s)",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t),this.showDialog=t,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t,stateSelector:"a[href]",context:"insert",prependToContext:!0})});
  
1tinymce.PluginManager.add("lists",function(e){var t=this;e.on("init",function(){function n(e){function t(t){var r,i,o;i=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],1==i.nodeType&&(r=b.create("span",{"data-mce-type":"bookmark"}),i.hasChildNodes()?(o=Math.min(o,i.childNodes.length-1),i.insertBefore(r,i.childNodes[o])):i.appendChild(r),i=r,o=0),n[t?"startContainer":"endContainer"]=i,n[t?"startOffset":"endOffset"]=o}var n={};return t(!0),t(),n}function r(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,i,o;r=o=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],1==r.nodeType&&(t?(i=n(r),r=r.parentNode):(i=n(r),r=r.parentNode),b.remove(o)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=i}t(!0),t();var n=b.createRng();n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),C.setRng(n)}function i(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function o(e){return e.parentNode.firstChild==e}function a(e){return e.parentNode.lastChild==e}function s(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}function l(t,n){var r,i;if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),i=n?b.create(n):b.createFragment(),t)for(;r=t.firstChild;)i.appendChild(r);return e.settings.forced_root_block||i.appendChild(b.create("br")),i.hasChildNodes()||tinymce.isIE||(i.innerHTML='<br data-mce-bogus="1">'),i}function c(){return tinymce.grep(C.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function u(){return tinymce.grep(C.getSelectedBlocks(),s)}function d(e,t,n){var r,i;n=n||l(t),r=b.createRng(),r.setStartAfter(t),r.setEndAfter(e),i=r.extractContents(),b.isEmpty(i)||b.insertAfter(i,e),b.isEmpty(n)||b.insertAfter(n,e),b.isEmpty(t.parentNode)&&b.remove(t.parentNode),b.remove(t)}function f(e){var t,n;if(t=e.nextSibling,t&&i(t)&&t.nodeName==e.nodeName){for(;n=t.firstChild;)e.appendChild(n);b.remove(t)}if(t=e.previousSibling,t&&i(t)&&t.nodeName==e.nodeName){for(;n=t.firstChild;)e.insertBefore(n,e.firstChild);b.remove(t)}}function m(e){tinymce.each(tinymce.grep(b.select("ol,ul",e)),function(e){var t,n=e.parentNode;"LI"==n.nodeName&&n.firstChild==e&&(t=n.previousSibling,t&&"LI"==t.nodeName&&(t.appendChild(e),b.isEmpty(n)&&b.remove(n))),i(n)&&(t=n.previousSibling,t&&"LI"==t.nodeName&&t.appendChild(e))})}function p(){var e,t=n(C.getRng(!0));return tinymce.each(c(),function(t){var n,r;return n=t.previousSibling,n&&"UL"==n.nodeName?(n.appendChild(t),void 0):n&&"LI"==n.nodeName&&i(n.lastChild)?(n.lastChild.appendChild(t),void 0):(n=t.nextSibling,n&&"UL"==n.nodeName?(n.insertBefore(t,n.firstChild),void 0):(n&&"LI"==n.nodeName&&i(t.lastChild)||(n=t.previousSibling,n&&"LI"==n.nodeName&&(r=b.create(t.parentNode.nodeName),n.appendChild(r),r.appendChild(t)),e=!0),void 0))}),r(t),e}function h(){var e,t=n(C.getRng(!0));return tinymce.each(c(),function(t){var n,r=t.parentNode,s=r.parentNode;if(o(t)&&a(t))if("LI"==s.nodeName)b.insertAfter(t,s);else{if(!i(s))return;b.remove(r,!0)}else if(o(t))if("LI"==s.nodeName)b.insertAfter(t,s),n=b.create("LI"),n.appendChild(r),b.insertAfter(n,t);else{if(!i(s))return;s.insertBefore(t,r)}else if(a(t))if("LI"==s.nodeName)b.insertAfter(t,s);else{if(!i(s))return;b.insertAfter(t,r)}else{if("LI"==s.nodeName)r=s,n=l(t,"LI");else{if(!i(s))return;n=l(t,"LI")}d(r,t,n),m(r.parentNode)}e=!0}),r(t),e}function g(t){function o(){function t(t){var n,r,i=e.getBody();for(n=a[t?"startContainer":"endContainer"],r=a[t?"startOffset":"endOffset"],1==n.nodeType&&(n=n.childNodes[Math.min(r,n.childNodes.length-1)]||n);n.parentNode!=i;){if(s(n))return n;if(/^(TD|TH)$/.test(n.parentNode.nodeName))return n;n=n.parentNode}return n}function n(e,t){var n,r=[];if(!s(e)){for(;e&&(n=e[t?"previousSibling":"nextSibling"],!b.isBlock(n)&&n);)e=n;for(;e;)r.push(e),e=e[t?"nextSibling":"previousSibling"]}return r}var r,i,o=t(!0),l=t();i=n(o,!0),o!=l&&(i=i.concat(n(l).reverse())),tinymce.each(i,function(e){if(!b.isBlock(e)||"BR"==e.nodeName){if(!r||"BR"==e.nodeName){if("BR"==e.nodeName&&(!e.nextSibling||b.isBlock(e.nextSibling)&&"BR"!=e.nextSibling.nodeName))return b.remove(e),!1;r=b.create("p"),c.push(r),e.parentNode.insertBefore(r,e)}return"BR"!=e.nodeName?r.appendChild(e):b.remove(e),e==l?!1:void 0}})}var a=C.getRng(!0),l=n(a),c=u();o(),tinymce.each(c,function(e){var n,r;r=e.previousSibling,r&&i(r)&&r.nodeName==t?(n=r,e=b.rename(e,"LI"),r.appendChild(e)):(n=b.create(t),e.parentNode.insertBefore(n,e),n.appendChild(e),e=b.rename(e,"LI")),f(n)}),r(l)}function v(){var e=n(C.getRng(!0));tinymce.each(c(),function(e){var t,n;for(t=e;t;t=t.parentNode)i(t)&&(n=t);d(n,e)}),r(e)}function y(e){var t=b.getParent(C.getStart(),"OL,UL");if(t)if(t.nodeName==e)v(e);else{var i=n(C.getRng(!0));f(b.rename(t,e)),r(i)}else g(e)}var b=e.dom,C=e.selection;t.backspaceDelete=function(e){function t(e,t){var n=e.startContainer,r=e.startOffset;if(3==n.nodeType&&(t?n.data.length>r:r>0))return n;for(var i=new tinymce.dom.TreeWalker(e.startContainer);n=i[t?"next":"prev"]();)if(3==n.nodeType&&n.data.length>0)return n}function o(e,t){var n,r,o=e.parentNode;for(i(t.lastChild)&&(r=t.lastChild),n=t.lastChild,n&&"BR"==n.nodeName&&e.hasChildNodes()&&b.remove(n);n=e.firstChild;)t.appendChild(n);r&&t.appendChild(r),b.remove(e),b.isEmpty(o)&&b.remove(o)}if(C.isCollapsed()){var a=b.getParent(C.getStart(),"LI");if(a){var s=C.getRng(!0),l=b.getParent(t(s,e),"LI");if(l&&l!=a){var c=n(s);return e?o(l,a):o(a,l),r(c),!0}if(!l&&!e&&v(a.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return p()?void 0:!0}),e.addCommand("Outdent",function(){return h()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")})}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?t.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&t.backspaceDelete(!0)&&e.preventDefault()})});
  
1tinymce.PluginManager.add("media",function(e,t){function n(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":""}function r(){function t(e){var t,i,o,a;t=n.find("#width")[0],i=n.find("#height")[0],o=t.value(),a=i.value(),n.find("#constrain")[0].checked()&&r&&l&&o&&a&&(e.control==t?(a=Math.round(o/r*a),i.value(a)):(o=Math.round(a/l*o),t.value(o))),r=o,l=a}var n,r,l,c;c=s(e.selection.getNode()),r=c.width,l=c.height,n=e.windowManager.open({title:"Insert/edit video",data:c,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){this.fromJSON(a(this.next().find("#embed").value()))},items:[{name:"source1",type:"filepicker",filetype:"image",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"image",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(o(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:"},{type:"textbox",flex:1,name:"embed",value:i(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(o(this.toJSON()))}})}function i(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function o(r){var i="";return r.source1||(tinymce.extend(r,a(r.embed)),r.source1)?(r.source1=e.convertURL(r.source1,"source"),r.source2=e.convertURL(r.source2,"source"),r.source1mime=n(r.source1),r.source2mime=n(r.source2),r.poster=e.convertURL(r.poster,"poster"),r.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),r.embed?i=l(r.embed,r,!0):(tinymce.each(c,function(e){var t,n,i;if(t=e.regex.exec(r.source1)){for(i=e.url,n=0;t[n];n++)i=i.replace("$"+n,function(){return t[n]});r.source1=i,r.type=e.type,r.width=e.w,r.height=e.h}}),r.width=r.width||300,r.height=r.height||150,tinymce.each(r,function(t,n){r[n]=e.dom.encode(t)}),"iframe"==r.type?i+='<iframe src="'+r.source1+'" width="'+r.width+'" height="'+r.height+'"></iframe>':-1!=r.source1mime.indexOf("audio")?e.settings.audio_template_callback?i=e.settings.audio_template_callback(r):i+='<audio controls="controls" src="'+r.source1+'">'+(r.source2?'\n<source src="'+r.source2+'"'+(r.source2mime?' type="'+r.source2mime+'"':"")+" />\n":"")+"</audio>":i=e.settings.video_template_callback?e.settings.video_template_callback(r):'<video width="'+r.width+'" height="'+r.height+'"'+(r.poster?' poster="'+r.poster+'"':"")+' controls="controls">\n'+'<source src="'+r.source1+'"'+(r.source1mime?' type="'+r.source1mime+'"':"")+" />\n"+(r.source2?'<source src="'+r.source2+'"'+(r.source2mime?' type="'+r.source2mime+'"':"")+" />\n":"")+"</video>"),i):""}function a(e){var t={};return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",start:function(e,n){t.source1||"param"!=e||(t.source1=n.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t=tinymce.extend(n.map,t)),"source"==e&&(t.source1?t.source2||(t.source2=n.map.src):t.source1=n.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?a(e.serializer.serialize(t,{selection:!0})):{}}function l(e,t,n){function r(e,t){var n,r,i,o;for(n in t)if(i=""+t[n],e.map[n])for(r=e.length;r--;)o=e[r],o.name==n&&(i?(e.map[n]=i,o.value=i):(delete e.map[n],e.splice(r,1)));else i&&(e.push({name:n,value:i}),e.map[n]=i)}var i=new tinymce.html.Writer,o=0;return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",comment:function(e){i.comment(e)},cdata:function(e){i.cdata(e)},text:function(e,t){i.text(e,t)},start:function(e,a,s){switch(e){case"video":case"object":case"img":case"iframe":r(a,{width:t.width,height:t.height})}if(n)switch(e){case"video":r(a,{poster:t.poster,src:""}),t.source2&&r(a,{src:""});break;case"iframe":r(a,{src:t.source1});break;case"source":if(o++,2>=o&&(r(a,{src:t["source"+o],type:t["source"+o+"mime"]}),!t["source"+o]))return}i.start(e,a,s)},end:function(e){if("video"==e&&n)for(var a=1;2>=a;a++)if(t["source"+a]){var s=[];s.map={},a>o&&(r(s,{src:t["source"+a],type:t["source"+a+"mime"]}),i.start("source",s,!0))}i.end(e)}},new tinymce.html.Schema({})).parse(e),i.getContent()}var c=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=RegExp("</"+e+"[^>]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var n=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){n[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed",function(t,n){for(var r,i,o,a,s,l,c,u=t.length;u--;){for(i=t[u],o=new tinymce.html.Node("img",1),o.shortEnded=!0,l=i.attributes,r=l.length;r--;)a=l[r].name,s=l[r].value,"width"!==a&&"height"!==a&&"style"!==a&&(("data"==a||"src"==a)&&(s=e.convertURL(s,a)),o.attr("data-mce-p-"+a,s));c=i.firstChild&&i.firstChild.value,c&&(o.attr("data-mce-html",escape(c)),o.firstChild=null),o.attr({width:i.attr("width")||"300",height:i.attr("height")||("audio"==n?"30":"150"),style:i.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),i.replace(o)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var n,r,i,o,a,s,l=e.length;l--;){for(n=e[l],r=new tinymce.html.Node(n.attr(t),1),"audio"!=n.attr(t)&&r.attr({width:n.attr("width"),height:n.attr("height")}),r.attr({style:n.attr("style")}),o=n.attributes,i=o.length;i--;){var c=o[i].name;0===c.indexOf("data-mce-p-")&&r.attr(c.substr(11),o[i].value)}a=n.attr("data-mce-html"),a&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(a),r.append(s)),n.replace(r)}})}),e.on("ObjectSelected",function(e){"audio"==e.target.getAttribute("data-mce-object")&&e.preventDefault()}),e.on("objectResized",function(e){var t,n=e.target;n.getAttribute("data-mce-object")&&(t=n.getAttribute("data-mce-html"),t&&(t=unescape(t),n.setAttribute("data-mce-html",escape(l(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:r,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:r,context:"insert",prependToContext:!0})});
  
1tinymce.PluginManager.add("nonbreaking",function(e){e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?'<span data-mce-bogus="1" class="mce-nbsp">&nbsp;</span>':"&nbsp;")}),e.addButton("nonbreaking",{title:"Insert nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),e.getParam("nonbreaking_force_tab")&&e.on("keydown",function(t){9==t.keyCode&&(t.preventDefault(),e.execCommand("mceNonBreaking"),e.execCommand("mceNonBreaking"),e.execCommand("mceNonBreaking"))})});
  
1tinymce.PluginManager.add("noneditable",function(e){function t(){function t(e){var t;if(1===e.nodeType){if(t=e.getAttribute(l),t&&"inherit"!==t)return t;if(t=e.contentEditable,"inherit"!==t)return t}return null}function n(e){for(var n;e;){if(n=t(e))return"false"===n?e:null;e=e.parentNode}}function r(e){for(;e;){if(e.id===p)return e;e=e.parentNode}}function i(e){var t;if(e)for(t=new a(e,e),e=t.current();e;e=t.next())if(3===e.nodeType)return e}function o(n,r){var i,o;return"false"===t(n)&&f.isBlock(n)?(m.select(n),void 0):(o=f.createRng(),"true"===t(n)&&(n.firstChild||n.appendChild(e.getDoc().createTextNode(" ")),n=n.firstChild,r=!0),i=f.create("span",{id:p,"data-mce-bogus":!0},h),r?n.parentNode.insertBefore(i,n):f.insertAfter(i,n),o.setStart(i.firstChild,1),o.collapse(!0),m.setRng(o),i)}function s(e){var t,n,o,a;if(e)t=m.getRng(!0),t.setStartBefore(e),t.setEndBefore(e),n=i(e),n&&n.nodeValue.charAt(0)==h&&(n=n.deleteData(0,1)),f.remove(e,!0),m.setRng(t);else for(o=r(m.getStart());(e=f.get(p))&&e!==a;)o!==e&&(n=i(e),n&&n.nodeValue.charAt(0)==h&&(n=n.deleteData(0,1)),f.remove(e,!0)),a=e}function u(){function e(e,n){var r,i,o,s,l;if(r=c.startContainer,i=c.startOffset,3==r.nodeType){if(l=r.nodeValue.length,i>0&&l>i||(n?i==l:0===i))return}else{if(!(r.childNodes.length>i))return n?null:e;var u=!n&&i>0?i-1:i;r=r.childNodes[u],r.hasChildNodes()&&(r=r.firstChild)}for(o=new a(r,e);s=o[n?"prev":"next"]();){if(3===s.nodeType&&s.nodeValue.length>0)return;if("true"===t(s))return s}return e}var r,i,l,c,u;s(),l=m.isCollapsed(),r=n(m.getStart()),i=n(m.getEnd()),(r||i)&&(c=m.getRng(!0),l?(r=r||i,(u=e(r,!0))?o(u,!0):(u=e(r,!1))?o(u,!1):m.select(r)):(c=m.getRng(!0),r&&c.setStartBefore(r),i&&c.setEndAfter(i),m.setRng(c)))}function d(i){function o(e,t){for(;e=e[t?"previousSibling":"nextSibling"];)if(3!==e.nodeType||e.nodeValue.length>0)return e}function l(e,t){m.select(e),m.collapse(t)}function d(i){function o(e){for(var t=l;t;){if(t===e)return;t=t.parentNode}f.remove(e),u()}function a(){var r,a,s=e.schema.getNonEmptyElements();for(a=new tinymce.dom.TreeWalker(l,e.getBody());(r=i?a.prev():a.next())&&!s[r.nodeName.toLowerCase()]&&!(3===r.nodeType&&tinymce.trim(r.nodeValue).length>0);)if("false"===t(r))return o(r),!0;return n(r)?!0:!1}var s,l,c,d;if(m.isCollapsed()){if(s=m.getRng(!0),l=s.startContainer,c=s.startOffset,l=r(l)||l,d=n(l))return o(d),!1;if(3==l.nodeType&&(i?c>0:l.nodeValue.length>c))return!0;if(1==l.nodeType&&(l=l.childNodes[c]||l),a())return!1}return!0}var p,h,g,v,y=i.keyCode;if(g=m.getStart(),v=m.getEnd(),p=n(g)||n(v),p&&(112>y||y>124)&&y!=c.DELETE&&y!=c.BACKSPACE){if((tinymce.isMac?i.metaKey:i.ctrlKey)&&(67==y||88==y||86==y))return;if(i.preventDefault(),y==c.LEFT||y==c.RIGHT){var b=y==c.LEFT;if(e.dom.isBlock(p)){var C=b?p.previousSibling:p.nextSibling,x=new a(C,C),w=b?x.prev():x.next();l(w,!b)}else l(p,b)}}else if(y==c.LEFT||y==c.RIGHT||y==c.BACKSPACE||y==c.DELETE){if(h=r(g)){if(y==c.LEFT||y==c.BACKSPACE)if(p=o(h,!0),p&&"false"===t(p)){if(i.preventDefault(),y!=c.LEFT)return f.remove(p),void 0;l(p,!0)}else s(h);if(y==c.RIGHT||y==c.DELETE)if(p=o(h),p&&"false"===t(p)){if(i.preventDefault(),y!=c.RIGHT)return f.remove(p),void 0;l(p,!1)}else s(h)}if((y==c.BACKSPACE||y==c.DELETE)&&!d(y==c.BACKSPACE))return i.preventDefault(),!1}}var f=e.dom,m=e.selection,p="mce_noneditablecaret",h="";e.on("mousedown",function(n){var r=e.selection.getNode();"false"===t(r)&&r==n.target&&u()}),e.on("mouseup keyup",u),e.on("keydown",d)}function n(t){var n=o.length,r=t.content,a=tinymce.trim(i);if("raw"!=t.format){for(;n--;)r=r.replace(o[n],function(t){var n=arguments,i=n[n.length-2];return i>0&&'"'==r.charAt(i-1)?t:'<span class="'+a+'" data-mce-content="'+e.dom.encode(n[0])+'">'+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"});t.content=r}}var r,i,o,a=tinymce.dom.TreeWalker,s="contenteditable",l="data-mce-"+s,c=tinymce.util.VK;r=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",i=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",o=e.getParam("noneditable_regexp"),o&&!o.length&&(o=[o]),e.on("PreInit",function(){t(),o&&e.on("BeforeSetContent",n),e.parser.addAttributeFilter("class",function(e){for(var t,n,o=e.length;o--;)n=e[o],t=" "+n.attr("class")+" ",-1!==t.indexOf(r)?n.attr(l,"true"):-1!==t.indexOf(i)&&n.attr(l,"false")}),e.serializer.addAttributeFilter(l,function(e){for(var t,n=e.length;n--;)t=e[n],o&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):(t.attr(s,null),t.attr(l,null))}),e.parser.addAttributeFilter(s,function(e){for(var t,n=e.length;n--;)t=e[n],t.attr(l,t.attr(s)),t.attr(s,null)})})});
  
1tinymce.PluginManager.add("pagebreak",function(e){var t,n="mce-pagebreak",r=e.getParam("pagebreak_separator","<!-- pagebreak -->"),i='<img src="'+tinymce.Env.transparentSrc+'" class="'+n+'" data-mce-resize="false" />';t=RegExp(r.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"g"),e.addCommand("mcePageBreak",function(){e.execCommand("mceInsertContent",0,i)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,n)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,n)&&e.selection.select(t)}),e.on("PreInit",function(){e.parser.addNodeFilter("#comment",function(e){for(var t,n,r=e.length;r--;)t=e[r],-1!==t.value.indexOf("pagebreak")&&(n=new tinymce.html.Node("img",1),n.attr({src:tinymce.Env.transparentSrc,"class":"mce-pagebreak","data-mce-resize":"false"}),t.replace(n))}),e.serializer.addNodeFilter("img",function(e){for(var t,n,r=e.length;r--;)t=e[r],n=t.attr("class"),n&&-1!==n.indexOf("mce-pagebreak")&&(t.type=8,t.value="pagebreak")})})});
  
1(function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;e.length>i;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;r.length>i;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;n.length>r;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Clipboard",c="tinymce/Env",u="tinymce/util/Tools",d="tinymce/util/VK",f="tinymce/pasteplugin/WordFilter",p="tinymce/html/DomParser",m="tinymce/html/Schema",h="tinymce/html/Serializer",g="tinymce/html/Node",v="tinymce/pasteplugin/Quirks",y="tinymce/pasteplugin/Plugin",b="tinymce/PluginManager";r(l,[c,u,d],function(e,n,r){function i(){return!e.gecko&&("ClipboardEvent"in window||e.webkit&&"FocusEvent"in window)}return function(o){function a(){return 100>(new Date).getTime()-f}function s(e,t){return n.each(t,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function l(t){var n=o.fire("PastePreProcess",{content:t});(o.settings.paste_remove_styles||o.settings.paste_remove_styles_if_webkit!==!1&&e.webkit)&&(n.content=n.content.replace(/ style=\"[^\"]+\"/g,"")),n.isDefaultPrevented()||o.insertContent(n.content)}function c(e){e=o.dom.encode(e),e=s(e,[[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]]);var t=o.fire("PastePreProcess",{content:e});t.isDefaultPrevented()||o.insertContent(t.content)}function u(){var e=(o.inline?o.getBody():o.getDoc().documentElement).scrollTop,t=o.dom.add(o.getBody(),"div",{id:"mcePasteBin",contentEditable:!1,style:"position: absolute; top: "+e+"px; left: 0; background: red; width: 1px; height: 1px; overflow: hidden"},'<div contentEditable="true">X</div>');return t}function d(){var e=o.dom.get("mcePasteBin");o.dom.unbind(e),o.dom.remove(e)}var f;o.on("keydown",function(e){e.shiftKey&&86==e.keyCode&&(f=(new Date).getTime())}),i()?o.on("paste",function(e){function t(e,t){for(var r=0;n.types.length>r;r++)if(n.types[r]==e)return t(n.getData(e)),!0}var n=e.clipboardData;n&&(e.preventDefault(),a()?t("text/plain",c)||t("text/html",l):t("text/html",l)||t("text/plain",c))}):e.ie?o.on("init",function(){var e=o.dom;o.dom.bind(o.getBody(),"paste",function(n){var r;if(n.preventDefault(),a()&&e.doc.dataTransfer)return c(e.doc.dataTransfer.getData("Text")),t;var i=u();e.bind(i,"paste",function(e){e.stopPropagation(),r=!0});var s=o.selection.getRng(),f=e.doc.body.createTextRange();if(f.moveToElementText(i.firstChild),f.execCommand("Paste"),d(),!r)return o.windowManager.alert("Clipboard access not possible."),t;var p=i.firstChild.innerHTML;o.selection.setRng(s),l(p)})}):(o.on("init",function(){o.dom.bind(o.getBody(),"paste",function(e){e.preventDefault(),o.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")})}),o.on("keydown",function(e){if(r.metaKeyPressed(e)&&86==e.keyCode&&!e.isDefaultPrevented()){var t=u(),n=o.selection.getRng();o.selection.select(t,!0),o.dom.bind(t,"paste",function(e){e.stopPropagation(),setTimeout(function(){d(),o.lastRng=n,o.selection.setRng(n),l(t.firstChild.innerHTML)},0)})}})),o.paste_block_drop&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),this.paste=l,this.pasteText=c}}),r(f,[u,p,m,h,g],function(e,n,r,i,o){return function(a){var s=e.each;a.on("PastePreProcess",function(l){function c(e){s(e,function(e){f=e.constructor==RegExp?f.replace(e,""):f.replace(e[0],e[1])})}function u(e){function t(e,t,a,s){var l=e._listLevel||i;l!=i&&(i>l?n&&(n=n.parent.parent):(r=n,n=null)),n&&n.name==a?n.append(e):(r=r||n,n=new o(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>i&&r.lastChild.append(n),i=l}for(var n,r,i=1,a=e.getAll("p"),s=0;a.length>s;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\./.test(l)){var u=/([0-9])\./.exec(l),d=1;u&&(d=parseInt(u[1],10)),t(e,c,"ol",d);continue}n=null}}function d(n,r){if("p"===n.name){var i=/mso-list:\w+ \w+([0-9]+)/.exec(r);i&&(n._listLevel=parseInt(i[1],10))}if(a.getParam("paste_retain_style_properties","none")){var o="";if(e.each(a.dom.parseStyle(r),function(e,n){switch(n){case"horiz-align":return n="text-align",t;case"vert-align":return n="vertical-align",t;case"font-color":case"mso-foreground":return n="color",t;case"mso-background":case"mso-highlight":n="background"}("all"==p||m&&m[n])&&(o+=n+":"+e+";")}),o)return o}return null}var f=l.content,p,m;if(p=a.settings.paste_retain_style_properties,p&&(m=e.makeMap(p)),a.settings.paste_enable_default_filters!==!1&&/class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(l.content)){l.wordContent=!0,c([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\u00a0"):""}]]);var h=new r({valid_elements:"@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href]"}),g=new n({},h);g.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",d(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()});var v=g.parse(f);u(v),l.content=new i({},h).serialize(v)}})}}),r(v,[c,u],function(e,t){return function(n){function r(e){n.on("PastePreProcess",function(t){t.content=e(t.content)})}function i(e,n){return t.each(n,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function o(e){return e=i(e,[/^[\s\S]*<!--StartFragment-->|<!--EndFragment-->[\s\S]*$/g,[/<span class="Apple-converted-space">\u00a0<\/span>/g,"\u00a0"],/<br>$/])}function a(e){if(!this.explorerBlocksRegExp){var r=[];t.each(n.schema.getBlockElements(),function(e,t){r.push(t)}),this.explorerBlocksRegExp=RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(</?("+r.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g")}return e=i(e,[[this.explorerBlocksRegExp,"$1"]]),e=i(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}e.webkit&&r(o),e.ie&&r(a)}}),r(y,[b,l,f,v],function(e,t,n,r){e.add("paste",function(e){var i=this;i.clipboard=new t(e),i.quirks=new r(e),i.wordFilter=new n(e),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&i.clipboard.paste(t.content),t.text&&i.clipboard.pasteText(t.text)})})}),a([l,f,v,y])})(this);
  
1tinymce.PluginManager.add("preview",function(e){e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"></iframe>',buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var t,n=this.getEl("body").firstChild.contentWindow.document,r="";tinymce.each(tinymce.explode(e.settings.content_css),function(t){r+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'}),t="<!DOCTYPE html><html><head>"+r+"</head>"+"<body>"+e.getContent()+"</body>"+"</html>",n.open(),n.write(t),n.close()}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
  
1tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){e.getWin().print()}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})});
  
1tinymce.PluginManager.add("save",function(e){function t(){var t,n;return t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty")||e.isDirty()?(tinymce.triggerSave(),(n=e.getParam("save_onsavecallback"))?(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged()),void 0):(t?(e.isNotDirty=!0,(!t.onsubmit||t.onsubmit())&&("function"==typeof t.submit?t.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."),void 0)):void 0}function n(){var t,n=tinymce.trim(e.startContent);return(t=e.getParam("save_oncancelcallback"))?(e.execCallback("save_oncancelcallback",e),void 0):(e.setContent(n),e.undoManager.clear(),e.nodeChanged(),void 0)}function r(){var t=this;e.on("nodeChange",function(){t.disabled(!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",n),e.addButton("save",{text:"Save",cmd:"mceSave",disabled:!0,onPostRender:r}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:r}),e.addShortcut("ctrl+s","","mceSave")});
  
1(function(){function e(e,t,n,r,i){function o(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var r=e[t];if(!r)throw"Invalid capture group";n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}function a(e){var t;if(3===e.nodeType)return e.data;if(m[e.nodeName])return"";if(t="",(f[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=a(e);while(e=e.nextSibling);return t}function s(e,t,n){var r,i,o,a,s=[],l=0,c=e,u=t.shift(),d=0;e:for(;;){if((f[c.nodeName]||p[c.nodeName])&&l++,3===c.nodeType&&(!i&&c.length+l>=u[1]?(i=c,a=u[1]-l):r&&s.push(c),!r&&c.length+l>u[0]&&(r=c,o=u[0]-l),l+=c.length),r&&i){if(c=n({startNode:r,startNodeIndex:o,endNode:i,endNodeIndex:a,innerNodes:s,match:u[2],matchIndex:d}),l-=i.length-a,r=null,i=null,s=[],u=t.shift(),d++,!u)break}else{if(!m[c.nodeName]&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function l(e){var t;if("function"!=typeof e){var n=e.nodeType?e:d.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(d.createTextNode(e)),r}}else t=e;return function(e){var n,r,i,o=e.startNode,a=e.endNode,s=e.matchIndex;if(o===a){var l=o;i=l.parentNode,e.startNodeIndex>0&&(n=d.createTextNode(l.data.substring(0,e.startNodeIndex)),i.insertBefore(n,l));var c=t(e.match[0],s);return i.insertBefore(c,l),e.endNodeIndex<l.length&&(r=d.createTextNode(l.data.substring(e.endNodeIndex)),i.insertBefore(r,l)),l.parentNode.removeChild(l),c}n=d.createTextNode(o.data.substring(0,e.startNodeIndex)),r=d.createTextNode(a.data.substring(e.endNodeIndex));for(var u=t(o.data.substring(e.startNodeIndex),s),f=[],m=0,p=e.innerNodes.length;p>m;++m){var h=e.innerNodes[m],g=t(h.data,s);h.parentNode.replaceChild(g,h),f.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return i=o.parentNode,i.insertBefore(n,o),i.insertBefore(u,o),i.removeChild(o),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}var c,u,d,f,m,p,h=[],g=0;if(d=t.ownerDocument,f=i.getBlockElements(),m=i.getWhiteSpaceElements(),p=i.getShortEndedElements(),u=a(t)){if(e.global)for(;c=e.exec(u);)h.push(o(c,r));else c=u.match(e),h.push(o(c,r));return h.length&&(g=h.length,s(t,h,l(n))),g}}function t(t){function n(){var e=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){t.focus(),a=!1,s.unmarkAllMatches()},buttons:[{text:"Find",onclick:function(){e.find("form")[0].submit()}},{text:"Replace",disabled:!0,onclick:function(){s.replace(e.find("#replace").value())||e.statusbar.items().slice(1).disabled(!0)}},{text:"Replace all",disabled:!0,onclick:function(){s.replaceAll(e.find("#replace").value()),e.statusbar.items().slice(1).disabled(!0)}},{type:"spacer",flex:1},{text:"Prev",disabled:!0,onclick:function(){s.prev()}},{text:"Next",disabled:!0,onclick:function(){s.next()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,onsubmit:function(t){var n,r,i,o,a;return t.preventDefault(),i=e.find("#case").checked(),a=e.find("#words").checked(),o=e.find("#find").value(),o.length?(o=o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),o=a?"\\b"+o+"\\b":o,r=RegExp(o,i?"g":"gi"),n=s.markAllMatches(r),n?s.first():tinymce.ui.MessageBox.alert("Could not find the specified string."),e.statusbar.items().slice(1).disabled(0===n),void 0):(s.unmarkAllMatches(),e.statusbar.items().slice(1).disabled(!0),void 0)},items:[{type:"textbox",name:"find",size:40,label:"Find",value:t.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow();a=!0}function r(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function i(e,n){function r(){var r,a;for(r=n?t.getBody()[e?"firstChild":"lastChild"]:s[e?"endContainer":"startContainer"],a=new tinymce.dom.TreeWalker(r,t.getBody());r=a.current();){if(1==r.nodeType&&"SPAN"==r.nodeName&&null!==r.getAttribute("data-mce-index"))for(l=r.getAttribute("data-mce-index"),i=r.firstChild;r=a.current();){if(1==r.nodeType&&"SPAN"==r.nodeName&&null!==r.getAttribute("data-mce-index")){if(r.getAttribute("data-mce-index")!==l)return;o=r.firstChild}a[e?"next":"prev"]()}a[e?"next":"prev"]()}}var i,o,a=t.selection,s=a.getRng(!0),l=-1;return e=e!==!1,r(),i&&o&&(t.focus(),e?(s.setStart(i,0),s.setEnd(o,o.length)):(s.setStart(o,0),s.setEnd(i,i.length)),a.scrollIntoView(i.parentNode),a.setRng(s)),l}function o(e){e.parentNode.removeChild(e)}var a,s=this,l=-1;s.init=function(e){e.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Ctrl+F",onclick:n,separator:"before",context:"edit"}),e.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Ctrl+F",onclick:n}),e.shortcuts.add("Ctrl+F","",n)},s.markAllMatches=function(n){var r,i;return i=t.dom.create("span",{"class":"mce-match-marker","data-mce-bogus":1}),r=t.getBody(),s.unmarkAllMatches(r),e(n,r,i,!1,t.schema)},s.first=function(){return l=i(!0,!0),-1!==l},s.next=function(){return l=i(!0),-1!==l},s.prev=function(){return l=i(!1),-1!==l},s.replace=function(e,n,a){var s,c,u,d,f,m;if(-1===l&&(l=i(n)),m=i(n),u=t.getBody(),c=tinymce.toArray(u.getElementsByTagName("span")),c.length)for(s=0;c.length>s;s++)if(d=f=c[s].getAttribute("data-mce-index"),a||d===l)for(e.length?(c[s].firstChild.nodeValue=e,r(c[s])):o(c[s]);c[++s];){if(d=c[s].getAttribute("data-mce-index"),d!==f){s--;break}o(c[s])}return-1==m&&(m=i(n,!0)),l=m,a&&t.selection.setCursorLocation(t.getBody(),0),t.undoManager.add(),-1!==l},s.replaceAll=function(e){s.replace(e,!0,!0)},s.unmarkAllMatches=function(){var e,n,i;for(i=t.getBody(),n=i.getElementsByTagName("span"),e=n.length;e--;)i=n[e],i.getAttribute("data-mce-index")&&r(i)},t.on("beforeaddundo keydown",function(e){return a?(e.preventDefault(),!1):void 0})}tinymce.PluginManager.add("searchreplace",t)})();
  
1(function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;e.length>i;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;r.length>i;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;n.length>r;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",u="tinymce/PluginManager",d="tinymce/util/Tools",f="tinymce/ui/Menu",p="tinymce/dom/DOMUtils",m="tinymce/util/JSONRequest";r(l,[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function i(e){var t;if(3===e.nodeType)return e.data;if(g[e.nodeName])return"";if(t="",(h[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=i(e);while(e=e.nextSibling);return t}function o(e,t,n){var r,i,o,a,s=[],l=0,c=e,u=t.shift(),d=0;e:for(;;){if((h[c.nodeName]||v[c.nodeName])&&l++,3===c.nodeType&&(!i&&c.length+l>=u[1]?(i=c,a=u[1]-l):r&&s.push(c),!r&&c.length+l>u[0]&&(r=c,o=u[0]-l),l+=c.length),r&&i){if(c=n({startNode:r,startNodeIndex:o,endNode:i,endNodeIndex:a,innerNodes:s,match:u[2],matchIndex:d}),l-=i.length-a,r=null,i=null,s=[],u=t.shift(),d++,!u)break}else{if(!g[c.nodeName]&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:m.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(m.createTextNode(e)),r}}else t=e;return function r(e){var n,r,i,o=e.startNode,a=e.endNode,s=e.matchIndex;if(o===a){var l=o;i=l.parentNode,e.startNodeIndex>0&&(n=m.createTextNode(l.data.substring(0,e.startNodeIndex)),i.insertBefore(n,l));var c=t(e.match[0],s);return i.insertBefore(c,l),e.endNodeIndex<l.length&&(r=m.createTextNode(l.data.substring(e.endNodeIndex)),i.insertBefore(r,l)),l.parentNode.removeChild(l),c}n=m.createTextNode(o.data.substring(0,e.startNodeIndex)),r=m.createTextNode(a.data.substring(e.endNodeIndex));for(var u=t(o.data.substring(e.startNodeIndex),s),d=[],f=0,p=e.innerNodes.length;p>f;++f){var h=e.innerNodes[f],g=t(h.data,s);h.parentNode.replaceChild(g,h),d.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return i=o.parentNode,i.insertBefore(n,o),i.insertBefore(u,o),i.removeChild(o),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}function s(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),d=t,this}function l(e){for(var t=0,n=d.length;n>t&&e(d[t],t)!==!1;t++);return this}function c(e){return d.length&&(p=d.length,o(t,d,a(e))),this}var u,d=[],f,p=0,m,h,g,v;if(m=t.ownerDocument,h=n.getBlockElements(),g=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=i(t),f&&e.global)for(;u=e.exec(f);)d.push(r(u));return{text:f,count:p,matches:d,each:l,filter:s,mark:c}}}),r(c,[l,u,d,f,p,m],function(e,n,r,i,o,a){n.add("spellchecker",function(n){function s(e){for(var t in e)return!1;return!0}function l(e,t){var a=[],s=h[t];r.each(s,function(e){a.push({text:e,onclick:function(){n.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){f(e,t)}},{text:"Ignore all",onclick:function(){f(e,t,!0)}},{text:"Finish",onclick:p}]);var l=new i({items:a,context:"contextmenu",onhide:function(){l.remove()}});l.renderTo(document.body);var c=o.DOM.getPos(n.getContentAreaContainer()),d=n.dom.getPos(e);c.x+=d.x,c.y+=d.y,l.moveTo(c.x,c.y+e.offsetHeight)}function c(){function r(e){return n.setProgressState(!1),s(e)?(n.windowManager.alert("No misspellings found"),t):(h=e,i.filter(function(t){return!!e[t[2][0]]}).mark(n.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),i=null,n.fire("SpellcheckStart"),t)}var i,o=[],l={};return g?(p(),t):(g=!0,i=new e(/\w+/g,n.getBody(),n.schema).each(function(e){l[e[2][0]]||(o.push(e[2][0]),l[e[2][0]]=!0)}),n.settings.spellcheck_callback=function(e,t,r){a.sendRPC({url:n.settings.spellchecker_rpc_url,method:e,params:{lang:"en",words:t},success:function(e){r(e)},error:function(e,t){n.windowManager.alert("Error: "+e+"\nData:"+t.responseText),n.setProgressState(!1),i=null}})},n.setProgressState(!0),n.settings.spellcheck_callback("spellcheck",o,r),t)}function u(){n.dom.select("span.mce-spellchecker-word").length||p()}function d(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function f(e,t,i){i?r.each(n.dom.select("span.mce-spellchecker-word"),function(e){var n=e.innerText||e.textContent;n==t&&d(e)}):d(e),u()}function p(){var e,t,r;for(g=!1,r=n.getBody(),t=r.getElementsByTagName("span"),e=t.length;e--;)r=t[e],r.getAttribute("data-mce-index")&&d(r);n.fire("SpellcheckEnd")}function m(e){var t,r,i,o=-1,a,s;for(e=""+e,t=n.getBody().getElementsByTagName("span"),r=0;t.length>r&&(i=t[r],"mce-spellchecker-word"!=i.className||(o=i.getAttribute("data-mce-index"),o===e&&(o=e,a||(a=i.firstChild),s=i.firstChild),o===e||!s));r++);var l=n.dom.createRng();return l.setStart(a,0),l.setEnd(s,s.length),n.selection.setRng(l),l}var h,g;n.on("click",function(e){if("mce-spellchecker-word"==e.target.className){e.preventDefault();var t=m(e.target.getAttribute("data-mce-index"));l(e.target,""+t)}}),n.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:c,selectable:!0,onPostRender:function(){var e=this;n.on("SpellcheckStart SpellcheckEnd",function(){e.active(g)})}}),n.addButton("spellchecker",{tooltip:"Spellcheck",onclick:c,onPostRender:function(){var e=this;n.on("SpellcheckStart SpellcheckEnd",function(){e.active(g)})}})})}),a([l,c])})(this);
  
1tinymce.PluginManager.add("tabfocus",function(e){function t(e){9===e.keyCode&&e.preventDefault()}function n(t){function n(t){function n(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&n(e.parentNode)}function o(e){return e.attributes.tabIndex.specified||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function l(e){return!o(e)&&"-1"!=e.getAttribute("tabindex")&&n(e)}if(s=r.select(":input:enabled,*[tabindex]:not(iframe)"),i(s,function(t,n){return t.id==e.id?(a=n,!1):void 0}),t>0){for(c=a+1;s.length>c;c++)if(l(s[c]))return s[c]}else for(c=a-1;c>=0;c--)if(l(s[c]))return s[c];return null}var a,s,l,c;9===t.keyCode&&(l=o(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==l.length&&(l[1]=l[0],l[0]=":prev"),s=t.shiftKey?":prev"==l[0]?n(-1):r.get(l[0]):":next"==l[1]?n(1):r.get(l[1]),s&&(s.id&&(e=tinymce.get(s.id||s.name))?e.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),s.focus()},10),t.preventDefault()))}var r=tinymce.DOM,i=tinymce.each,o=tinymce.explode;e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)});
  
1(function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;e.length>i;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;r.length>i;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;n.length>r;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/tableplugin/TableGrid",c="tinymce/util/Tools",u="tinymce/Env",d="tinymce/tableplugin/Quirks",f="tinymce/util/VK",p="tinymce/tableplugin/CellSelection",m="tinymce/dom/TreeWalker",h="tinymce/tableplugin/Plugin",g="tinymce/PluginManager";r(l,[c,u],function(e,n){function r(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=e.each;return function(o,a){function s(){var e=0;A=[],i(["thead","tbody","tfoot"],function(t){var n=D.select("> "+t+" tr",a);i(n,function(n,o){o+=e,i(D.select("> td, > th",n),function(e,n){var i,a,s,l;if(A[o])for(;A[o][n];)n++;for(s=r(e,"rowspan"),l=r(e,"colspan"),a=o;o+s>a;a++)for(A[a]||(A[a]=[]),i=n;n+l>i;i++)A[a][i]={part:t,real:a==o&&i==n,elm:e,rowspan:s,colspan:l}})}),e+=n.length})}function l(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,n){var r;return r=A[n],r?r[e]:t}function u(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(D.hasClass(e.elm,"mce-item-selected")||e==L)}function f(){var e=[];return i(a.rows,function(n){i(n.cells,function(r){return D.hasClass(r,"mce-item-selected")||r==L.elm?(e.push(n),!1):t})}),e}function p(){var e=D.createRng();e.setStartAfter(a),e.setEndAfter(a),o.setRng(e),D.remove(a)}function m(r){var o;return e.walk(r,function(e){var a;return 3==e.nodeType?(i(D.getParents(e.parentNode,null,r).reverse(),function(e){e=l(e,!1),o?a&&a.appendChild(e):o=a=e,a=e}),a&&(a.innerHTML=n.ie?"&nbsp;":'<br data-mce-bogus="1" />'),!1):t},"childNodes"),r=l(r,!1),u(r,"rowSpan",1),u(r,"colSpan",1),o?r.appendChild(o):n.ie||(r.innerHTML='<br data-mce-bogus="1" />'),r}function h(){var e=D.createRng(),n;return i(D.select("tr",a),function(e){0===e.cells.length&&D.remove(e)}),0===D.select("tr",a).length?(e.setStartAfter(a),e.setEndAfter(a),o.setRng(e),D.remove(a),t):(i(D.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&D.remove(e)}),s(),n=A[Math.min(A.length-1,B.y)],n&&(o.select(n[Math.min(n.length-1,B.x)].elm,!0),o.collapse(!0)),t)}function g(e,t,n,r){var i,o,a,s,l;for(i=A[t][e].elm.parentNode,a=1;n>=a;a++)if(i=D.getNext(i,"tr")){for(o=e;o>=0;o--)if(l=A[t+a][o].elm,l.parentNode==i){for(s=1;r>=s;s++)D.insertAfter(m(l),l);break}if(-1==o)for(s=1;r>=s;s++)i.insertBefore(m(i.cells[0]),i.cells[0])}}function v(){i(A,function(e,t){i(e,function(e,n){var i,o,a;if(d(e)&&(e=e.elm,i=r(e,"colspan"),o=r(e,"rowspan"),i>1||o>1)){for(u(e,"rowSpan",1),u(e,"colSpan",1),a=0;i-1>a;a++)D.insertAfter(m(e),e);g(n,t,o-1,i)}})})}function y(t,n,r){var o,a,l,f,p,m,g,y,b,C,x;if(t?(o=S(t),a=o.x,l=o.y,f=a+(n-1),p=l+(r-1)):(B=M=null,i(A,function(e,t){i(e,function(e,n){d(e)&&(B||(B={x:n,y:t}),M={x:n,y:t})})}),a=B.x,l=B.y,f=M.x,p=M.y),y=c(a,l),b=c(f,p),y&&b&&y.part==b.part){for(v(),s(),y=c(a,l).elm,u(y,"colSpan",f-a+1),u(y,"rowSpan",p-l+1),g=l;p>=g;g++)for(m=a;f>=m;m++)A[g]&&A[g][m]&&(t=A[g][m].elm,t!=y&&(C=e.grep(t.childNodes),i(C,function(e){y.appendChild(e)}),C.length&&(C=e.grep(y.childNodes),x=0,i(C,function(e){"BR"==e.nodeName&&D.getAttrib(e,"data-mce-bogus")&&x++<C.length-1&&y.removeChild(e)})),D.remove(t)));h()}}function b(e){var n,o,a,s,c,f,p,h,g;for(i(A,function(r,o){return i(r,function(r){return d(r)&&(r=r.elm,c=r.parentNode,f=l(c,!1),n=o,e)?!1:t}),e?!n:t}),s=0;A[0].length>s;s++)if(A[n][s]&&(o=A[n][s].elm,o!=a)){if(e){if(n>0&&A[n-1][s]&&(h=A[n-1][s].elm,g=r(h,"rowSpan"),g>1)){u(h,"rowSpan",g+1);continue}}else if(g=r(o,"rowspan"),g>1){u(o,"rowSpan",g+1);continue}p=m(o),u(p,"colSpan",o.colSpan),f.appendChild(p),a=o}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):D.insertAfter(f,c))}function C(e){var n,o;i(A,function(r){return i(r,function(r,i){return d(r)&&(n=i,e)?!1:t}),e?!n:t}),i(A,function(t,i){var a,s,l;t[n]&&(a=t[n].elm,a!=o&&(l=r(a,"colspan"),s=r(a,"rowspan"),1==l?e?(a.parentNode.insertBefore(m(a),a),g(n,i,s-1,l)):(D.insertAfter(m(a),a),g(n,i,s-1,l)):u(a,"colSpan",a.colSpan+1),o=a))})}function x(){var t=[];i(A,function(n){i(n,function(n,o){d(n)&&-1===e.inArray(t,o)&&(i(A,function(e){var t=e[o].elm,n;n=r(t,"colSpan"),n>1?u(t,"colSpan",n-1):D.remove(t)}),t.push(o))})}),h()}function w(){function e(e){var t,n,o;t=D.getNext(e,"tr"),i(e.cells,function(e){var t=r(e,"rowSpan");t>1&&(u(e,"rowSpan",t-1),n=S(e),g(n.x,n.y,1,1))}),n=S(e.cells[0]),i(A[n.y],function(e){var t;e=e.elm,e!=o&&(t=r(e,"rowSpan"),1>=t?D.remove(e):u(e,"rowSpan",t-1),o=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),h()}function _(){var e=f();return D.remove(e),h(),e}function N(){var e=f();return i(e,function(t,n){e[n]=l(t,!0)}),e}function E(e,n){var r=f(),o=r[n?0:r.length-1],a=o.cells.length;e&&(i(A,function(e){var n;return a=0,i(e,function(e){e.real&&(a+=e.colspan),e.elm.parentNode==o&&(n=1)}),n?!1:t}),n||e.reverse(),i(e,function(e){var t,r=e.cells.length,i;for(t=0;r>t;t++)i=e.cells[t],u(i,"colSpan",1),u(i,"rowSpan",1);for(t=r;a>t;t++)e.appendChild(m(e.cells[r-1]));for(t=a;r>t;t++)D.remove(e.cells[t]);n?o.parentNode.insertBefore(e,o):D.insertAfter(e,o)}),D.removeClass(D.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function S(e){var n;return i(A,function(r,o){return i(r,function(r,i){return r.elm==e?(n={x:i,y:o},!1):t}),!n}),n}function k(e){B=S(e)}function T(){var e,t;return e=t=0,i(A,function(n,r){i(n,function(n,i){var o,a;d(n)&&(n=A[r][i],i>e&&(e=i),r>t&&(t=r),n.real&&(o=n.colspan-1,a=n.rowspan-1,o&&i+o>e&&(e=i+o),a&&r+a>t&&(t=r+a)))})}),{x:e,y:t}}function R(e){var t,n,r,i,o,a,s,l,c,u;if(M=S(e),B&&M){for(t=Math.min(B.x,M.x),n=Math.min(B.y,M.y),r=Math.max(B.x,M.x),i=Math.max(B.y,M.y),o=r,a=i,u=n;a>=u;u++)e=A[u][t],e.real||t>t-(e.colspan-1)&&(t-=e.colspan-1);for(c=t;o>=c;c++)e=A[n][c],e.real||n>n-(e.rowspan-1)&&(n-=e.rowspan-1);for(u=n;i>=u;u++)for(c=t;r>=c;c++)e=A[u][c],e.real&&(s=e.colspan-1,l=e.rowspan-1,s&&c+s>o&&(o=c+s),l&&u+l>a&&(a=u+l));for(D.removeClass(D.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),u=n;a>=u;u++)for(c=t;o>=c;c++)A[u][c]&&D.addClass(A[u][c].elm,"mce-item-selected")}}var A,B,M,L,D=o.dom;a=a||D.getParent(o.getStart(),"table"),s(),L=D.getParent(o.getStart(),"th,td"),L&&(B=S(L),M=T(),L=c(B.x,B.y)),e.extend(this,{deleteTable:p,split:v,merge:y,insertRow:b,insertCol:C,deleteCols:x,deleteRows:w,cutRows:_,copyRows:N,pasteRows:E,getPos:S,setStartCell:k,setEndCell:R})}}),r(d,[f,u,c],function(e,n,r){function i(e,t){return parseInt(e.getAttribute(t)||1,10)}var o=r.each;return function(r){function a(){function n(n){function a(e,t){var i=e?"previousSibling":"nextSibling",o=r.dom.getParent(t,"tr"),a=o[i];if(a)return v(r,t,a,e),n.preventDefault(),!0;var l=r.dom.getParent(o,"table"),d=o.parentNode,f=d.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var p=s(e,l,d,"tbody");if(null!==p)return c(e,p,t)}return u(e,o,i,l)}function s(e,t,n,i){var o=r.dom.select(">"+i,t),a=o.indexOf(n);if(e&&0===a||!e&&a===o.length-1)return l(e,t);if(-1===a){var s="thead"===n.tagName.toLowerCase()?0:o.length-1;return o[s]}return o[a+(e?-1:1)]}function l(e,t){var n=e?"thead":"tfoot",i=r.dom.select(">"+n,t);return 0!==i.length?i[0]:null}function c(e,t,i){var o=d(t,e);return o&&v(r,i,o,e),n.preventDefault(),!0}function u(e,t,i,o){var s=o[i];if(s)return f(s),!0;var l=r.dom.getParent(o,"td,th");if(l)return a(e,l,n);var c=d(t,!e);return f(c),n.preventDefault(),!1}function d(e,t){var n=e&&e[t?"lastChild":"firstChild"];return n&&"BR"===n.nodeName?r.dom.getParent(n,"td,th"):n}function f(e){r.selection.setCursorLocation(e,0)}function p(){return C==e.UP||C==e.DOWN}function m(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function h(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=i(n,"colspan");return t}function g(e,n){var r=0,a=0;return o(e.children,function(e,o){return r+=i(e,"colspan"),a=o,r>n?!1:t}),a}function v(e,t,n,i){var o=h(r.dom.getParent(t,"td,th")),a=g(n,o),s=n.childNodes[a],l=d(s,i);f(l||s)}function y(e){var t=r.selection.getNode(),n=r.dom.getParent(t,"td,th"),i=r.dom.getParent(e,"td,th");return n&&n!==i&&b(n,i)}function b(e,t){return r.dom.getParent(e,"TABLE")===r.dom.getParent(t,"TABLE")}var C=n.keyCode;if(p()&&m(r)){var x=r.selection.getNode();setTimeout(function(){y(x)&&a(!n.shiftKey&&C===e.UP,x,n)},0)}}r.on("KeyDown",function(e){n(e)})}function s(){function e(e,t){var n=t.ownerDocument,r=n.createRange(),i;return r.setStartBefore(t),r.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(r.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}r.on("KeyDown",function(t){var n,i,o=r.dom;(37==t.keyCode||38==t.keyCode)&&(n=r.selection.getRng(),i=o.getParent(n.startContainer,"table"),i&&r.getBody().firstChild==i&&e(n,i)&&(n=o.createRng(),n.setStartBefore(i),n.setEndBefore(i),r.selection.setRng(n),t.preventDefault()))})}function l(){r.on("KeyDown SetContent VisualAid",function(){var e;for(e=r.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(r.settings.forced_root_block?r.dom.add(r.getBody(),r.settings.forced_root_block,null,n.ie?"&nbsp;":'<br data-mce-bogus="1" />'):r.dom.add(r.getBody(),"br",{"data-mce-bogus":"1"}))}),r.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\u00a0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&r.dom.remove(t)})}function c(){function e(e,t,n,r){var i=3,o=e.dom.getParent(t.startContainer,"TABLE"),a,s,l;return o&&(a=o.parentNode),s=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&r&&("TR"==n.nodeName||n==a),l=("TD"==n.nodeName||"TH"==n.nodeName)&&!r,s||l}function t(){var t=r.selection.getRng(),n=r.selection.getNode(),i=r.dom.getParent(t.startContainer,"TD,TH");if(e(r,t,n,i)){i||(i=n);for(var o=i.lastChild;o.lastChild;)o=o.lastChild;t.setEnd(o,o.nodeValue.length),r.selection.setRng(t)}}r.on("KeyDown",function(){t()}),r.on("MouseDown",function(e){2!=e.button&&t()})}n.webkit&&(a(),c()),n.gecko&&(s(),l())}}),r(p,[l,m,c],function(e,n,r){return function(i){function o(){i.getBody().style.webkitUserSelect="",u&&(i.dom.removeClass(i.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),u=!1)}var a=i.dom,s,l,c,u=!0;return i.on("MouseDown",function(e){2!=e.button&&(o(),l=a.getParent(e.target,"td,th"),c=a.getParent(l,"table"))}),a.bind(i.getDoc(),"mouseover",function(t){var n,r,o=t.target;if(l&&(s||o!=l)&&("TD"==o.nodeName||"TH"==o.nodeName)){r=a.getParent(o,"table"),r==c&&(s||(s=new e(i.selection,r),s.setStartCell(l),i.getBody().style.webkitUserSelect="none"),s.setEndCell(o),u=!0),n=i.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(d){}t.preventDefault()}}),i.on("MouseUp",function(){function e(e,i){var a=new n(e,e);do{if(3==e.nodeType&&0!==r.trim(e.nodeValue).length)return i?o.setStart(e,0):o.setEnd(e,e.nodeValue.length),t;if("BR"==e.nodeName)return i?o.setStartBefore(e):o.setEndBefore(e),t}while(e=i?a.next():a.prev())}var o,u=i.selection,d,f,p,m,h;if(l){if(s&&(i.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){o=a.createRng(),p=d[0],h=d[d.length-1],o.setStartBefore(p),o.setEndAfter(p),e(p,1),f=new n(p,a.getParent(d[0],"table"));do if("TD"==p.nodeName||"TH"==p.nodeName){if(!a.hasClass(p,"mce-item-selected"))break;m=p}while(p=f.next());e(m),u.setRng(o)}i.nodeChanged(),l=s=c=null}}),i.on("KeyUp",function(){o()}),{clear:o}}}),r(h,[l,d,p,c,m,u,g],function(e,n,r,i,o,a,s){function l(i){function o(e){return e?e.replace(/px$/,""):""}function s(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(){var e=i.dom,t,n;t=i.dom.getParent(i.selection.getStart(),"table"),n={width:o(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:o(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:e.getAttrib(t,"cellspacing"),cellpadding:e.getAttrib(t,"cellpadding"),border:e.getAttrib(t,"border"),caption:!!e.select("caption",t)[0]},c("left center right".split(" "),function(e){i.formatter.matchNode(t,"align"+e)&&(n.align=e)}),i.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[{label:"Cols",name:"cols",disabled:!0},{label:"Rows",name:"rows",disabled:!0},{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),r;i.undoManager.transact(function(){i.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),i.dom.setStyles(t,{width:s(n.width),height:s(n.height)}),r=e.select("caption",t)[0],r&&!n.caption&&e.remove(r),!r&&n.caption&&(r=e.create("caption"),a.ie||(r.innerHTML='<br data-mce-bogus="1"/>'),t.insertBefore(r,t.firstChild)),n.align?i.formatter.apply("align"+n.align,{},t):c("left center right".split(" "),function(e){i.formatter.remove("align"+e,{},t)}),i.focus(),i.addVisual()})}})}function u(e,t){i.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();i.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function d(){var e=i.dom,t,n,r=[];r=i.dom.select("td.mce-item-selected,th.mce-item-selected"),t=i.dom.getParent(i.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],n={width:o(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:o(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),c("left center right".split(" "),function(e){i.formatter.matchNode(t,"align"+e)&&(n.align=e)}),i.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();i.undoManager.transact(function(){c(r,function(n){i.dom.setAttrib(n,"scope",t.scope),i.dom.setStyles(n,{width:s(t.width),height:s(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),t.align?i.formatter.apply("align"+t.align,{},n):c("left center right".split(" "),function(e){i.formatter.remove("align"+e,{},n)})}),i.focus()})}})}function f(){var e=i.dom,n,r,a,l,u=[];n=i.dom.getParent(i.selection.getStart(),"table"),r=i.dom.getParent(i.selection.getStart(),"td,th"),c(n.rows,function(n){c(n.cells,function(i){return e.hasClass(i,"mce-item-selected")||i==r?(u.push(n),!1):t})}),a=u[0],l={height:o(e.getStyle(a,"height")||e.getAttrib(a,"height")),scope:e.getAttrib(a,"scope")},l.type=a.parentNode.nodeName.toLowerCase(),c("left center right".split(" "),function(e){i.formatter.matchNode(a,"align"+e)&&(l.align=e)}),i.windowManager.open({title:"Row properties",items:{type:"form",data:l,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,menu:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,menu:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,r,o;i.undoManager.transact(function(){c(u,function(a){i.dom.setAttrib(a,"scope",t.scope),i.dom.setStyles(a,{height:s(t.height)}),t.type!=a.parentNode.nodeName.toLowerCase()&&(n=e.getParent(a,"table"),r=a.parentNode,o=e.select(n,t.type)[0],o||(o=e.create(t.type),n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.insertBefore(a,o.firstChild),r.hasChildNodes()||e.remove(r)),t.align?i.formatter.apply("align"+t.align,{},a):c("left center right".split(" "),function(e){i.formatter.remove("align"+e,{},a)})}),i.focus()})}})}function p(e){return function(){i.execCommand(e)}}function m(e,t){var n,r,o;for(o="<table><tbody>",n=0;t>n;n++){for(o+="<tr>",r=0;e>r;r++)o+="<td>"+(a.ie?" ":"<br>")+"</td>";o+="</tr>"}o+="</tbody></table>",i.insertContent(o)}function h(e,t){function n(){e.disabled(!i.dom.getParent(i.selection.getStart(),t)),i.selection.selectorChanged(t,function(t){e.disabled(!t)})}i.initialized?n():i.on("init",n)}function g(){h(this,"table")}function v(){h(this,"td,th")}function y(){var e="";e='<table role="presentation" class="mce-grid mce-grid-border">';for(var t=0;10>t;t++){e+="<tr>";for(var n=0;10>n;n++)e+='<td><a href="#" data-mce-index="'+n+","+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center">0 x 0</div>'}var b,C,x=this;c([["table","Insert/edit table","mceInsertTable",g],["delete_table","Delete table","mceTableDelete",g],["delete_col","Delete column","mceTableDeleteCol",v],["delete_row","Delete row","mceTableDeleteRow",v],["col_after","Insert column after","mceTableInsertColAfter",v],["col_before","Insert column before","mceTableInsertColBefore",v],["row_after","Insert row after","mceTableInsertRowAfter",v],["row_before","Insert row before","mceTableInsertRowBefore",v],["row_props","Row properties","mceTableRowProps",v],["cell_props","Cell properties","mceTableCellProps",v],["split_cells","Split cells","mceTableSplitCells",v],["merge_cells","Merge cells","mceTableMergeCells",v]],function(e){i.addButton(e[0],{title:e[1],cmd:e[2],onPostRender:e[3]})}),i.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){i.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName("a"),"mce-active")},menu:[{type:"container",html:y(),onmousemove:function(e){var t=e.target;if("A"==t.nodeName){var n=i.dom.getParent(t,"table"),r=t.getAttribute("data-mce-index");if(r!=this.lastPos){r=r.split(","),r[0]=parseInt(r[0],10),r[1]=parseInt(r[1],10);for(var o=0;10>o;o++)for(var a=0;10>a;a++)i.dom.toggleClass(n.rows[o].childNodes[a].firstChild,"mce-active",r[0]>=a&&r[1]>=o);n.nextSibling.innerHTML=r[0]+1+" x "+(r[1]+1),this.lastPos=r}}},onclick:function(e){"A"==e.target.nodeName&&this.lastPos&&(e.preventDefault(),m(this.lastPos[0]+1,this.lastPos[1]+1),this.parent().cancel())}}]}),i.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:g,onclick:l}),i.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:g,cmd:"mceTableDelete"}),i.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:p("mceTableCellProps"),onPostRender:v},{text:"Merge cells",onclick:p("mceTableMergeCells"),onPostRender:v},{text:"Split cell",onclick:p("mceTableSplitCells"),onPostRender:v}]}),i.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:p("mceTableInsertRowBefore"),onPostRender:v},{text:"Insert row after",onclick:p("mceTableInsertRowAfter"),onPostRender:v},{text:"Delete row",onclick:p("mceTableDeleteRow"),onPostRender:v},{text:"Row properties",onclick:p("mceTableRowProps"),onPostRender:v},{text:"-"},{text:"Cut row",onclick:p("mceTableCutRow"),onPostRender:v},{text:"Copy row",onclick:p("mceTableCopyRow"),onPostRender:v},{text:"Paste row before",onclick:p("mceTablePasteRowBefore"),onPostRender:v},{text:"Paste row after",onclick:p("mceTablePasteRowAfter"),onPostRender:v}]}),i.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:p("mceTableInsertColBefore"),onPostRender:v},{text:"Insert column after",onclick:p("mceTableInsertColAfter"),onPostRender:v},{text:"Delete column",onclick:p("mceTableDeleteCol"),onPostRender:v}]}),a.isIE||i.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(i.selection.select(e),i.nodeChanged())}),x.quirks=new n(i),i.on("Init",function(){b=i.windowManager,x.cellSelection=new r(i)}),c({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,r;r=i.dom.getParent(i.selection.getStart(),"th,td"),r&&(t=r.rowSpan,n=r.colSpan),i.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():u(e,r)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){C=e.cutRows()},mceTableCopyRow:function(e){C=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(C,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(C)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){i.addCommand(n,function(){var n=new e(i.selection);n&&(t(n),i.execCommand("mceRepaint"),x.cellSelection.clear())})}),c({mceInsertTable:function(){l()},mceTableRowProps:f,mceTableCellProps:d},function(e,t){i.addCommand(t,function(t,n){e(n)})})}var c=i.each;s.add("table",l)}),a([l,d,p,h])})(this);
  
1tinymce.PluginManager.add("template",function(e){function t(){function t(e){var t=e.control.value();t.url?tinymce.util.XHR.send({url:t.url,success:function(e){r=e,n.find("iframe")[0].html(e)}}):(r=t.content,n.find("iframe")[0].html(t.content)),n.find("#description")[0].text(e.control.value().description)}var n,r,o=[];return e.settings.templates?(tinymce.each(e.settings.templates,function(e){o.push({text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),n=e.windowManager.open({title:"Insert template",body:[{type:"listbox",name:"template",flex:0,label:"Templates",values:o,onselect:t},{type:"label",name:"description",label:"Description",text:""},{type:"iframe",minWidth:600,minHeight:400,border:1}],onsubmit:function(){i(!1,r)}}),void 0):(e.windowManager.alert("No templates defined"),void 0)}function n(t,n){function r(e,t){if(e=""+e,t>e.length)for(var n=0;t-e.length>n;n++)e="0"+e;return e}var i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),a="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",r(n.getMonth()+1,2)),t=t.replace("%d",r(n.getDate(),2)),t=t.replace("%H",""+r(n.getHours(),2)),t=t.replace("%M",""+r(n.getMinutes(),2)),t=t.replace("%S",""+r(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(12>n.getHours()?"AM":"PM")),t=t.replace("%B",""+e.translate(s[n.getMonth()])),t=t.replace("%b",""+e.translate(a[n.getMonth()])),t=t.replace("%A",""+e.translate(o[n.getDay()])),t=t.replace("%a",""+e.translate(i[n.getDay()])),t=t.replace("%%","%")}function r(t){var n=e.dom,r=e.getParam("template_replace_values");o(n.select("*",t),function(e){o(r,function(t,i){n.hasClass(e,i)&&"function"==typeof r[i]&&r[i](e)})})}function i(t,i){function a(e,t){return RegExp("\\b"+t+"\\b","g").test(e.className)}var s,l,c=e.dom,u=e.selection.getContent();o(e.getParam("template_replace_values"),function(e,t){"function"!=typeof e&&(i=i.replace(RegExp("\\{\\$"+t+"\\}","g"),e))}),s=c.create("div",null,i),l=c.select(".mceTmpl",s),l&&l.length>0&&(s=c.create("div",null),s.appendChild(l[0].cloneNode(!0))),o(c.select("*",s),function(t){a(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),a(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),a(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=u)}),r(s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()}var o=tinymce.each;e.addCommand("mceInsertTemplate",i),e.addButton("template",{title:"Insert template",onclick:t}),e.addMenuItem("image",{text:"Insert template",onclick:t,context:"insert"}),e.on("PreProcess",function(t){var i=e.dom;o(i.select("div",t.node),function(t){i.hasClass(t,"mceTmpl")&&(o(i.select("*",t),function(t){i.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),r(t))})})});
  
1tinymce.PluginManager.add("textcolor",function(e){function t(){var e,t,n=[];for(t=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],e=0;t.length>e;e+=2)n.push({text:t[e+1],color:t[e]});return n}function n(){var e,n,r,i,o,a=this;for(e=t(),n='<table class="mce-grid mce-colorbutton-grid" role="presentation" cellspacing="0"><tbody>',r=Math.ceil(Math.sqrt(e.length)),o=0;5>o;o++){for(n+="<tr>",i=0;8>i;i++){var s=e[8*o+i];n+='<td><div id="'+a._id+"-"+(8*o+i)+'"'+' data-mce-color="'+s.color+'"'+' role="option"'+' tabIndex="-1"'+' style="'+(s?"background-color: #"+s.color:"")+'"'+' title="'+s.text+'">'+"</div>"+"</td>"}n+="</tr>"}return n+="</tbody></table>"}function r(t){var n,r=this.parent();(n=t.target.getAttribute("data-mce-color"))&&(r.hidePanel(),n="#"+n,r.showPreview(n),r.hidePanel(),e.execCommand(r.settings.selectcmd,!1,n))}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",popoverAlign:"bc-tl",selectcmd:"ForeColor",panel:{html:n,onclick:r}}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",popoverAlign:"bc-tl",selectcmd:"HiliteColor",panel:{html:n,onclick:r}})});
  
1.mce-visualblocks p {
2 padding-top: 10px;
3 border: 1px dashed #BBB;
4 margin-left: 3px;
5 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
6}
7
8.mce-visualblocks h1 {
9 padding-top: 10px;
10 border: 1px dashed #BBB;
11 margin-left: 3px;
12 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
13}
14
15.mce-visualblocks h2 {
16 padding-top: 10px;
17 border: 1px dashed #BBB;
18 margin-left: 3px;
19 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
20}
21
22.mce-visualblocks h3 {
23 padding-top: 10px;
24 border: 1px dashed #BBB;
25 margin-left: 3px;
26 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
27}
28
29.mce-visualblocks h4 {
30 padding-top: 10px;
31 border: 1px dashed #BBB;
32 margin-left: 3px;
33 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
34}
35
36.mce-visualblocks h5 {
37 padding-top: 10px;
38 border: 1px dashed #BBB;
39 margin-left: 3px;
40 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
41}
42
43.mce-visualblocks h6 {
44 padding-top: 10px;
45 border: 1px dashed #BBB;
46 margin-left: 3px;
47 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
48}
49
50.mce-visualblocks div {
51 padding-top: 10px;
52 border: 1px dashed #BBB;
53 margin-left: 3px;
54 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
55}
56
57.mce-visualblocks section {
58 padding-top: 10px;
59 border: 1px dashed #BBB;
60 margin: 0 0 1em 3px;
61 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
62}
63
64.mce-visualblocks article {
65 padding-top: 10px;
66 border: 1px dashed #BBB;
67 margin: 0 0 1em 3px;
68 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
69}
70
71.mce-visualblocks blockquote {
72 padding-top: 10px;
73 border: 1px dashed #BBB;
74 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
75}
76
77.mce-visualblocks address {
78 padding-top: 10px;
79 border: 1px dashed #BBB;
80 margin: 0 0 1em 3px;
81 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
82}
83
84.mce-visualblocks pre {
85 padding-top: 10px;
86 border: 1px dashed #BBB;
87 margin-left: 3px;
88 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
89}
90
91.mce-visualblocks figure {
92 padding-top: 10px;
93 border: 1px dashed #BBB;
94 margin: 0 0 1em 3px;
95 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
96}
97
98.mce-visualblocks hgroup {
99 padding-top: 10px;
100 border: 1px dashed #BBB;
101 margin: 0 0 1em 3px;
102 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
103}
104
105.mce-visualblocks aside {
106 padding-top: 10px;
107 border: 1px dashed #BBB;
108 margin: 0 0 1em 3px;
109 background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
110}
111
112.mce-visualblocks figcaption {
113 border: 1px dashed #BBB;
114}
  
1tinymce.PluginManager.add("visualblocks",function(e,t){var n,r,i;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,a=e.dom;n||(n=a.uniqueId(),o=a.create("link",{id:n,rel:"stylesheet",href:t+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(t){i&&a.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==t.type)}),a.toggleClass(e.getBody(),"mce-visualblocks"),i=e.dom.hasClass(e.getBody(),"mce-visualblocks"),r&&r.active(a.hasClass(e.getBody(),"mce-visualblocks"))}),e.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:function(){r=this,r.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))},selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}))});
  
1tinymce.PluginManager.add("visualchars",function(e){function t(t){var i,o,a,s,l,c,u=e.getBody(),d=e.selection;if(n=!n,r.active(n),t&&(c=d.getBookmark()),n)for(o=[],tinymce.walk(u,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&o.push(e)},"childNodes"),a=0;o.length>a;a++){for(s=o[a].nodeValue,s=s.replace(/(\u00a0)/g,'<span data-mce-bogus="1" class="mce-nbsp">$1</span>'),l=e.dom.create("div",null,s);i=l.lastChild;)e.dom.insertAfter(i,o[a]);e.dom.remove(o[a])}else for(o=e.dom.select("span.mce-nbsp",u),a=o.length-1;a>=0;a--)e.dom.remove(o[a],1);d.moveToBookmark(c)}var n,r;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars"}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:function(){r=this},selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){n&&"raw"!=e.format&&!e.draft&&(n=!0,t(!1))})});
  
1tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",i.getCount()])}var n,r,i=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-]+/g),r=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&(n.insert({type:"label",name:"wordcount",text:["Words: {0}",i.getCount()],classes:"wordcount"},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()}))}),i.getCount=function(){var t=e.getContent({format:"raw"}),i=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," "),t=t.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," "),t=t.replace(r,"");var o=t.match(n);o&&(i=o.length)}return i}});
  
1body.mce-content-body{background-color:#fff;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#f0f0ee;scrollbar-arrow-color:#676662;scrollbar-base-color:#f0f0ee;scrollbar-darkshadow-color:#ddd;scrollbar-face-color:#e0e0dd;scrollbar-highlight-color:#f0f0ee;scrollbar-shadow-color:#f0f0ee;scrollbar-track-color:#f5f5f5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3a3a3a;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3a3a3a;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:green;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}
  
1<?xml version="1.0" standalone="no"?>
2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3<svg xmlns="http://www.w3.org/2000/svg">
4<metadata>
5This is a custom SVG font generated by IcoMoon.
6<iconset grid="16"></iconset>
7</metadata>
8<defs>
9<font id="icomoon" horiz-adv-x="512" >
10<font-face units-per-em="512" ascent="480" descent="-32" />
11<missing-glyph horiz-adv-x="512" />
12<glyph unicode="&#xe034;" d="M 464.00,416.00L 256.00,416.00L 240.00,448.00L 64.00,448.00L 32.00,384.00L 480.00,384.00 zM 452.17,128.00l 37.43,0.00 L 512.00,352.00L0.00,352.00 l 32.00-320.00l 242.04,0.00 C 221.599,50.888, 184.00,101.133, 184.00,160.00c0.00,74.991, 61.009,136.00, 136.00,136.00
13 c 74.99,0.00, 136.00-61.009, 136.00-136.00C 456.00,149.161, 454.689,138.425, 452.17,128.00zM 501.498,23.125l-99.248,87.346C 410.977,124.931, 416.00,141.878, 416.00,160.00c0.00,53.02-42.98,96.00-96.00,96.00s-96.00-42.98-96.00-96.00
14 s 42.98-96.00, 96.00-96.00c 18.122,0.00, 35.069,5.023, 49.529,13.75l 87.346-99.248c 11.481-13.339, 31.059-14.07, 43.503-1.626l 2.746,2.746
15 C 515.568-7.934, 514.837,11.644, 501.498,23.125z M 320.00,98.00c-34.242,0.00-62.00,27.758-62.00,62.00s 27.758,62.00, 62.00,62.00s 62.00-27.758, 62.00-62.00
16 S 354.242,98.00, 320.00,98.00z" />
17<glyph unicode="&#xe032;" d="M 384.00,352.00L 416.00,352.00L 416.00,320.00L 384.00,320.00zM 320.00,288.00L 352.00,288.00L 352.00,256.00L 320.00,256.00zM 320.00,224.00L 352.00,224.00L 352.00,192.00L 320.00,192.00zM 320.00,160.00L 352.00,160.00L 352.00,128.00L 320.00,128.00zM 256.00,224.00L 288.00,224.00L 288.00,192.00L 256.00,192.00zM 256.00,160.00L 288.00,160.00L 288.00,128.00L 256.00,128.00zM 192.00,160.00L 224.00,160.00L 224.00,128.00L 192.00,128.00zM 384.00,288.00L 416.00,288.00L 416.00,256.00L 384.00,256.00zM 384.00,224.00L 416.00,224.00L 416.00,192.00L 384.00,192.00zM 384.00,160.00L 416.00,160.00L 416.00,128.00L 384.00,128.00zM 384.00,96.00L 416.00,96.00L 416.00,64.00L 384.00,64.00zM 320.00,96.00L 352.00,96.00L 352.00,64.00L 320.00,64.00zM 256.00,96.00L 288.00,96.00L 288.00,64.00L 256.00,64.00zM 192.00,96.00L 224.00,96.00L 224.00,64.00L 192.00,64.00zM 128.00,96.00L 160.00,96.00L 160.00,64.00L 128.00,64.00z" />
18<glyph unicode="&#xe031;" d="M 416.00,352.00l-96.00,0.00 L 320.00,384.00 L 224.00,480.00L0.00,480.00 l0.00-384.00 l 192.00,0.00 l0.00-128.00 l 320.00,0.00 L 512.00,256.00 L 416.00,352.00z M 416.00,306.745L 466.745,256.00L 416.00,256.00 L 416.00,306.745 z M 224.00,434.745L 274.745,384.00L 224.00,384.00
19 L 224.00,434.745 z M 32.00,448.00l 160.00,0.00 l0.00-96.00 l 96.00,0.00 l0.00-224.00 L 32.00,128.00 L 32.00,448.00 z M 480.00,0.00L 224.00,0.00 l0.00,96.00 l 96.00,0.00 L 320.00,320.00 l 64.00,0.00 l0.00-96.00 l 96.00,0.00 L 480.00,0.00 z" />
20<glyph unicode="&#xe030;" d="M 128.00,448.00 L 384.00,448.00 L 384.00,384.00 L 320.00,384.00 L 320.00,0.00 L 256.00,0.00 L 256.00,384.00 L 192.00,384.00 L 192.00,0.00 L 128.00,0.00 L 128.00,224.00 C 66.144,224.00 16.00,274.144 16.00,336.00 C 16.00,397.856 66.144,448.00 128.00,448.00 ZM 480.00,32.00L 352.00,144.00L 480.00,256.00 z" />
21<glyph unicode="&#xe02f;" d="M 224.00,448.00 L 480.00,448.00 L 480.00,384.00 L 416.00,384.00 L 416.00,0.00 L 352.00,0.00 L 352.00,384.00 L 288.00,384.00 L 288.00,0.00 L 224.00,0.00 L 224.00,224.00 C 162.144,224.00 112.00,274.144 112.00,336.00 C 112.00,397.856 162.144,448.00 224.00,448.00 ZM 32.00,256.00L 160.00,144.00L 32.00,32.00 z" />
22<glyph unicode="&#xe02e;" d="M 192.00,448.00 L 448.00,448.00 L 448.00,384.00 L 384.00,384.00 L 384.00,0.00 L 320.00,0.00 L 320.00,384.00 L 256.00,384.00 L 256.00,0.00 L 192.00,0.00 L 192.00,224.00 C 130.144,224.00 80.00,274.144 80.00,336.00 C 80.00,397.856 130.144,448.00 192.00,448.00 Z" />
23<glyph unicode="&#xe02d;" d="M 365.71,221.482 C 397.67,197.513 416.00,163.439 416.00,128.00 C 416.00,92.561 397.67,58.487 365.71,34.518 C 336.031,12.259 297.068,0.00 256.00,0.00 C 214.931,0.00 175.969,12.259 146.29,34.518 C 114.33,58.487 96.00,92.561 96.00,128.00 L 160.00,128.00 C 160.00,93.309 203.963,64.00 256.00,64.00 C 308.037,64.00 352.00,93.309 352.00,128.00 C 352.00,162.691 308.037,192.00 256.00,192.00 C 214.931,192.00 175.969,204.259 146.29,226.518 C 114.33,250.488 96.00,284.561 96.00,320.00 C 96.00,355.439 114.33,389.512 146.29,413.482 C 175.969,435.741 214.931,448.00 256.00,448.00 C 297.068,448.00 336.031,435.741 365.71,413.482 C 397.67,389.512 416.00,355.439 416.00,320.00 L 352.00,320.00 C 352.00,354.691 308.037,384.00 256.00,384.00 C 203.963,384.00 160.00,354.691 160.00,320.00 C 160.00,285.309 203.963,256.00 256.00,256.00 C 297.068,256.00 336.031,243.741 365.71,221.482 ZM0.00,224.00L 512.00,224.00L 512.00,192.00L0.00,192.00z" />
24<glyph unicode="&#xe02c;" d="M 352.00,448.00 L 416.00,448.00 L 416.00,240.00 C 416.00,160.471 344.366,96.00 256.00,96.00 C 167.635,96.00 96.00,160.471 96.00,240.00 L 96.00,448.00 L 160.00,448.00 L 160.00,240.00 C 160.00,219.917 169.119,200.648 185.677,185.747 C 204.125,169.145 229.10,160.00 256.00,160.00 C 282.90,160.00 307.875,169.145 326.323,185.747 C 342.881,200.648 352.00,219.917 352.00,240.00 L 352.00,448.00 ZM 96.00,64.00L 416.00,64.00L 416.00,0.00L 96.00,0.00z" />
25<glyph unicode="&#xe02b;" d="M 448.00,448.00 L 448.00,416.00 L 384.00,416.00 L 224.00,32.00 L 288.00,32.00 L 288.00,0.00 L 64.00,0.00 L 64.00,32.00 L 128.00,32.00 L 288.00,416.00 L 224.00,416.00 L 224.00,448.00 Z" />
26<glyph unicode="&#xe02a;" d="M 353.94,237.674C 372.689,259.945, 384.00,288.678, 384.00,320.00c0.00,70.58-57.421,128.00-128.00,128.00l-64.00,0.00 l-64.00,0.00 L 96.00,448.00 l0.00-448.00 l 32.00,0.00 l 64.00,0.00 l 96.00,0.00
27 c 70.579,0.00, 128.00,57.421, 128.00,128.00C 416.00,174.478, 391.101,215.248, 353.94,237.674z M 192.00,384.00l 50.75,0.00 c 27.984,0.00, 50.75-28.71, 50.75-64.00
28 s-22.766-64.00-50.75-64.00L 192.00,256.00 L 192.00,384.00 z M 271.50,64.00L 192.00,64.00 L 192.00,192.00 l 79.50,0.00 c 29.225,0.00, 53.00-28.71, 53.00-64.00S 300.725,64.00, 271.50,64.00z" />
29<glyph unicode="&#xe029;" d="M 192.00,64.00L 288.00,64.00L 288.00-32.00L 192.00-32.00zM 400.00,448.00 C 426.51,448.00 448.00,426.51 448.00,400.00 L 448.00,256.00 L 288.00,160.00 L 288.00,96.00 L 192.00,96.00 L 192.00,192.00 L 352.00,288.00 L 352.00,352.00 L 96.00,352.00 L 96.00,448.00 L 400.00,448.00 Z" />
30<glyph unicode="&#xe028;" d="M 288.00,448.00 C 411.712,448.00 512.00,347.712 512.00,224.00 C 512.00,100.288 411.712,0.00 288.00,0.00 L 288.00,48.00 C 335.012,48.00 379.209,66.307 412.451,99.549 C 445.693,132.791 464.00,176.988 464.00,224.00 C 464.00,271.011 445.693,315.209 412.451,348.451 C 379.209,381.693 335.012,400.00 288.00,400.00 C 240.989,400.00 196.791,381.693 163.549,348.451 C 137.979,322.882 121.258,290.828 114.896,256.00 L 208.00,256.00 L 96.00,128.00 L -16.00,256.00 L 66.285,256.00 C 81.815,364.551 175.154,448.00 288.00,448.00 ZM 384.00,256.00 L 384.00,192.00 L 256.00,192.00 L 256.00,352.00 L 320.00,352.00 L 320.00,256.00 Z" />
31<glyph unicode="&#xe027;" d="M0.00,224.00L 64.00,224.00L 64.00,192.00L0.00,192.00zM 96.00,224.00L 192.00,224.00L 192.00,192.00L 96.00,192.00zM 224.00,224.00L 288.00,224.00L 288.00,192.00L 224.00,192.00zM 320.00,224.00L 416.00,224.00L 416.00,192.00L 320.00,192.00zM 448.00,224.00L 512.00,224.00L 512.00,192.00L 448.00,192.00zM 440.00,480.00 L 448.00,256.00 L 64.00,256.00 L 72.00,480.00 L 88.00,480.00 L 96.00,288.00 L 416.00,288.00 L 424.00,480.00 ZM 72.00-32.00 L 64.00,160.00 L 448.00,160.00 L 440.00-32.00 L 424.00-32.00 L 416.00,128.00 L 96.00,128.00 L 88.00-32.00 Z" />
32<glyph unicode="&#xe026;" d="M 192.00,384.00L 256.00,384.00L 256.00,352.00L 192.00,352.00zM 288.00,384.00L 352.00,384.00L 352.00,352.00L 288.00,352.00zM 448.00,384.00 L 448.00,256.00 L 352.00,256.00 L 352.00,288.00 L 416.00,288.00 L 416.00,352.00 L 384.00,352.00 L 384.00,384.00 ZM 160.00,288.00L 224.00,288.00L 224.00,256.00L 160.00,256.00zM 256.00,288.00L 320.00,288.00L 320.00,256.00L 256.00,256.00zM 96.00,352.00 L 96.00,288.00 L 128.00,288.00 L 128.00,256.00 L 64.00,256.00 L 64.00,384.00 L 160.00,384.00 L 160.00,352.00 ZM 192.00,192.00L 256.00,192.00L 256.00,160.00L 192.00,160.00zM 288.00,192.00L 352.00,192.00L 352.00,160.00L 288.00,160.00zM 448.00,192.00 L 448.00,64.00 L 352.00,64.00 L 352.00,96.00 L 416.00,96.00 L 416.00,160.00 L 384.00,160.00 L 384.00,192.00 ZM 160.00,96.00L 224.00,96.00L 224.00,64.00L 160.00,64.00zM 256.00,96.00L 320.00,96.00L 320.00,64.00L 256.00,64.00zM 96.00,160.00 L 96.00,96.00 L 128.00,96.00 L 128.00,64.00 L 64.00,64.00 L 64.00,192.00 L 160.00,192.00 L 160.00,160.00 ZM 480.00,448.00 L 32.00,448.00 L 32.00,0.00 L 480.00,0.00 L 480.00,448.00 Z M 512.00,480.00 L 512.00,480.00 L 512.00-32.00 L 0.00-32.00 L 0.00,480.00 L 512.00,480.00 Z" />
33<glyph unicode="&#xe025;" d="M 224.00,192.00 L 128.00,192.00 L 128.00,256.00 L 224.00,256.00 L 224.00,352.00 L 288.00,352.00 L 288.00,256.00 L 384.00,256.00 L 384.00,192.00 L 288.00,192.00 L 288.00,96.00 L 224.00,96.00 ZM 512.00,160.00 L 512.00-32.00 L 0.00-32.00 L 0.00,160.00 L 64.00,160.00 L 64.00,32.00 L 448.00,32.00 L 448.00,160.00 Z" />
34<glyph unicode="&#xe024;" d="M 64.00,352.00l 64.00,0.00 l0.00-96.00 l 32.00,0.00 L 160.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00L 64.00,480.00 C 46.40,480.00, 32.00,465.60, 32.00,448.00l0.00-192.00 l 32.00,0.00 L 64.00,352.00 z M 64.00,448.00l 64.00,0.00 l0.00-64.00 L 64.00,384.00 L 64.00,448.00 z M 480.00,448.00L 480.00,480.00 l-96.00,0.00
35 c-17.601,0.00-32.00-14.40-32.00-32.00l0.00-160.00 c0.00-17.60, 14.399-32.00, 32.00-32.00l 96.00,0.00 l0.00,32.00 l-96.00,0.00 L 384.00,448.00 L 480.00,448.00 z M 320.00,400.00L 320.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00l-96.00,0.00 l0.00-224.00 l 96.00,0.00
36 c 17.60,0.00, 32.00,14.40, 32.00,32.00l0.00,48.00 c0.00,17.60-4.40,32.00-22.00,32.00C 315.60,368.00, 320.00,382.40, 320.00,400.00z M 288.00,288.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 288.00,288.00 z M 288.00,384.00l-64.00,0.00 L 224.00,448.00 l 64.00,0.00 L 288.00,384.00 zM 416.00,192.00 L 208.00-32.00 L 96.00,112.00 L 137.00,147.00 L 208.00,73.00 L 384.00,224.00 Z" />
37<glyph unicode="&#xe023;" d="M 512.00,480.00 L 512.00,288.00 L 442.87,357.13 L 336.87,251.13 L 283.13,304.87 L 389.13,410.87 L 320.00,480.00 ZM 122.87,410.87 L 228.87,304.87 L 175.13,251.13 L 69.13,357.13 L 0.00,288.00 L 0.00,480.00 L 192.00,480.00 ZM 442.87,90.87 L 512.00,160.00 L 512.00-32.00 L 320.00-32.00 L 389.13,37.13 L 283.13,143.13 L 336.87,196.87 ZM 228.87,143.13 L 122.87,37.13 L 192.00-32.00 L 0.00-32.00 L 0.00,160.00 L 69.13,90.87 L 175.13,196.87 Z" />
38<glyph unicode="&#xe022;" d="M 128.00,448.00L 384.00,448.00L 384.00,384.00L 128.00,384.00zM 480.00,352.00L 32.00,352.00 C 14.40,352.00,0.00,337.60,0.00,320.00l0.00-160.00 c0.00-17.60, 14.398-32.00, 32.00-32.00l 96.00,0.00 l0.00-128.00 l 256.00,0.00 L 384.00,128.00 l 96.00,0.00 c 17.60,0.00, 32.00,14.40, 32.00,32.00L 512.00,320.00
39 C 512.00,337.60, 497.60,352.00, 480.00,352.00z M 352.00,32.00L 160.00,32.00 L 160.00,192.00 l 192.00,0.00 L 352.00,32.00 z M 487.20,304.00c0.00-12.813-10.387-23.20-23.199-23.20
40 c-12.813,0.00-23.201,10.387-23.201,23.20s 10.388,23.20, 23.201,23.20C 476.814,327.20, 487.20,316.813, 487.20,304.00z" />
41<glyph unicode="&#xe021;" d="M 256.00,480.00C 114.615,480.00,0.00,365.386,0.00,224.00c0.00-141.385, 114.614-256.00, 256.00-256.00c 141.385,0.00, 256.00,114.615, 256.00,256.00
42 C 512.00,365.386, 397.385,480.00, 256.00,480.00z M 256.00,8.00c-119.293,0.00-216.00,96.706-216.00,216.00c0.00,119.293, 96.707,216.00, 216.00,216.00c 119.295,0.00, 216.00-96.707, 216.00-216.00
43 C 472.00,104.706, 375.295,8.00, 256.00,8.00z M 192.00,320.00c0.00-17.673-14.327-32.00-32.00-32.00s-32.00,14.327-32.00,32.00s 14.327,32.00, 32.00,32.00S 192.00,337.673, 192.00,320.00z
44 M 384.00,320.00c0.00-17.673-14.326-32.00-32.00-32.00s-32.00,14.327-32.00,32.00s 14.326,32.00, 32.00,32.00S 384.00,337.673, 384.00,320.00zM 256.00,154.00 C 326.537,154.00 387.344,182.766 415.231,215.596 C 404.795,129.986 337.087,64.00 256.00,64.00 C 174.941,64.00 107.251,130.013 96.778,215.584 C 124.671,182.761 185.471,154.00 256.00,154.00 Z" />
45<glyph unicode="&#xe020;" d="M 352.00,32.00 L 480.00,32.00 L 512.00,96.00 L 512.00-32.00 L 320.00-32.00 L 320.00,75.107 C 385.556,103.349 432.00,173.688 432.00,256.00 C 432.00,363.216 353.201,447.133 256.00,447.133 C 158.797,447.133 80.00,363.217 80.00,256.00 C 80.00,173.688 126.443,103.349 192.00,75.107 L 192.00-32.00 L 0.00-32.00 L 0.00,96.00 L 32.00,32.00 L 160.00,32.00 L 160.00,48.295 C 66.185,81.525 0.00,161.996 0.00,256.00 C 0.00,379.712 114.615,480.00 256.00,480.00 C 397.385,480.00 512.00,379.712 512.00,256.00 C 512.00,161.996 445.815,81.525 352.00,48.295 L 352.00,32.00 Z" />
46<glyph unicode="&#xe01f;" d="M 384.00,377.00 L 384.00,352.00 L 448.00,352.00 L 448.00,320.00 L 352.00,320.00 L 352.00,393.00 L 416.00,423.00 L 416.00,448.00 L 352.00,448.00 L 352.00,480.00 L 448.00,480.00 L 448.00,407.00 ZM 338.00,352.00L 270.00,352.00L 176.00,258.00L 82.00,352.00L 14.00,352.00L 142.00,224.00L 14.00,96.00L 82.00,96.00L 176.00,190.00L 270.00,96.00L 338.00,96.00L 210.00,224.00 z" />
47<glyph unicode="&#xe01e;" d="M 384.00,25.00 L 384.00,0.00 L 448.00,0.00 L 448.00-32.00 L 352.00-32.00 L 352.00,41.00 L 416.00,71.00 L 416.00,96.00 L 352.00,96.00 L 352.00,128.00 L 448.00,128.00 L 448.00,55.00 ZM 338.00,352.00L 270.00,352.00L 176.00,258.00L 82.00,352.00L 14.00,352.00L 142.00,224.00L 14.00,96.00L 82.00,96.00L 176.00,190.00L 270.00,96.00L 338.00,96.00L 210.00,224.00 z" />
48<glyph unicode="&#xe01d;" d="M0.00,32.00L 288.00,32.00L 288.00-32.00L0.00-32.00zM 96.00,480.00L 448.00,480.00L 448.00,416.00L 96.00,416.00zM 138.694,64.00 L 241.038,456.082 L 302.963,439.918 L 204.838,64.00 ZM 464.887-32.00 L 400.00,32.887 L 335.113-32.00 L 304.00-0.887 L 368.887,64.00 L 304.00,128.887 L 335.113,160.00 L 400.00,95.113 L 464.887,160.00 L 496.00,128.887 L 431.113,64.00 L 496.00-0.887 Z" />
49<glyph unicode="&#xe01c;" d="M0.00,256.00L 512.00,256.00L 512.00,192.00L0.00,192.00z" />
50<glyph unicode="&#xe01b;" d="M0.00,448.00l0.00-448.00 l 512.00,0.00 L 512.00,448.00 L0.00,448.00 z M 192.00,160.00l0.00,96.00 l 128.00,0.00 l0.00-96.00 L 192.00,160.00 z M 320.00,128.00l0.00-96.00 L 192.00,32.00 l0.00,96.00 L 320.00,128.00 z M 320.00,384.00l0.00-96.00 L 192.00,288.00 L 192.00,384.00 L 320.00,384.00 z M 160.00,384.00l0.00-96.00 L 32.00,288.00 L 32.00,384.00 L 160.00,384.00 z
51 M 32.00,256.00l 128.00,0.00 l0.00-96.00 L 32.00,160.00 L 32.00,256.00 z M 352.00,256.00l 128.00,0.00 l0.00-96.00 L 352.00,160.00 L 352.00,256.00 z M 352.00,288.00L 352.00,384.00 l 128.00,0.00 l0.00-96.00 L 352.00,288.00 z M 32.00,128.00l 128.00,0.00 l0.00-96.00 L 32.00,32.00 L 32.00,128.00 z M 352.00,32.00l0.00,96.00 l 128.00,0.00 l0.00-96.00 L 352.00,32.00 z" />
52<glyph unicode="&#xe01a;" d="M 161.009,64.00l 28.80,96.00l 132.382,0.00 l 28.80-96.00l 56.816,0.00 L 311.809,384.00L 200.191,384.00 l-96.00-320.00L 161.009,64.00 z M 237.809,320.00l 36.382,0.00 l 28.80-96.00l-93.982,0.00
53 L 237.809,320.00z" />
54<glyph unicode="&#xe019;" d="M 256.00,320.00C 151.316,320.00, 58.378,269.722,0.00,192.00c 58.378-77.723, 151.316-128.00, 256.00-128.00c 104.684,0.00, 197.622,50.277, 256.00,128.00
55 C 453.622,269.722, 360.684,320.00, 256.00,320.00z M 224.00,256.00c 17.673,0.00, 32.00-14.327, 32.00-32.00s-14.327-32.00-32.00-32.00s-32.00,14.327-32.00,32.00S 206.327,256.00, 224.00,256.00z
56 M 386.808,127.352c-19.824-10.129-40.826-17.931-62.423-23.188C 302.141,98.746, 279.134,96.00, 256.00,96.00
57 c-23.133,0.00-46.141,2.746-68.384,8.162c-21.597,5.259-42.599,13.061-62.423,23.188c-31.51,16.101-60.111,38.205-83.82,64.649
58 c 23.709,26.444, 52.31,48.55, 83.82,64.649c 16.168,8.261, 33.121,14.973, 50.541,20.02C 165.79,261.547, 160.00,243.451, 160.00,224.00
59 c0.00-53.02, 42.981-96.00, 96.00-96.00c 53.019,0.00, 96.00,42.98, 96.00,96.00c0.00,19.451-5.791,37.547-15.733,52.67c 17.419-5.048, 34.372-11.76, 50.541-20.021
60 c 31.511-16.099, 60.109-38.204, 83.819-64.649C 446.917,165.557, 418.318,143.45, 386.808,127.352z M 430.459,358.139
61 C 376.099,385.916, 317.403,400.00, 256.00,400.00c-61.403,0.00-120.099-14.084-174.459-41.861C 52.155,343.123, 24.675,324.187,0.00,302.101l0.00-54.603
62 c 27.669,29.283, 60.347,53.877, 96.097,72.145C 145.907,345.095, 199.706,358.00, 256.00,358.00s 110.093-12.905, 159.902-38.358
63 c 35.751-18.268, 68.429-42.862, 96.098-72.145L 512.00,302.10 C 487.325,324.187, 459.846,343.123, 430.459,358.139z" />
64<glyph unicode="&#xe018;" d="M 256.00,384.00C 149.962,384.00, 64.00,298.039, 64.00,192.00s 85.961-192.00, 192.00-192.00c 106.037,0.00, 192.00,85.961, 192.00,192.00S 362.037,384.00, 256.00,384.00z
65 M 357.822,90.177C 330.626,62.979, 294.464,48.00, 256.00,48.00s-74.625,14.979-101.823,42.177C 126.979,117.374, 112.00,153.536, 112.00,192.00
66 s 14.979,74.625, 42.177,101.823C 181.375,321.021, 217.536,336.00, 256.00,336.00s 74.626-14.979, 101.821-42.177
67 C 385.022,266.625, 400.00,230.464, 400.00,192.00S 385.021,117.374, 357.822,90.177zM 162.965,378.069l-21.47,42.939C 92.058,396.24, 51.76,355.942, 26.992,306.504l 42.938-21.47
68 C 90.054,325.202, 122.796,357.945, 162.965,378.069zM 442.067,285.035l 42.939,21.469C 460.24,355.942, 419.943,396.24, 370.504,421.008l-21.472-42.939
69 C 389.201,357.945, 421.944,325.203, 442.067,285.035zM 256.00,288.00l-32.00,0.00 l0.00-96.00 c0.00-5.055, 2.35-9.555, 6.011-12.486l-0.006-0.008l 80.00-64.00l 19.988,24.988L 256.00,199.689L 256.00,288.00 z" />
70<glyph unicode="&#xe017;" d="M 160.00,352.00L 32.00,224.00L 160.00,96.00L 224.00,96.00L 96.00,224.00L 224.00,352.00 zM 352.00,352.00L 288.00,352.00L 416.00,224.00L 288.00,96.00L 352.00,96.00L 480.00,224.00 z" />
71<glyph unicode="&#xe016;" d="M 224.00,128.00L 288.00,128.00L 288.00,64.00L 224.00,64.00zM 352.00,352.00 C 369.673,352.00 384.00,337.673 384.00,320.00 L 384.00,224.00 L 288.00,160.00 L 224.00,160.00 L 224.00,192.00 L 320.00,256.00 L 320.00,288.00 L 160.00,288.00 L 160.00,352.00 L 352.00,352.00 ZM 256.00,432.00 C 200.441,432.00 148.208,410.364 108.922,371.078 C 69.636,331.792 48.00,279.559 48.00,224.00 C 48.00,168.441 69.636,116.208 108.922,76.922 C 148.208,37.636 200.441,16.00 256.00,16.00 C 311.559,16.00 363.792,37.636 403.078,76.922 C 442.364,116.208 464.00,168.441 464.00,224.00 C 464.00,279.559 442.364,331.792 403.078,371.078 C 363.792,410.364 311.559,432.00 256.00,432.00 Z M 256.00,480.00 L 256.00,480.00 C 397.385,480.00 512.00,365.385 512.00,224.00 C 512.00,82.615 397.385-32.00 256.00-32.00 C 114.615-32.00 0.00,82.615 0.00,224.00 C 0.00,365.385 114.615,480.00 256.00,480.00 Z" />
72<glyph unicode="&#xe015;" d="M0.00,416.00l0.00-384.00 l 512.00,0.00 L 512.00,416.00 L0.00,416.00 z M 96.00,64.00L 32.00,64.00 l0.00,64.00 l 64.00,0.00 L 96.00,64.00 z M 96.00,192.00L 32.00,192.00 l0.00,64.00 l 64.00,0.00 L 96.00,192.00 z M 96.00,320.00L 32.00,320.00 L 32.00,384.00 l 64.00,0.00 L 96.00,320.00 z M 384.00,64.00L 128.00,64.00 L 128.00,384.00 l 256.00,0.00 L 384.00,64.00 z
73 M 480.00,64.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 480.00,64.00 z M 480.00,192.00l-64.00,0.00 l0.00,64.00 l 64.00,0.00 L 480.00,192.00 z M 480.00,320.00l-64.00,0.00 L 416.00,384.00 l 64.00,0.00 L 480.00,320.00 zM 192.00,320.00L 192.00,128.00L 320.00,224.00 z" />
74<glyph unicode="&#xe014;" d="M0.00,416.00l0.00-416.00 l 512.00,0.00 L 512.00,416.00 L0.00,416.00 z M 480.00,32.00L 32.00,32.00 L 32.00,384.00 l 448.00,0.00 L 480.00,32.00 zM 352.00,304.00A48.00,48.00 1620.00 1,0 448.00,304A48.00,48.00 1620.00 1,0 352.00,304zM 448.00,64.00 L 64.00,64.00 L 160.00,320.00 L 288.00,160.00 L 352.00,208.00 Z" />
75<glyph unicode="&#xe013;" d="M 96.00,480.00l0.00-512.00 l 160.00,160.00l 160.00-160.00L 416.00,480.00 L 96.00,480.00 z M 384.00,45.255l-128.00,128.00l-128.00-128.00L 128.00,448.00 l 256.00,0.00 L 384.00,45.255 z" />
76<glyph unicode="&#xe012;" d="M 238.444,142.443c 2.28-4.524, 3.495-9.579, 3.495-14.848c0.00-8.808-3.372-17.029-9.496-23.154l-81.69-81.69
77 c-6.124-6.124-14.348-9.496-23.154-9.496s-17.03,3.372-23.154,9.496l-49.69,49.69c-6.124,6.125-9.496,14.348-9.496,23.154
78 s 3.372,17.03, 9.496,23.154l 81.69,81.691c 6.124,6.123, 14.348,9.496, 23.154,9.496c 5.269,0.00, 10.322-1.215, 14.848-3.494l 32.669,32.668
79 c-13.935,10.705-30.72,16.08-47.517,16.08c-19.993,0.00-39.986-7.583-55.154-22.751l-81.69-81.691
80 c-30.335-30.335-30.335-79.975,0.00-110.309l 49.69-49.691c 15.167-15.166, 35.16-22.75, 55.153-22.75
81 c 19.994,0.00, 39.987,7.584, 55.154,22.751l 81.69,81.69c 27.91,27.91, 30.119,72.149, 6.672,102.673L 238.444,142.443zM 489.248,407.558l-49.69,49.691C 424.391,472.417, 404.398,480.00, 384.404,480.00c-19.993,0.00-39.985-7.583-55.153-22.751l-81.691-81.691
82 c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0.00,8.808, 3.372,17.03, 9.496,23.154
83 l 81.691,81.691c 6.123,6.124, 14.347,9.497, 23.153,9.497c 8.808,0.00, 17.03-3.373, 23.154-9.497l 49.69-49.691
84 c 6.124-6.124, 9.496-14.347, 9.496-23.154c0.00-8.807-3.372-17.03-9.496-23.154l-81.69-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
85 c-5.268,0.00-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.08, 47.517-16.08c 19.994,0.00, 39.987,7.584, 55.154,22.752
86 l 81.69,81.69C 519.584,327.584, 519.584,377.223, 489.248,407.558zM 116.684,340.688L 20.687,436.685L 43.315,459.313L 139.312,363.316zM 192.00,480.00L 224.00,480.00L 224.00,384.00L 192.00,384.00zM0.00,288.00L 96.00,288.00L 96.00,256.00L0.00,256.00zM 395.316,107.312L 491.314,11.314L 468.686-11.314L 372.688,84.684zM 288.00,64.00L 320.00,64.00L 320.00-32.00L 288.00-32.00zM 416.00,192.00L 512.00,192.00L 512.00,160.00L 416.00,160.00z" />
87<glyph unicode="&#xe011;" d="M 160.00,128.00c 8.80-8.80, 23.637-8.363, 32.971,0.971L 351.03,287.029C 360.364,296.363, 360.80,311.20, 352.00,320.00
88 s-23.637,8.363-32.971-0.971L 160.971,160.971C 151.637,151.637, 151.20,136.80, 160.00,128.00zM 238.444,142.444c 2.28-4.525, 3.495-9.58, 3.495-14.848c0.00-8.808-3.372-17.03-9.496-23.154l-81.691-81.691
89 c-6.124-6.124-14.347-9.496-23.154-9.496s-17.03,3.372-23.154,9.496l-49.691,49.691c-6.124,6.124-9.496,14.347-9.496,23.154
90 s 3.372,17.03, 9.496,23.154l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497c 5.268,0.00, 10.322-1.215, 14.848-3.495l 32.669,32.669
91 c-13.935,10.705-30.72,16.08-47.517,16.08c-19.993,0.00-39.986-7.583-55.154-22.751l-81.691-81.691
92 c-30.335-30.335-30.335-79.974,0.00-110.309l 49.691-49.691C 87.611-24.416, 107.604-32.00, 127.597-32.00
93 c 19.994,0.00, 39.987,7.584, 55.154,22.751l 81.691,81.691c 27.91,27.91, 30.119,72.149, 6.672,102.672L 238.444,142.444zM 489.249,407.558l-49.691,49.691C 424.391,472.417, 404.398,480.00, 384.404,480.00c-19.993,0.00-39.986-7.583-55.154-22.751l-81.691-81.691
94 c-27.91-27.91-30.119-72.149-6.671-102.671l 32.669,32.67c-2.279,4.525-3.494,9.58-3.494,14.847c0.00,8.808, 3.372,17.03, 9.496,23.154
95 l 81.691,81.691c 6.124,6.124, 14.347,9.497, 23.154,9.497s 17.03-3.373, 23.154-9.497l 49.691-49.691
96 c 6.124-6.124, 9.496-14.347, 9.496-23.154s-3.372-17.03-9.496-23.154l-81.691-81.691c-6.124-6.124-14.347-9.496-23.154-9.496
97 c-5.268,0.00-10.322,1.215-14.848,3.495l-32.669-32.669c 13.936-10.705, 30.72-16.08, 47.517-16.08c 19.994,0.00, 39.987,7.584, 55.154,22.751
98 l 81.691,81.691C 519.584,327.584, 519.584,377.223, 489.249,407.558z" />
99<glyph unicode="&#xe010;" d="M 288.00,355.814L 288.00,480.00 l 192.00-192.00L 288.00,96.00L 288.00,222.912 C 64.625,228.153, 74.206,71.016, 131.07-32.00
100 C-9.286,119.707, 20.52,362.785, 288.00,355.814z" />
101<glyph unicode="&#xe00f;" d="M 380.931-32.00C 437.794,71.016, 447.375,228.153, 224.00,222.912L 224.00,96.00 L 32.00,288.00L 224.00,480.00l0.00-124.186
102 C 491.481,362.785, 521.285,119.707, 380.931-32.00z" />
103<glyph unicode="&#xe00e;" d="M 112.50,256.00 C 174.356,256.00 224.50,205.855 224.50,144.00 C 224.50,82.144 174.356,32.00 112.50,32.00 C 50.644,32.00 0.50,82.144 0.50,144.00 L 0.00,160.00 C 0.00,283.712 100.288,384.00 224.00,384.00 L 224.00,320.00 C 181.263,320.00 141.083,303.357 110.863,273.137 C 105.046,267.319 99.737,261.129 94.948,254.627 C 100.667,255.527 106.528,256.00 112.50,256.00 ZM 400.50,256.00 C 462.355,256.00 512.50,205.855 512.50,144.00 C 512.50,82.144 462.355,32.00 400.50,32.00 C 338.645,32.00 288.50,82.144 288.50,144.00 L 288.00,160.00 C 288.00,283.712 388.288,384.00 512.00,384.00 L 512.00,320.00 C 469.263,320.00 429.083,303.357 398.863,273.137 C 393.045,267.319 387.736,261.129 382.947,254.627 C 388.667,255.527 394.527,256.00 400.50,256.00 Z" />
104<glyph unicode="&#xe00d;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM 192.00,352.00L 512.00,352.00L 512.00,288.00L 192.00,288.00zM 192.00,256.00L 512.00,256.00L 512.00,192.00L 192.00,192.00zM 192.00,160.00L 512.00,160.00L 512.00,96.00L 192.00,96.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00zM 128.00,320.00 L 128.00,128.00 L 0.00,224.00 Z" />
105<glyph unicode="&#xe00c;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM 192.00,352.00L 512.00,352.00L 512.00,288.00L 192.00,288.00zM 192.00,256.00L 512.00,256.00L 512.00,192.00L 192.00,192.00zM 192.00,160.00L 512.00,160.00L 512.00,96.00L 192.00,96.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00zM 0.00,128.00 L 0.00,320.00 L 128.00,224.00 Z" />
106<glyph unicode="&#xe00b;" d="M 192.00,64.00L 512.00,64.00L 512.00,0.00L 192.00,0.00zM 192.00,256.00L 512.00,256.00L 512.00,192.00L 192.00,192.00zM 192.00,448.00L 512.00,448.00L 512.00,384.00L 192.00,384.00zM 96.00,480.00 L 96.00,352.00 L 64.00,352.00 L 64.00,448.00 L 32.00,448.00 L 32.00,480.00 ZM 64.00,217.00 L 64.00,192.00 L 128.00,192.00 L 128.00,160.00 L 32.00,160.00 L 32.00,233.00 L 96.00,263.00 L 96.00,288.00 L 32.00,288.00 L 32.00,320.00 L 128.00,320.00 L 128.00,247.00 ZM 128.00,128.00 L 128.00-32.00 L 32.00-32.00 L 32.00,0.00 L 96.00,0.00 L 96.00,32.00 L 32.00,32.00 L 32.00,64.00 L 96.00,64.00 L 96.00,96.00 L 32.00,96.00 L 32.00,128.00 Z" />
107<glyph unicode="&#xe00a;" d="M 192.00,448.00l 320.00,0.00 l0.00-64.00 L 192.00,384.00 L 192.00,448.00 z M 192.00,256.00l 320.00,0.00 l0.00-64.00 L 192.00,192.00 L 192.00,256.00 z M 192.00,64.00l 320.00,0.00 l0.00-64.00 L 192.00,0.00 L 192.00,64.00 zM0.00,416.00A64.00,64.00 1620.00 1,0 128.00,416A64.00,64.00 1620.00 1,0 0.00,416zM0.00,224.00A64.00,64.00 1620.00 1,0 128.00,224A64.00,64.00 1620.00 1,0 0.00,224zM0.00,32.00A64.00,64.00 1620.00 1,0 128.00,32A64.00,64.00 1620.00 1,0 0.00,32z" />
108<glyph unicode="&#xe009;" d="M 32.00,480.00L 224.00,480.00L 224.00,448.00L 32.00,448.00zM 288.00,480.00L 480.00,480.00L 480.00,448.00L 288.00,448.00zM 476.00,320.00l-28.00,0.00 L 448.00,448.00 L 320.00,448.00 l0.00-128.00 L 192.00,320.00 L 192.00,448.00 L 64.00,448.00 l0.00-128.00 L 36.00,320.00 c-19.80,0.00-36.00-16.20-36.00-36.00l0.00-280.00 c0.00-19.80, 16.20-36.00, 36.00-36.00l 152.00,0.00 c 19.80,0.00, 36.00,16.20, 36.00,36.00L 224.00,192.00 l 64.00,0.00
109 l0.00-188.00 c0.00-19.80, 16.20-36.00, 36.00-36.00l 152.00,0.00 c 19.80,0.00, 36.00,16.20, 36.00,36.00L 512.00,284.00 C 512.00,303.80, 495.80,320.00, 476.00,320.00z M 174.00,0.00L 50.00,0.00 c-9.90,0.00-18.00,7.20-18.00,16.00
110 s 8.10,16.00, 18.00,16.00l 124.00,0.00 c 9.90,0.00, 18.00-7.20, 18.00-16.00S 183.90,0.00, 174.00,0.00z M 272.00,224.00l-32.00,0.00 c-8.80,0.00-16.00,7.20-16.00,16.00s 7.20,16.00, 16.00,16.00l 32.00,0.00 c 8.80,0.00, 16.00-7.20, 16.00-16.00
111 S 280.80,224.00, 272.00,224.00z M 462.00,0.00L 338.00,0.00 c-9.90,0.00-18.00,7.20-18.00,16.00s 8.10,16.00, 18.00,16.00l 124.00,0.00 c 9.90,0.00, 18.00-7.20, 18.00-16.00S 471.90,0.00, 462.00,0.00z" />
112<glyph unicode="&#xe008;" d="M 416.00,320.00L 416.00,400.00 c0.00,8.80-7.20,16.00-16.00,16.00L 288.00,416.00 L 288.00,448.00 c0.00,17.60-14.40,32.00-32.00,32.00l-64.00,0.00 c-17.602,0.00-32.00-14.40-32.00-32.00l0.00-32.00 L 48.00,416.00 c-8.801,0.00-16.00-7.20-16.00-16.00l0.00-320.00
113 c0.00-8.80, 7.199-16.00, 16.00-16.00l 144.00,0.00 l0.00-96.00 l 224.00,0.00 l 96.00,96.00L 512.00,320.00 L 416.00,320.00 z M 192.00,447.943c 0.017,0.019, 0.036,0.039, 0.057,0.057l 63.884,0.00
114 c 0.021-0.018, 0.041-0.038, 0.059-0.057L 256.00,416.00 l-64.00,0.00 L 192.00,447.943 z M 96.00,352.00L 96.00,384.00 l 256.00,0.00 l0.00-32.00 L 96.00,352.00 z M 416.00,13.255L 416.00,64.00 l 50.745,0.00 L 416.00,13.255z M 480.00,96.00l-96.00,0.00 l0.00-96.00
115 L 224.00,0.00 L 224.00,288.00 l 256.00,0.00 L 480.00,96.00 z" />
116<glyph unicode="&#xe007;" d="M 445.387,125.423c-22.827,22.778-51.864,34.536-78.973,34.536l-14.556,0.00 l-31.952,32.004l 127.81,128.019
117 c 31.952,32.005, 31.952,96.014,0.00,128.019L 256.001,255.973L 64.285,448.00c-31.952-32.004-31.952-96.014,0.00-128.019l 127.811-128.017
118 l-31.953-32.004l-14.557,0.00 c-27.11,0.00-56.146-11.759-78.974-34.538c-40.811-40.721-46.325-101.242-12.315-135.175
119 C 69.282-24.704, 89.441-32.00, 110.795-32.00c 27.108,0.00, 56.145,11.757, 78.973,34.536c 26.792,26.732, 38.371,62.00, 33.542,92.674l 32.692,32.744
120 l 32.688-32.744c-4.828-30.674, 6.753-65.941, 33.542-92.674C 345.063-20.243, 374.098-32.00, 401.206-32.00
121 c 21.354,0.00, 41.512,7.296, 56.497,22.248C 491.713,24.181, 486.197,84.702, 445.387,125.423z M 176.512,57.231
122 c-3.849-8.941-9.505-17.173-16.813-24.463c-7.318-7.302-15.586-12.959-24.574-16.812c-8.066-3.458-16.48-5.284-24.331-5.284
123 c-7.573,0.00-18.306,1.701-26.431,9.806c-8.068,8.052-9.76,18.659-9.76,26.144c0.00,7.771, 1.821,16.105, 5.263,24.106
124 c 3.85,8.942, 9.507,17.173, 16.813,24.463c 7.317,7.303, 15.586,12.957, 24.575,16.812c 8.067,3.457, 16.48,5.284, 24.332,5.284
125 c 7.573,0.00, 18.306-1.70, 26.429-9.807c 8.067-8.049, 9.761-18.658, 9.761-26.142C 181.777,73.567, 179.957,65.23, 176.512,57.231z
126 M 256.002,146.702c-24.957,0.00-45.188,20.266-45.188,45.263c0.00,24.996, 20.231,45.26, 45.188,45.26s 45.186-20.264, 45.186-45.26
127 C 301.188,166.966, 280.958,146.702, 256.002,146.702z M 427.636,20.479c-8.124-8.104-18.856-9.806-26.43-9.806
128 c-7.852,0.00-16.265,1.826-24.333,5.284c-8.986,3.853-17.254,9.51-24.571,16.812c-7.307,7.29-12.963,15.521-16.813,24.463
129 c-3.443,7.999-5.263,16.336-5.263,24.106c0.00,7.483, 1.692,18.094, 9.76,26.143c 8.123,8.104, 18.856,9.807, 26.43,9.807
130 c 7.85,0.00, 16.265-1.827, 24.33-5.284c 8.989-3.854, 17.258-9.509, 24.575-16.812c 7.305-7.29, 12.962-15.521, 16.813-24.463
131 c 3.442-7.999, 5.263-16.335, 5.263-24.106C 437.396,39.138, 435.702,28.53, 427.636,20.479z" />
132<glyph unicode="&#xe006;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM0.00,352.00L 512.00,352.00L 512.00,288.00L0.00,288.00zM0.00,256.00L 512.00,256.00L 512.00,192.00L0.00,192.00zM0.00,160.00L 512.00,160.00L 512.00,96.00L0.00,96.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00z" />
133<glyph unicode="&#xe005;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM 192.00,352.00L 512.00,352.00L 512.00,288.00L 192.00,288.00zM 192.00,160.00L 512.00,160.00L 512.00,96.00L 192.00,96.00zM0.00,256.00L 512.00,256.00L 512.00,192.00L0.00,192.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00z" />
134<glyph unicode="&#xe004;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM 96.00,352.00L 416.00,352.00L 416.00,288.00L 96.00,288.00zM 96.00,160.00L 416.00,160.00L 416.00,96.00L 96.00,96.00zM0.00,256.00L 512.00,256.00L 512.00,192.00L0.00,192.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00z" />
135<glyph unicode="&#xe003;" d="M0.00,448.00L 512.00,448.00L 512.00,384.00L0.00,384.00zM0.00,352.00L 320.00,352.00L 320.00,288.00L0.00,288.00zM0.00,160.00L 320.00,160.00L 320.00,96.00L0.00,96.00zM0.00,256.00L 512.00,256.00L 512.00,192.00L0.00,192.00zM0.00,64.00L 512.00,64.00L 512.00,0.00L0.00,0.00z" />
136<glyph unicode="&#xe002;" d="M 512.00,183.771l0.00,80.458 l-79.572,7.957c-4.093,15.021-10.044,29.274-17.605,42.49l 52.298,63.919L 410.595,435.12l-63.918-52.298
137 c-13.217,7.562-27.471,13.513-42.491,17.604L 296.229,480.00l-80.458,0.00 l-7.957-79.573c-15.021-4.093-29.274-10.043-42.49-17.604
138 L 101.405,435.12L 44.88,378.595l 52.298-63.918c-7.562-13.216-13.513-27.47-17.605-42.49L0.00,264.229l0.00-80.458 l 79.573-7.957
139 c 4.093-15.021, 10.043-29.274, 17.605-42.491L 44.88,69.405l 56.524-56.524l 63.919,52.298c 13.216-7.562, 27.47-13.514, 42.49-17.605
140 L 215.771-32.00l 80.458,0.00 l 7.957,79.572c 15.021,4.093, 29.274,10.044, 42.491,17.605l 63.918-52.298l 56.524,56.524l-52.298,63.918
141 c 7.562,13.217, 13.514,27.471, 17.605,42.49L 512.00,183.771z M 352.00,192.00l-64.00-64.00l-64.00,0.00 l-64.00,64.00l0.00,64.00 l 64.00,64.00l 64.00,0.00 l 64.00-64.00L 352.00,192.00 z" />
142<glyph unicode="&#xe001;" d="M 451.716,380.285l-71.432,71.431C 364.728,467.272, 334.00,480.00, 312.00,480.00L 72.00,480.00 C 50.00,480.00, 32.00,462.00, 32.00,440.00l0.00-432.00 c0.00-22.00, 18.00-40.00, 40.00-40.00l 368.00,0.00 c 22.00,0.00, 40.00,18.00, 40.00,40.00
143 L 480.00,312.00 C 480.00,334.00, 467.272,364.729, 451.716,380.285z M 429.089,357.657c 1.565-1.565, 3.125-3.487, 4.64-5.657L 352.00,352.00 L 352.00,433.728
144 c 2.17-1.515, 4.092-3.075, 5.657-4.64L 429.089,357.657z M 448.00,8.00c0.00-4.336-3.664-8.00-8.00-8.00L 72.00,0.00 c-4.336,0.00-8.00,3.664-8.00,8.00L 64.00,440.00 c0.00,4.336, 3.664,8.00, 8.00,8.00
145 l 240.00,0.00 c 2.416,0.00, 5.127-0.305, 8.00-0.852L 320.00,320.00 l 127.148,0.00 c 0.547-2.873, 0.852-5.583, 0.852-8.00L 448.00,8.00 z" />
146<glyph unicode="&#xe000;" d="M 448.00,480.00L0.00,480.00 l0.00-512.00 l 512.00,0.00 L 512.00,416.00 L 448.00,480.00z M 256.00,416.00l 64.00,0.00 l0.00-128.00 l-64.00,0.00 L 256.00,416.00 z M 448.00,32.00L 64.00,32.00 L 64.00,416.00 l 32.00,0.00 l0.00-160.00 l 288.00,0.00 L 384.00,416.00 l 37.489,0.00 L 448.00,389.491L 448.00,32.00 z" />
147<glyph unicode="&#xe033;" d="M 64.00,208.00L 208.00,64.00L 448.00,304.00L 384.00,368.00L 208.00,192.00L 128.00,272.00 z" />
148<glyph unicode="&#x20;" horiz-adv-x="256" />
149<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
150</font></defs></svg>
  
1Icons are generated and provided by the http://icomoon.io service.
  
1.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#000;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scrollbar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:whiteSmoke;border-top:1px solid #DDD;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #c5c5c5;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid #59a5e1;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:#59a5e1;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox *:focus{border-color:#59a5e1;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.mce-fieldset{border:0 solid #9e9e9e;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret{border-left-color:#FFF}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#FFF;border:1px solid #CCC;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-textbox{background:#FFF;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB}
  
1.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#000;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scrollbar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:whiteSmoke;border-top:1px solid #DDD;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #c5c5c5;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid #59a5e1;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:#59a5e1;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox *:focus{border-color:#59a5e1;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.mce-fieldset{border:0 solid #9e9e9e;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret{border-left-color:#FFF}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#FFF;border:1px solid #CCC;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-textbox{background:#FFF;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'icomoon';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'icomoon';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = this.currentStyle['-ie7-icon'].substr(1,1)+'&nbsp;')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-inserttime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB}
  
1.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#000;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scrollbar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible!important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#FFF;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:whiteSmoke;border-top:1px solid #DDD;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:0;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-btn-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #c5c5c5;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid #59a5e1;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:#59a5e1;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox *:focus{border-color:#59a5e1;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.mce-fieldset{border:0 solid #9e9e9e;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret{border-left-color:#FFF}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#FFF;border:1px solid #CCC;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#c5c5c5;border-right-color:#c5c5c5}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-textbox{background:#FFF;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);display:inline-block;-webkit-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB}
  
1tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var r,i=[];if(t)return c(t.split(/[ ,]/),function(t){function n(){var n=e.selection;"bullist"==o&&n.selectorChanged("ul > li",function(e,n){for(var r,i=n.parents.length;i--&&(r=n.parents[i].nodeName,"OL"!=r&&"UL"!=r););t.active("UL"==r)}),"numlist"==o&&n.selectorChanged("ol > li",function(e,n){for(var r,i=n.parents.length;i--&&(r=n.parents[i].nodeName,"OL"!=r&&"UL"!=r););t.active("OL"==r)}),t.settings.stateSelector&&n.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&n.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var o;"|"==t?r=null:l.has(t)?(t={type:t},s.toolbar_items_size&&(t.size=s.toolbar_items_size),i.push(t),r=null):(r||(r={type:"buttongroup",items:[]},i.push(r)),e.buttons[t]&&(o=t,t=e.buttons[o],t.type=t.type||"button",s.toolbar_items_size&&(t.size=s.toolbar_items_size),t=l.create(t),r.items.push(t),e.initialized?n():e.on("init",n)))}),n.push({type:"toolbar",layout:"flow",items:i}),!0}for(var n=[],r=1;10>r&&t(s["toolbar"+r]);r++);return n.length||t(s.toolbar||f),n}function n(){function t(t){var n;return"|"==t?{text:"|"}:n=e.menuItems[t]}function n(n){var r,i,o,a;if(s.menu?(i=s.menu[n],a=!0):i=d[n],i){r={text:i.title},o=[],c((i.items||"").split(/[ ,]/),function(e){var n=t(e);n&&o.push(t(e))}),a||c(e.menuItems,function(e){e.context==n&&("before"==e.separator&&o.push({text:"|"}),e.prependToContext?o.unshift(e):o.push(e),"after"==e.separator&&o.push({text:"|"}))});for(var l=0;o.length>l;l++)"|"==o[l].text&&(0===l||l==o.length-1)&&o.splice(l,1);if(r.menu=o,!r.menu.length)return null}return r}var r=[],i=s.menubar?tinymce.makeMap(s.menubar,/[ ,]/):!1;for(var o in d)(!i||i[o])&&(o=n(o),o&&r.push(o));return r}function r(t){function n(e){var n=t.find(e)[0];n&&n.focus()}e.shortcuts.add("Alt+F9","",function(){n("menubar")}),e.shortcuts.add("Alt+F10","",function(){n("toolbar")}),e.shortcuts.add("Alt+F11","",function(){n("elementpath")}),t.on("cancel",function(){e.focus()})}function i(){function i(){if(f&&f.visible()){var t=u.getPos(e.getBody());f.moveTo(t.x,t.y-f.layoutRect().h)}}function o(){f&&(f.show(),i(),u.addClass(e.getBody(),"mce-edit-focus"))}function c(){f&&(f.hide(),u.removeClass(e.getBody(),"mce-edit-focus"),document.activeElement&&-1==document.activeElement.className.indexOf("mce-content-body")&&u.setStyle(document.body,"padding-top",0))}function d(){return f?(f.visible()||o(),void 0):(f=a.panel=l.create({type:"floatpanel",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",autohide:!1,autofix:!0,border:1,items:[s.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},{type:"panel",name:"toolbar",layout:"stack",items:t()}]}),f.renderTo(document.body).reflow(),r(f),o(),e.on("nodeChange",i),e.on("activate",o),e.on("deactivate",c),void 0)}var f;return s.content_editable=!0,e.on("focus",d),e.on("blur",c),e.on("remove",function(){f.remove(),f=null}),{}}function o(i){var o;return o=a.panel=l.create({type:"panel",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[s.menubar===!1?null:{type:"menubar",border:"0 0 1 0",items:n()},{type:"panel",layout:"stack",items:t()},{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",html:"",border:"1 0 0 0"}]}),s.statusbar!==!1&&o.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",items:[{type:"elementpath"},s.resize!==!1?{type:"resizehandle",editor:e}:null]}),o.renderBefore(i.targetNode).reflow(),s.width&&tinymce.DOM.setStyle(o.getEl(),"width",s.width),e.on("remove",function(){o.remove(),o=null}),r(o),{iframeContainer:o.find("#iframe")[0].getEl(),editorContainer:o.getEl()}}var a=this,s=e.settings,l=tinymce.ui.Factory,c=tinymce.each,u=tinymce.DOM,d={file:{title:"File",items:"newdocument"},edit:{title:"Edit",items:"undo redo | cut copy paste | selectall"},insert:{title:"Insert",items:"|"},view:{title:"View",items:"visualaid |"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table"},tools:{title:"Tools"}},f="undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image";a.renderUI=function(t){var n=s.skin!==!1?s.skin||"lightgray":!1;return n&&(tinymce.Env.ie&&7>=tinymce.Env.ie?tinymce.DOM.loadCSS(tinymce.baseURL+"/skins/"+n+"/skin.ie7.min.css"):tinymce.DOM.loadCSS(tinymce.baseURL+"/skins/"+n+"/skin.min.css"),e.contentCSS.push(tinymce.baseURL+"/skins/"+n+"/content.min.css")),e.on("ProgressState",function(e){a.throbber=a.throbber||new tinymce.ui.Throbber(a.panel.getEl("body")),e.state?a.throbber.show(e.time):a.throbber.hide()}),s.inline?i(t):o(t)}});
  
1// 4.0b2 (2013-04-24)
2(function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;e.length>i;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;r.length>i;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;n.length>r;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/dom/Sizzle",c="tinymce/html/Styles",u="tinymce/dom/EventUtils",d="tinymce/dom/TreeWalker",f="tinymce/util/Tools",p="tinymce/dom/Range",h="tinymce/html/Entities",m="tinymce/Env",g="tinymce/dom/DOMUtils",v="tinymce/dom/ScriptLoader",y="tinymce/AddOnManager",b="tinymce/html/Node",C="tinymce/html/Schema",x="tinymce/html/SaxParser",w="tinymce/html/DomParser",_="tinymce/html/Writer",N="tinymce/html/Serializer",E="tinymce/dom/Serializer",k="tinymce/dom/TridentSelection",S="tinymce/util/VK",T="tinymce/dom/ControlSelection",R="tinymce/dom/Selection",A="tinymce/dom/RangeUtils",B="tinymce/Formatter",L="tinymce/UndoManager",H="tinymce/EnterKey",M="tinymce/ForceBlocks",D="tinymce/EditorCommands",P="tinymce/util/URI",O="tinymce/util/Class",I="tinymce/ui/Selector",F="tinymce/ui/Collection",W="tinymce/ui/DomUtils",z="tinymce/ui/Control",V="tinymce/ui/Factory",U="tinymce/ui/Container",q="tinymce/ui/DragHelper",$="tinymce/ui/Scrollable",j="tinymce/ui/Panel",K="tinymce/ui/Movable",G="tinymce/ui/Resizable",Y="tinymce/ui/FloatPanel",X="tinymce/ui/KeyboardNavigation",J="tinymce/ui/Window",Q="tinymce/ui/MessageBox",Z="tinymce/WindowManager",et="tinymce/util/Quirks",tt="tinymce/util/Observable",nt="tinymce/Shortcuts",rt="tinymce/Editor",it="tinymce/util/I18n",ot="tinymce/FocusManager",at="tinymce/EditorManager",st="tinymce/LegacyInput",lt="tinymce/util/XHR",ct="tinymce/util/JSON",ut="tinymce/util/JSONRequest",dt="tinymce/util/JSONP",ft="tinymce/util/LocalStorage",pt="tinymce/Compat",ht="tinymce/ui/Layout",mt="tinymce/ui/AbsoluteLayout",gt="tinymce/ui/Tooltip",vt="tinymce/ui/Widget",yt="tinymce/ui/Button",bt="tinymce/ui/ButtonGroup",Ct="tinymce/ui/Checkbox",xt="tinymce/ui/CheckboxGroup",wt="tinymce/ui/PanelButton",_t="tinymce/ui/ColorButton",Nt="tinymce/ui/ComboBox",Et="tinymce/ui/Path",kt="tinymce/ui/ElementPath",St="tinymce/ui/FormItem",Tt="tinymce/ui/Form",Rt="tinymce/ui/FieldSet",At="tinymce/ui/FilePicker",Bt="tinymce/ui/FitLayout",Lt="tinymce/ui/FlexLayout",Ht="tinymce/ui/FlowLayout",Mt="tinymce/ui/FormatControls",Dt="tinymce/ui/GridLayout",Pt="tinymce/ui/Iframe",Ot="tinymce/ui/Label",It="tinymce/ui/Toolbar",Ft="tinymce/ui/MenuBar",Wt="tinymce/ui/MenuButton",zt="tinymce/ui/ListBox",Vt="tinymce/ui/MenuItem",Ut="tinymce/ui/Menu",qt="tinymce/ui/Radio",$t="tinymce/ui/RadioGroup",jt="tinymce/ui/ResizeHandle",Kt="tinymce/ui/Spacer",Gt="tinymce/ui/SplitButton",Yt="tinymce/ui/StackLayout",Xt="tinymce/ui/TabPanel",Jt="tinymce/ui/TextBox",Qt="tinymce/ui/Throbber";r(l,[],function(){function e(e){return gt.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>N.cacheLength&&delete e[t.shift()],e[n]=r,r}}function i(e){return e[F]=!0,e}function o(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,l,c,u,p,h,m;if((t?t.ownerDocument||t:W)!==L&&B(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=vt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return et.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return et.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!D.test(e)){if(u=!0,p=F,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=d(e),(u=t.getAttribute("id"))?p=u.replace(Ct,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+f(c[l]);h=mt.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return et.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{u||t.removeAttribute("id")}}}return C(e.replace(ct,"$1"),t,n,r)}function s(e,t){var n=t&&e,r=n&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function l(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function c(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function d(e,t){var n,r,i,o,s,l,c,u=$[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=N.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=dt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ct," ")}),s=s.slice(n.length));for(o in N.filter)!(r=ht[o].exec(s))||c[o]&&!(r=c[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):$(e,l).slice(0)}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=U++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=V+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[F]||(t[F]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===_)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||_,l[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function g(e,t,n,r,o,a){return r&&!r[F]&&(r=g(r)),o&&!o[F]&&(o=g(o,a)),i(function(i,a,s,l){var c,u,d,f=[],p=[],h=a.length,g=i||b(t||"*",s.nodeType?[s]:s,[]),v=!e||!i&&t?g:m(g,f,e,s,l),y=n?o||(i?e:h||r)?[]:a:v;if(n&&n(v,y,s,l),r)for(c=m(y,p),r(c,[],s,l),u=c.length;u--;)(d=c[u])&&(y[p[u]]=!(v[p[u]]=d));if(i){if(o||e){if(o){for(c=[],u=y.length;u--;)(d=y[u])&&c.push(v[u]=d);o(null,y=[],c,l)}for(u=y.length;u--;)(d=y[u])&&(c=o?nt.call(i,d):f[u])>-1&&(i[c]=!(a[c]=d))}}else y=m(y===a?y.splice(h,y.length):y),o?o(null,a,y,l):et.apply(a,y)})}function v(e){for(var t,n,r,i=e.length,o=N.relative[e[0].type],a=o||N.relative[" "],s=o?1:0,l=p(function(e){return e===t},a,!0),c=p(function(e){return nt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=N.relative[e[s].type])u=[p(h(u),n)];else{if(n=N.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!N.relative[e[r].type];r++);return g(s>1&&h(u),s>1&&f(e.slice(0,s-1)).replace(ct,"$1"),n,r>s&&v(e.slice(s,r)),i>r&&v(e=e.slice(r)),i>r&&f(e))}u.push(n)}return h(u)}function y(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,l,c,u){var d,f,p,h=[],g=0,v="0",y=i&&[],b=null!=u,C=T,x=i||o&&N.find.TAG("*",u&&s.parentNode||s),w=V+=null==C?1:Math.random()||.1;for(b&&(T=s!==L&&s,_=n);null!=(d=x[v]);v++){if(o&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(V=w,_=++n)}r&&((d=!p&&d)&&g--,i&&y.push(d))}if(g+=v,r&&v!==g){for(f=0;p=t[f++];)p(y,h,s,l);if(i){if(g>0)for(;v--;)y[v]||h[v]||(h[v]=Q.call(c));h=m(h)}et.apply(c,h),b&&!i&&h.length>0&&g+t.length>1&&a.uniqueSort(c)}return b&&(V=w,T=C),y};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function C(e,t,n,r){var i,o,a,s,l,c=d(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&M&&N.relative[o[1].type]){if(t=(N.find.ID(a.matches[0].replace(wt,_t),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=ht.needsContext.test(e)?0:o.length;i--&&(a=o[i],!N.relative[s=a.type]);)if((l=N.find[s])&&(r=l(a.matches[0].replace(wt,_t),mt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return et.apply(n,r),n;break}}return S(e,c)(r,t,!M,n,mt.test(e)),n}function x(){}var w,_,N,E,k,S,T,R,A,B,L,H,M,D,P,O,I,F="sizzle"+-new Date,W=window.document,z={},V=0,U=0,q=n(),$=n(),j=n(),K=!1,G=function(){return 0},Y=typeof t,X=1<<31,J=[],Q=J.pop,Z=J.push,et=J.push,tt=J.slice,nt=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},rt="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=it.replace("w","w#"),at="([*^$|!~]?=)",st="\\["+rt+"*("+it+")"+rt+"*(?:"+at+rt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ot+")|)|)"+rt+"*\\]",lt=":("+it+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+st.replace(3,8)+")*)|.*)\\)|)",ct=RegExp("^"+rt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+rt+"+$","g"),ut=RegExp("^"+rt+"*,"+rt+"*"),dt=RegExp("^"+rt+"*([\\x20\\t\\r\\n\\f>+~])"+rt+"*"),ft=RegExp(lt),pt=RegExp("^"+ot+"$"),ht={ID:RegExp("^#("+it+")"),CLASS:RegExp("^\\.("+it+")"),NAME:RegExp("^\\[name=['\"]?("+it+")['\"]?\\]"),TAG:RegExp("^("+it.replace("w","w*")+")"),ATTR:RegExp("^"+st),PSEUDO:RegExp("^"+lt),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+rt+"*(even|odd|(([+-]|)(\\d*)n|)"+rt+"*(?:([+-]|)"+rt+"*(\\d+)|))"+rt+"*\\)|)","i"),needsContext:RegExp("^"+rt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+rt+"*((?:-\\d)?\\d*)"+rt+"*\\)|)(?=[^-]|$)","i")},mt=/[\x20\t\r\n\f]*[+~]/,gt=/^[^{]+\{\s*\[native code/,vt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,yt=/^(?:input|select|textarea|button)$/i,bt=/^h\d$/i,Ct=/'|\\/g,xt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,wt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,_t=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{et.apply(J=tt.call(W.childNodes),W.childNodes),J[W.childNodes.length].nodeType}catch(Nt){et={apply:J.length?function(e,t){Z.apply(e,tt.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}k=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=a.setDocument=function(n){var r=n?n.ownerDocument||n:W;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=!k(r),z.getElementsByTagName=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=o(function(e){e.id=F+0,e.appendChild(L.createElement("a")).setAttribute("name",F),e.appendChild(L.createElement("i")).setAttribute("name",F),H.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(F).length===2+r.getElementsByName(F+0).length;return H.removeChild(e),t}),z.sortDetached=o(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(L.createElement("div"))}),N.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==Y&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(N.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},N.filter.ID=function(e){var t=e.replace(wt,_t);return function(e){return e.getAttribute("id")===t}}):(N.find.ID=function(e,n){if(typeof n.getElementById!==Y&&M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==Y&&r.getAttributeNode("id").value===e?[r]:t:[]}},N.filter.ID=function(e){var t=e.replace(wt,_t);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),N.find.TAG=z.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==Y?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},N.find.NAME=z.getByName&&function(e,n){return typeof n.getElementsByName!==Y?n.getElementsByName(name):t},N.find.CLASS=z.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==Y&&M?n.getElementsByClassName(e):t},P=[],D=[":focus"],(z.qsa=e(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||D.push("\\["+rt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||D.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&D.push("[*^$]="+rt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")})),(z.matchesSelector=e(O=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){z.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),P.push("!=",lt)}),D=RegExp(D.join("|")),P=P.length&&RegExp(P.join("|")),I=e(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},G=H.compareDocumentPosition?function(e,t){if(e===t)return K=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||R&&t.compareDocumentPosition(e)===n?e===r||I(W,e)?-1:t===r||I(W,t)?1:A?nt.call(A,e)-nt.call(A,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,l=[e],c=[t];if(e===t)return K=!0,0;if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?s(l[i],c[i]):l[i]===W?-1:c[i]===W?1:0},L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&B(e),t=t.replace(xt,"='$1']"),z.matchesSelector&&M&&(!P||!P.test(t))&&!D.test(t))try{var n=O.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&B(e),I(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&B(e),M&&(t=t.toLowerCase()),(n=N.attrHandle[t])?n(e):!M||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=0,i=0;if(K=!z.detectDuplicates,R=!z.sortDetached,A=!z.sortStable&&e.slice(0),e.sort(G),K){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},E=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=E(t);return n},N=a.selectors={cacheLength:50,createPseudo:i,match:ht,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(wt,_t),e[3]=(e[4]||e[5]||"").replace(wt,_t),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return ht.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ft.test(n)&&(t=d(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(wt,_t).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=q[e+" "];return t||(t=RegExp("(^|"+rt+")"+e+"("+rt+"|$)"))&&q(e,function(e){return t.test(e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],p=c[0]===V&&c[1],f=c[0]===V&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[V,p,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===V)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[V,f]),d!==t)););return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=N.pseudos[e]||N.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[F]?r(t):r.length>1?(n=[e,e,"",t],N.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=nt.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(ct,"$1"));return r[F]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:i(function(e){return pt.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(wt,_t).toLowerCase(),function(t){var n;do if(n=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!N.pseudos.empty(e)},header:function(e){return bt.test(e.nodeName)},input:function(e){return yt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})N.pseudos[w]=l(w);for(w in{submit:!0,reset:!0})N.pseudos[w]=c(w);return S=a.compile=function(e,t){var n,r=[],i=[],o=j[e+" "];if(!o){for(t||(t=d(e)),n=t.length;n--;)o=v(t[n]),o[F]?r.push(o):i.push(o);o=j(e,y(i,r))}return o},N.pseudos.nth=N.pseudos.eq,x.prototype=N.filters=N.pseudos,N.setFilters=new x,z.sortStable=F.split("").sort(G).join("")===F,B(),[0,0].sort(G),z.detectDuplicates=K,"function"==typeof r&&r.amd?r(function(){return a}):window.Sizzle=a,a}),r(c,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff";for(e=e||{},u=("\\\" \\' \\; \\: ; : "+d).split(" "),l=0;u.length>l;l++)c[u[l]]=d+l,c[d+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t){var n,r,i,o;n=h[e+"-top"+t],n&&(r=h[e+"-right"+t],n==r&&(i=h[e+"-bottom"+t],r==i&&(o=h[e+"-left"+t],i==o&&(h[e+t]=o,delete h[e+"-top"+t],delete h[e+"-right"+t],delete h[e+"-bottom"+t],delete h[e+"-left"+t]))))}function l(e){var t=h[e],n;if(t&&!(0>t.indexOf(" "))){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return h[e]=t[0],!0}}function u(e,t,n,r){l(t)&&l(n)&&l(r)&&(h[e]=h[t]+" "+h[n]+" "+h[r],delete h[t],delete h[n],delete h[r])}function d(e){return y=!0,c[e]}function f(e,t){return y&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(e,t,n,r,i,o){return(i=i||o)?(i=f(i),"'"+i.replace(/\'/g,"\\'")+"'"):(t=f(t||n||r),b&&(t=b.call(C,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')")}var h={},m,g,v,y,b=e.url_converter,C=e.url_converter_scope||this;if(t){for(t=t.replace(/\\[\"\';:\uFEFF]/g,d).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,d)});m=o.exec(t);)g=m[1].replace(a,"").toLowerCase(),v=m[2].replace(a,""),g&&v.length>0&&("font-weight"===g&&"700"===v?v="bold":("color"===g||"background-color"===g)&&(v=v.toLowerCase()),v=v.replace(r,n),v=v.replace(i,p),h[g]=y?f(v,!0):v),o.lastIndex=m.index+m[0].length;s("border",""),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),u("border","border-width","border-style","border-color"),"medium none"===h.border&&delete h.border}return h},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(u,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function n(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function r(e,t){function n(){return!1}function r(){return!0}var i,o=t||{};for(i in e)"layerX"!==i&&"layerY"!==i&&(o[i]=e[i]);return o.target||(o.target=o.srcElement||document),o.preventDefault=function(){o.isDefaultPrevented=r,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=r,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=r,o.stopPropagation()},o.isDefaultPrevented||(o.isDefaultPrevented=n,o.isPropagationStopped=n,o.isImmediatePropagationStopped=n),o}function i(r,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){"complete"===c.readyState&&(n(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(e){return setTimeout(l,0),t}a()}var c=r.document,u={type:"ready"};return o.domLoaded?(i(u),t):(c.addEventListener?e(r,"DOMContentLoaded",a):(e(c,"readystatechange",s),c.documentElement.doScroll&&r===r.top&&l()),e(r,"load",a),t)}function o(){function t(e,t){var n,r,i,o;if(n=s[t][e.type])for(r=0,i=n.length;i>r;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var o=this,s={},l,c,u,d,f;c=a+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,o.domLoaded=!1,o.events=s,o.bind=function(n,a,p,h){function m(e){t(r(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(n&&3!==n.nodeType&&8!==n.nodeType){for(n[c]?g=n[c]:(g=l++,n[c]=g,s[g]={}),h=h||n,a=a.split(" "),y=a.length;y--;)b=a[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),o.domLoaded&&"ready"===b&&"complete"==n.readyState?p.call(h,r({type:b})):(d||(C=f[b],C&&(x=function(e){var n,i;if(n=e.currentTarget,i=e.relatedTarget,i&&n.contains)i=n.contains(i);else for(;i&&i!==n;)i=i.parentNode;i||(e=r(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=n,t(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=r(e||_.event),e.type="focus"===e.type?"focusin":"focusout",t(e,g)}),v=s[g][b],v?"ready"===b&&o.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?i(n,x,o):e(n,C||b,x,w)));return n=v=0,p}},o.unbind=function(e,t,r){var i,a,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return o;if(i=e[c]){if(f=s[i],t){for(t=t.split(" "),l=t.length;l--;)if(d=t[l],a=f[d]){if(r)for(u=a.length;u--;)a[u].func===r&&a.splice(u,1);r&&0!==a.length||(delete f[d],n(e,a.fakeName||d,a.nativeHandler,a.capture))}}else{for(d in f)a=f[d],n(e,a.fakeName||d,a.nativeHandler,a.capture);f={}}for(d in f)return o;delete s[i];try{delete e[c]}catch(p){e[c]=null}}return o},o.fire=function(e,n,i){var a;if(!e||3===e.nodeType||8===e.nodeType)return o;i=r(null,i),i.type=n,i.target=e;do a=e[c],a&&t(i,a),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!i.isPropagationStopped());return o},o.clean=function(e){var t,n,r=o.unbind;if(!e||3===e.nodeType||8===e.nodeType)return o;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return o},o.destory=function(){s={}},o.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var a="mce-data-";return o.Event=new o,o.Event.bind(window,"ready",function(){}),o}),r(d,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(f,[],function(){function e(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function n(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function r(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function i(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function o(e,t){var n=[];return i(e,function(e){n.push(t(e))}),n}function a(e,t){var n=[];return i(e,function(e){(!t||t(e))&&n.push(e)}),n}function s(e,n,r){var i=this,o,a,s,l,c,u=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),s=e[3].match(/(^|\.)(\w+)$/i)[2],a=i.createNS(e[3].replace(/\.\w+$/,""),r),!a[s]){if("static"==e[2])return a[s]=n,this.onCreate&&this.onCreate(e[2],e[3],a[s]),t;n[s]||(n[s]=function(){},u=1),a[s]=n[s],i.extend(a[s].prototype,n),e[5]&&(o=i.resolve(e[5]).prototype,l=e[5].match(/\.(\w+)$/i)[1],c=a[s],a[s]=u?function(){return o[l].apply(this,arguments)}:function(){return this.parent=o[l],c.apply(this,arguments)},a[s].prototype[s]=a[s],i.each(o,function(e,t){a[s].prototype[t]=o[t]}),i.each(n,function(e,t){o[t]?a[s].prototype[t]=function(){return this.parent=o[t],e.apply(this,arguments)}:t!=s&&(a[s].prototype[t]=e)})),i.each(n["static"],function(e,t){a[s][t]=e})}}function l(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function u(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),i(e,function(e,i){return n.call(o,e,i,r)===!1?!1:(u(e,n,r,o),t)}))}function d(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;e.length>n;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function p(t,n){return!t||e(t,"array")?t:o(t.split(n||","),m)}var h=/^\s*|\s*$/g,m=function(e){return null===e||e===t?"":(""+e).replace(h,"")},g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:m,isArray:g,is:e,toArray:n,makeMap:r,each:i,map:o,grep:a,inArray:l,extend:c,create:s,walk:u,createNS:d,resolve:f,explode:p}}),r(p,[f],function(e){function n(r){function i(){return P.createDocumentFragment()}function o(e,t){N(W,e,t)}function a(e,t){N(z,e,t)}function s(e){o(e.parentNode,K(e))}function l(e){o(e.parentNode,K(e)+1)}function c(e){a(e.parentNode,K(e))}function u(e){a(e.parentNode,K(e)+1)}function d(e){e?(D[q]=D[U],D[$]=D[V]):(D[U]=D[q],D[V]=D[$]),D.collapsed=W}function f(e){s(e),u(e)}function p(e){o(e,0),a(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,n){var r=D[U],i=D[V],o=D[q],a=D[$],s=n.startContainer,l=n.startOffset,c=n.endContainer,u=n.endOffset;return 0===e?_(r,i,s,l):1===e?_(o,a,s,l):2===e?_(o,a,c,u):3===e?_(r,i,c,u):t}function m(){E(F)}function g(){return E(O)}function v(){return E(I)}function y(e){var t=this[U],n=this[V],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[n]),o?t.insertBefore(e,o):t.appendChild(e)):n?n>=t.nodeValue.length?r.insertAfter(e,t):(i=t.splitText(n),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function b(e){var t=D.extractContents();D.insertNode(e),e.appendChild(t),D.selectNode(e)}function C(){return j(new n(r),{startContainer:D[U],startOffset:D[V],endContainer:D[q],endOffset:D[$],collapsed:D.collapsed,commonAncestorContainer:D.commonAncestorContainer})}function x(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function w(){return D[U]==D[q]&&D[V]==D[$]}function _(e,t,n,i){var o,a,s,l,c,u;if(e==n)return t==i?0:i>t?-1:1;for(o=n;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=n;)o=o.parentNode;if(o){for(a=0,s=n.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=r.findCommonAncestor(e,n),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=n;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,n){var i,o;for(e?(D[U]=t,D[V]=n):(D[q]=t,D[$]=n),i=D[q];i.parentNode;)i=i.parentNode;for(o=D[U];o.parentNode;)o=o.parentNode;o==i?_(D[U],D[V],D[q],D[$])>0&&D.collapse(e):D.collapse(e),D.collapsed=w(),D.commonAncestorContainer=r.findCommonAncestor(D[U],D[q])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(D[U]==D[q])return k(e);for(t=D[q],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[U])return S(t,e);
3++n}for(t=D[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[q])return T(t,e);++r}for(o=r-n,a=D[U];o>0;)a=a.parentNode,o--;for(s=D[q];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return R(a,s,e)}function k(e){var t,n,r,o,a,s,l,c,u;if(e!=F&&(t=i()),D[V]==D[$])return t;if(3==D[U].nodeType){if(n=D[U].nodeValue,r=n.substring(D[V],D[$]),e!=I&&(o=D[U],c=D[V],u=D[$]-D[V],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),D.collapse(W)),e==F)return;return r.length>0&&t.appendChild(P.createTextNode(r)),t}for(o=x(D[U],D[V]),a=D[$]-D[V];o&&a>0;)s=o.nextSibling,l=H(o,e),t&&t.appendChild(l),--a,o=s;return e!=I&&D.collapse(W),t}function S(e,t){var n,r,o,a,s,l;if(t!=F&&(n=i()),r=A(e,t),n&&n.appendChild(r),o=K(e),a=o-D[V],0>=a)return t!=I&&(D.setEndBefore(e),D.collapse(z)),n;for(r=e.previousSibling;a>0;)s=r.previousSibling,l=H(r,t),n&&n.insertBefore(l,n.firstChild),--a,r=s;return t!=I&&(D.setEndBefore(e),D.collapse(z)),n}function T(e,t){var n,r,o,a,s,l;for(t!=F&&(n=i()),o=B(e,t),n&&n.appendChild(o),r=K(e),++r,a=D[$]-r,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=H(o,t),n&&n.appendChild(l),--a,o=s;return t!=I&&(D.setStartAfter(e),D.collapse(W)),n}function R(e,t,n){var r,o,a,s,l,c,u,d;for(n!=F&&(o=i()),r=B(e,n),o&&o.appendChild(r),a=e.parentNode,s=K(e),l=K(t),++s,c=l-s,u=e.nextSibling;c>0;)d=u.nextSibling,r=H(u,n),o&&o.appendChild(r),u=d,--c;return r=A(t,n),o&&o.appendChild(r),n!=I&&(D.setStartAfter(e),D.collapse(W)),o}function A(e,t){var n=x(D[q],D[$]-1),r,i,o,a,s,l=n!=D[q];if(n==e)return L(n,l,z,t);for(r=n.parentNode,i=L(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=L(n,l,z,t),t!=F&&i.insertBefore(a,i.firstChild),l=W,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=L(r,z,z,t),t!=F&&s.appendChild(i),i=s}}function B(e,t){var n=x(D[U],D[V]),r=n!=D[U],i,o,a,s,l;if(n==e)return L(n,r,W,t);for(i=n.parentNode,o=L(i,z,W,t);i;){for(;n;)a=n.nextSibling,s=L(n,r,W,t),t!=F&&o.appendChild(s),r=W,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=L(i,z,W,t),t!=F&&l.appendChild(o),o=l}}function L(e,t,n,i){var o,a,s,l,c;if(t)return H(e,i);if(3==e.nodeType){if(o=e.nodeValue,n?(l=D[V],a=o.substring(l),s=o.substring(0,l)):(l=D[$],a=o.substring(0,l),s=o.substring(l)),i!=I&&(e.nodeValue=s),i==F)return;return c=r.clone(e,z),c.nodeValue=a,c}if(i!=F)return r.clone(e,z)}function H(e,n){return n!=F?n==I?r.clone(e,W):e:(e.parentNode.removeChild(e),t)}function M(){return r.create("body",null,v()).outerText}var D=this,P=r.doc,O=0,I=1,F=2,W=!0,z=!1,V="startOffset",U="startContainer",q="endContainer",$="endOffset",j=e.extend,K=r.nodeIndex;return j(D,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:W,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:o,setEnd:a,setStartBefore:s,setStartAfter:l,setEndBefore:c,setEndAfter:u,collapse:d,selectNode:f,selectNodeContents:p,compareBoundaryPoints:h,deleteContents:m,extractContents:g,cloneContents:v,insertNode:y,surroundContents:b,cloneRange:C,toStringIE:M}),D}return n.prototype.toString=function(){return this.toStringIE()},n}),r(h,[f],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;e.length>n;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"},a={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(m,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=!r&&/Gecko/.test(t),a=-1!=t.indexOf("Mac"),s=/(iPad|iPhone)/.test(t);var l=!s||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:o,mac:a,iOS:s,contentEditable:l,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window}}),r(g,[l,c,u,d,p,h,m,f],function(e,n,r,i,o,a,s,l){function c(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!g||e.documentMode>=8,i.boxModel=!g||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),i.settings=t=h({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var u=l.each,d=l.is,f=l.grep,p=l.trim,h=l.extend,m=s.webkit,g=s.ie,v=/^([a-z0-9],?)+$/i,y=/^[ \t\r\n]*$/,b=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return c.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(g&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!g||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),d(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(v.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}return e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=d(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,n,r){var i="",o;i+="<"+e;for(o in n)n.hasOwnProperty(o)&&null!==n[o]&&(i+=" "+o+'="'+this.encode(n[o])+'"');return r!==t?i+">"+r+"</"+e+">":i+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!g||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,n,r){return this.run(e,function(e){var i=this,o,a;if(n)if("string"==typeof n){o=e.style,n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof r||b[n]||(r+="px"),"opacity"===n&&e.runtimeStyle&&e.runtimeStyle.opacity===t&&(o.filter=""===r?"":"alpha(opacity="+100*r+")"),"float"==n&&(n="cssFloat"in e.style?"cssFloat":"styleFloat");try{o[n]=r}catch(s){}i.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(a in n)i.setStyle(e,a,n[a])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=g?"styleFloat":"cssFloat"),n.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,n,r){var i=this;if(e&&n)return this.run(e,function(e){var o=i.settings,a=e.getAttribute(n);if(null!==r)switch(n){case"style":if(!d(r,"string"))return u(r,function(t,n){i.setStyle(e,n,t)}),t;o.keep_values&&(r?e.setAttribute("data-mce-style",r,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=r;break;case"class":e.className=r||"";break;case"src":case"href":o.keep_values&&(o.url_converter&&(r=o.url_converter.call(o.url_converter_scope||i,r,n,e)),i.setAttrib(e,"data-mce-"+n,r,2));break;case"shape":e.setAttribute("data-mce-style",r)}d(r)&&null!==r&&0!==r.length?e.setAttribute(n,""+r,2):e.removeAttribute(n,2),a!=r&&o.onSetAttrib&&o.onSetAttrib({attrElm:e,attrName:n,attrValue:r})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){u(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(d(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(g&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),m&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),g)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientTop,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientLeft,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==c.DOM&&n===document){var o=c.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,c.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var n=this,r=n.doc,i;return n!==c.DOM&&r===document?(c.DOM.loadCSS(e),t):(e||(e=""),i=r.getElementsByTagName("head")[0],u(e.split(","),function(e){var t;n.files[e]||(n.files[e]=!0,t=n.create("link",{rel:"stylesheet",href:e}),g&&r.documentMode&&r.recalc&&(t.onload=function(){r.recalc&&r.recalc(),t.onload=null}),i.appendChild(t))}),t)},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=p(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(g){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="<br />"+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="<br />"+t,u(f(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,g)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return d(t,"array")&&(e=e.cloneNode(!0)),n&&u(f(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},getClasses:function(){function e(t){u(t.imports,function(t){e(t)}),u(t.cssRules||t.rules,function(t){switch(t.type||1){case 1:t.selectorText&&u(t.selectorText.split(","),function(e){e=e.replace(/^\s*|\s*$|^\s\./g,""),!/\.mce/.test(e)&&/\.[\w\-]+$/.test(e)&&(o=e,e=e.replace(/.*\.([a-z0-9_\-]+).*/i,"$1"),(!i||(e=i(e,o)))&&(r[e]||(n.push({"class":e}),r[e]=1)))});break;case 3:e(t.styleSheet)}})}var t=this,n=[],r={},i=t.settings.class_filter,o;if(t.classes)return t.classes;try{u(t.doc.styleSheets,e)}catch(a){}return n.length>0&&(t.classes=n),n},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],u(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(g){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!y.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i,o;if(e)for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling)o=e.nodeType,(!t||3!=o||o!=r&&e.nodeValue.length)&&(n++,r=o);return n},split:function(e,n,r){function i(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,r=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=r.length-1;n>=0;n--)i(r[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=p(e.nodeValue).length;if(!o.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(r=e.childNodes,1==r.length&&r[0]&&1==r[0].nodeType&&"bookmark"==r[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(r[0],e),r.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;o.remove(e)}return e}}var o=this,a=o.createRng(),s,l,c;return e&&n?(a.setStart(e.parentNode,o.nodeIndex(e)),a.setEnd(n.parentNode,o.nodeIndex(n)),s=a.extractContents(),a=o.createRng(),a.setStart(n.parentNode,o.nodeIndex(n)+1),a.setEnd(e.parentNode,o.nodeIndex(e)+1),l=a.extractContents(),c=e.parentNode,c.insertBefore(i(s),e),r?c.replaceChild(r,n):c.insertBefore(n,e),c.insertBefore(i(l),e),o.remove(e),r||n):t},bind:function(e,t,n,r){return this.events.bind(e,t,n,r||this)},unbind:function(e,t,n){return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var e=this;e.win=e.doc=e.root=e.events=e.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},c.DOM=new c(document),c}),r(v,[g,f],function(e,n){function r(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function r(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=i,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,a.onload=n,a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()},a.onerror=r,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var n=0,r=1,s=2,l={},c=[],u={},d=[],f=0,p;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==p&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(n,i,c){function h(e){o(u[e],function(e){e.func.call(e.scope)}),u[e]=p}var m;d.push({func:i,scope:c||this}),m=function(){var i=a(n);n.length=0,o(i,function(n){return l[n]==s?(h(n),t):(l[n]!=r&&(l[n]=r,f++,e(n,function(){l[n]=s,f--,h(n),m()})),t)}),f||(o(d,function(e){e.func.call(e.scope)}),d.length=0)},m()}}var i=e.DOM,o=n.each,a=n.grep;return r.ScriptLoader=new r,r}),r(y,[v,f],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t){var n=r.settings;n&&n.language&&n.language_load!==!1&&e.ScriptLoader.add(this.urls[t]+"/langs/"+n.language+".js")},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(b,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(C,[f],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;u.length>l;l++)"string"==typeof u[l]&&(u[l]=t(u[l])),r.push.apply(r,u[l]);for(e=t(e),o=e.length;o--;)c=[].concat(s,t(n)),a[e[o]]={attributes:i(c),attributesOrder:c,children:i(r)}}function i(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,u,d,f,p;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange onwaiting"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),u.push.apply(u,p),o(p,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),o(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",d,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]
4}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function u(e){return RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function d(e){var n,r,o,a,s,c,d,f,p,h,m,g,y,C,x,w,_,N,E,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=S.exec(f[o])){if(d={},m=s[1],h=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(h),d.required=!0),"-"===m){delete g[h],y.splice(l(y,h),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:h,value:E}),d.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:h,value:E}),d.forcedValue=E),"<"===C&&(d.validValues=i(E,"?"))),T.test(h)?(c.attributePatterns=c.attributePatterns||[],d.pattern=u(h),c.attributePatterns.push(d)):(g[h]||y.push(h),g[h]=d)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=u(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],d(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",a=t[2];y[a]=y[i],R[a]=i,r||(k[a.toUpperCase()]={},k[a]={}),v[a]||(v[a]=v[i]),o(y,function(e){e[i]&&(e[a]=e[i])})})}function h(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,a;r&&(a=r[1],i=a?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===a?delete i[e]:i[e]={}}))})}function m(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,k,S,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),S=c("non_empty_elements","td th iframe video audio object",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),k=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),h(e.valid_children),d(e.extended_valid_elements),h("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),m("span")||d("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return k},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return S},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=m(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=m,g.getCustomElements=function(){return R},g.addValidElements=d,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=h,g.elements=v}}),r(x,[C,h,f],function(e,t,n){var r=n.each;return function(n,i){var o=this,a=function(){};n=n||{},o.schema=i=i||new e,n.fix_self_closing!==!1&&(n.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(o[e]=n[e]||a)}),o.parse=function(e){function r(e){var t,n;for(t=d.length;t--&&d[t].name!==e;);if(t>=0){for(n=d.length-1;n>=t;n--)e=d[n],e.valid&&a.end(e.name);d.length=t}}function o(e,t,n,r,i){var o,a;if(t=t.toLowerCase(),n=t in b?t:I(n||r||i||""),x&&!g&&0!==t.indexOf("data-mce-")){if(o=k[t],!o&&S){for(a=S.length;a--&&(o=S[a],!o.pattern.test(t)););-1===a&&(o=null)}if(!o)return;if(o.validValues&&!(n in o.validValues))return}f.map[t]=n,f.push({name:t,value:n})}var a=this,s,l=0,c,u,d=[],f,p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,M,D,P,O=0,I=t.decode,F;for(H=RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),M=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,y=i.getShortEndedElements(),L=n.self_closing_elements||i.getSelfClosingElements(),b=i.getBoolAttrs(),x=n.validate,v=n.remove_internals,F=n.fix_self_closing,D=i.getSpecialElements();s=H.exec(e);){if(s.index>l&&a.text(I(e.substr(l,s.index-l))),c=s[6])c=c.toLowerCase(),":"===c.charAt(0)&&(c=c.substr(1)),r(c);else if(c=s[7]){if(c=c.toLowerCase(),":"===c.charAt(0)&&(c=c.substr(1)),C=c in y,F&&L[c]&&d.length>0&&d[d.length-1].name===c&&r(c),!x||(w=i.getElementRule(c))){if(_=!0,x&&(k=w.attributes,S=w.attributePatterns),(E=s[8])?(g=-1!==E.indexOf("data-mce-type"),g&&v&&(_=!1),f=[],f.map={},E.replace(M,o)):(f=[],f.map={}),x&&!g){if(T=w.attributesRequired,R=w.attributesDefault,A=w.attributesForced,B=w.removeEmptyAttrs,B&&!f.length&&(_=!1),A)for(p=A.length;p--;)N=A[p],m=N.name,P=N.value,"{$uid}"===P&&(P="mce_"+O++),f.map[m]=P,f.push({name:m,value:P});if(R)for(p=R.length;p--;)N=R[p],m=N.name,m in f.map||(P=N.value,"{$uid}"===P&&(P="mce_"+O++),f.map[m]=P,f.push({name:m,value:P}));if(T){for(p=T.length;p--&&!(T[p]in f.map););-1===p&&(_=!1)}f.map["data-mce-bogus"]&&(_=!1)}_&&a.start(c,f,C)}else _=!1;if(u=D[c]){u.lastIndex=l=s.index+s[0].length,(s=u.exec(e))?(_&&(h=e.substr(l,s.index-l)),l=s.index+s[0].length):(h=e.substr(l),l=e.length),_&&(h.length>0&&a.text(h,!0),a.end(c)),H.lastIndex=l;continue}C||(E&&E.indexOf("/")==E.length-1?_&&a.end(c):d.push({name:c,valid:_}))}else(c=s[1])?a.comment(c):(c=s[2])?a.cdata(c):(c=s[3])?a.doctype(c):(c=s[4])&&a.pi(c,s[5]);l=s.index+s[0].length}for(e.length>l&&a.text(I(e.substr(l))),p=d.length-1;p>=0;p--)c=d[p],c.valid&&a.end(c.name)}}}),r(w,[b,C,x,f],function(e,n,r,i){var o=i.makeMap,a=i.each,s=i.explode,l=i.extend;return function(i,c){function u(t){var n,r,i,a,s,l,u,f,p,h,m,g,v,y;for(m=o("tr,td,th,tbody,thead,tfoot,table"),h=c.getNonEmptyElements(),g=c.getTextBlockElements(),n=0;t.length>n;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(v=r.next;v&&g[v.name];)v.name="li",v.fixed=!0,r.parent.insert(v,r.parent),v=v.next;r.unwrap(r)}else{for(a=[r],i=r.parent;i&&!c.isValidChild(i.name,r.name)&&!m[i.name];i=i.parent)a.push(i);if(i&&a.length>1){for(a.reverse(),s=l=d.filterNode(a[0].clone()),p=0;a.length-1>p;p++){for(c.isValidChild(l.name,a[p].name)?(u=d.filterNode(a[p].clone()),l.append(u)):u=l,f=a[p].firstChild;f&&f!=a[p+1];)y=f.next,u.append(f),f=y;l=u}s.isEmpty(h)?i.insert(r,a[0],!0):(i.insert(s,a[0],!0),i.insert(r,s)),i=a[0],(i.isEmpty(h)||i.firstChild===i.lastChild&&"br"===i.firstChild.name)&&i.empty().remove()}else if(r.parent){if("li"===r.name){if(v=r.prev,v&&("ul"===v.name||"ul"===v.name)){v.append(r);continue}if(v=r.next,v&&("ul"===v.name||"ul"===v.name)){v.insert(r,v.firstChild,!0);continue}r.wrap(d.filterNode(new e("ul",1)));continue}c.isValidChild(r.parent.name,"div")&&c.isValidChild("div",r.name)?r.wrap(d.filterNode(new e("div",1))):"style"===r.name||"script"===r.name?r.empty().remove():r.unwrap()}}}var d=this,f={},p=[],h={},m={};i=i||{},i.validate="validate"in i?i.validate:!0,i.root_name=i.root_name||"body",d.schema=c=c||new n,d.filterNode=function(e){var t,n,r;n in f&&(r=h[n],r?r.push(e):h[n]=[e]),t=p.length;for(;t--;)n=p[t].name,n in e.attributes.map&&(r=m[n],r?r.push(e):m[n]=[e]);return e},d.addNodeFilter=function(e,t){a(s(e),function(e){var n=f[e];n||(f[e]=n=[]),n.push(t)})},d.addAttributeFilter=function(e,n){a(s(e),function(e){var r;for(r=0;p.length>r;r++)if(p[r].name===e)return p[r].callbacks.push(n),t;p.push({name:e,callbacks:[n]})})},d.parse=function(n,a){function s(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(A,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(H,"")))}var t=b.firstChild,n,r;if(c.isValidChild(b.name,F.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!R[t.name]&&!t.attr("data-mce-type")?r?r.append(t):(r=d(F,1),b.insert(r,t),r.append(t)):(e(r),r=null),t=n;e(r)}}function d(t,n){var r=new e(t,n),i;return t in f&&(i=h[t],i?i.push(r):h[t]=[r]),r}function g(e){var t,n,r;for(t=e.prev;t&&3===t.type;)n=t.value.replace(H,""),n.length>0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function v(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var y,b,C,x,w,_,N,E,k,S,T,R,A,B=[],L,H,M,D,P,O,I,F;if(a=a||{},h={},m={},R=l(o("script,style,head,html,body,title,meta,param"),c.getBlockElements()),I=c.getNonEmptyElements(),O=c.children,T=i.validate,F="forced_root_block"in a?a.forced_root_block:i.forced_root_block,P=c.getWhiteSpaceElements(),A=/^[ \t\r\n]+/,H=/[ \t\r\n]+$/,M=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,y=new r({validate:T,self_closing_elements:v(c.getSelfClosingElements()),cdata:function(e){C.append(d("#cdata",4)).value=e},text:function(e,t){var n;L||(e=e.replace(M," "),C.lastChild&&R[C.lastChild.name]&&(e=e.replace(A,""))),0!==e.length&&(n=d("#text",3),n.raw=!!t,C.append(n).value=e)},comment:function(e){C.append(d("#comment",8)).value=e},pi:function(e,t){C.append(d(e,7)).value=t,g(C)},doctype:function(e){var t;t=C.append(d("#doctype",10)),t.value=e,g(C)},start:function(e,t,n){var r,i,o,a,s;if(o=T?c.getElementRule(e):{}){for(r=d(o.outputName||e,1),r.attributes=t,r.shortEnded=n,C.append(r),s=O[C.name],s&&O[r.name]&&!s[r.name]&&B.push(r),i=p.length;i--;)a=p[i].name,a in t.map&&(k=m[a],k?k.push(r):m[a]=[r]);R[e]&&g(r),n||(C=r),!L&&P[e]&&(L=!0)}},end:function(n){var r,i,o,a,s;if(i=T?c.getElementRule(n):{}){if(R[n]&&!L){if(r=C.firstChild,r&&3===r.type)if(o=r.value.replace(A,""),o.length>0)r.value=o,r=r.next;else for(a=r.next,r.remove(),r=a;r&&3===r.type;)o=r.value,a=r.next,(0===o.length||D.test(o))&&(r.remove(),r=a),r=a;if(r=C.lastChild,r&&3===r.type)if(o=r.value.replace(H,""),o.length>0)r.value=o,r=r.prev;else for(a=r.prev,r.remove(),r=a;r&&3===r.type;)o=r.value,a=r.prev,(0===o.length||D.test(o))&&(r.remove(),r=a),r=a}if(L&&P[n]&&(L=!1),(i.removeEmpty||i.paddEmpty)&&C.isEmpty(I))if(i.paddEmpty)C.empty().append(new e("#text","3")).value="\u00a0";else if(!C.attributes.map.name&&!C.attributes.map.id)return s=C.parent,C.empty().remove(),C=s,t;C=C.parent}}},c),b=C=new e(a.context||i.root_name,11),y.parse(n),T&&B.length&&(a.context?a.invalid=!0:u(B)),F&&("body"==b.name||a.isRootContent)&&s(),!a.invalid){for(S in h){for(k=f[S],x=h[S],N=x.length;N--;)x[N].parent||x.splice(N,1);for(w=0,_=k.length;_>w;w++)k[w](x,S,a)}for(w=0,_=p.length;_>w;w++)if(k=p[w],k.name in m){for(x=m[k.name],N=x.length;N--;)x[N].parent||x.splice(N,1);for(N=0,E=k.callbacks.length;E>N;N++)k.callbacks[N](x,k.name,a)}}return b},i.remove_trailing_brs&&d.addNodeFilter("br",function(t){var n,r=t.length,i,o=l({},c.getBlockElements()),a=c.getNonEmptyElements(),s,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],s=i.parent,o[i.parent.name]&&i===s.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),s.isEmpty(a)&&(p=c.getElementRule(s.name),p&&(p.removeEmpty?s.remove():p.paddEmpty&&(s.empty().append(new e("#text",3)).value="\u00a0"))))}else{for(u=i;s.firstChild===u&&s.lastChild===u&&(u=s,!o[s.name]);)s=s.parent;u===s&&(h=new e("#text",3),h.value="\u00a0",i.replace(h))}}),i.allow_html_in_named_anchor||d.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(_,[h,f],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",t,"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(N,[_,C],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,h,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},m=r.getElementRule(e.name),p=0,h=m.attributesOrder.length;h>p;p++)u=m.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,h=c.length;h>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(E,[g,w,h,N,b,C,m,f],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(i.attr("type",(i.attr("type")||"text/javascript").replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,h,m;return a.ie&&s.select("script,style,select,map").length>0?(m=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,m)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),h=new r(e,d),n.content=h.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(k,[],function(){function e(e){function n(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function r(){function r(e){var r=n(a,e),i,o,l=0,c,u,d;if(i=r.node,o=r.offset,r.inside&&!i.hasChildNodes())return s[e?"setStart":"setEnd"](i,0),t;if(o===u)return s[e?"setStartBefore":"setEndAfter"](i),t;if(0>r.position){if(c=r.inside?i.firstChild:i.nextSibling,!c)return s[e?"setStartAfter":"setEndAfter"](i),t;if(!o)return 3==c.nodeType?s[e?"setStart":"setEnd"](c,0):s[e?"setStartBefore":"setEndBefore"](c),t;for(;c;){if(d=c.nodeValue,l+=d.length,l>=o){i=c,l-=o,l=d.length-l;break}c=c.nextSibling}}else{if(c=i.previousSibling,!c)return s[e?"setStartBefore":"setEndBefore"](i);if(!o)return 3==i.nodeType?s[e?"setStart":"setEnd"](c,i.nodeValue.length):s[e?"setStartAfter":"setEndAfter"](c),t;for(;c;){if(l+=c.nodeValue.length,l>=o){i=c,l-=o;break}c=c.previousSibling}}s[e?"setStart":"setEnd"](i,l)}var a=e.getRng(),s=o.createRng(),l,c,u,d,f;if(l=a.item?a.item(0):a.parentElement(),l.ownerDocument!=o.doc)return s;if(c=e.isCollapsed(),a.item)return s.setStart(l.parentNode,o.nodeIndex(l)),s.setEnd(s.startContainer,s.startOffset+1),s;try{r(!0),c||r()}catch(p){if(-2147024809!=p.number)throw p;f=i.getBookmark(2),u=a.duplicate(),u.collapse(!0),l=u.parentElement(),c||(u=a.duplicate(),u.collapse(!1),d=u.parentElement(),d.innerHTML=d.innerHTML),l.innerHTML=l.innerHTML,i.moveToBookmark(f),a=e.getRng(),r(!0),c||r()}return s}var i=this,o=e.dom,a=!1;this.getBookmark=function(r){function i(e){var t,n,r,i,a=[];for(t=e.parentNode,n=o.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,i=r.length;i--;)if(e===r[i]){a.push(i);break}e=t,t=t.parentNode}return a}function a(e){var r;return r=n(s,e),r?{position:r.position,offset:r.offset,indexes:i(r.node),inside:r.inside}:t}var s=e.getRng(),l={};return 2===r&&(s.item?l.start={ctrl:!0,indexes:i(s.item(0))}:(l.start=a(!0),e.isCollapsed()||(l.end=a()))),l},this.moveToBookmark=function(e){function t(e){var t,n,r,i;for(t=o.getRoot(),n=e.length-1;n>=0;n--)i=t.children,r=e[n],i.length-1>=r&&(t=i[r]);return t}function n(n){var o=e[n?"start":"end"],a,s,l,c;o&&(a=o.position>0,s=i.createTextRange(),s.moveToElementText(t(o.indexes)),c=o.offset,c!==l?(s.collapse(o.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,i=o.doc.body;e.start&&(e.start.ctrl?(r=i.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=i.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(n){function r(e){var t,n,r,s,f;r=o.create("a"),t=e?l:u,n=e?c:d,s=i.duplicate(),(t==p||t==p.documentElement)&&(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(r,t),s.moveToElementText(r),s.moveStart("character",n),o.remove(r),i.setEndPoint(e?"StartToStart":"EndToEnd",s)):(f=t.childNodes,f.length?(n>=f.length?o.insertAfter(r,f[f.length-1]):t.insertBefore(r,f[n]),s.moveToElementText(r)):t.canHaveHTML&&(t.innerHTML="<span>&#xFEFF;</span>",r=t.firstChild,s.moveToElementText(r),s.collapse(a)),i.setEndPoint(e?"StartToStart":"EndToEnd",s),o.remove(r))}var i,s,l,c,u,d,f,p=e.dom.doc,h=p.body,m,g;if(l=n.startContainer,c=n.startOffset,u=n.endContainer,d=n.endOffset,i=h.createTextRange(),l==u&&1==l.nodeType){if(c==d&&!l.hasChildNodes()){if(l.canHaveHTML)return f=l.previousSibling,f&&!f.hasChildNodes()&&o.isBlock(f)?f.innerHTML="&#xFEFF;":f=null,l.innerHTML="<span>&#xFEFF;</span><span>&#xFEFF;</span>",i.moveToElementText(l.lastChild),i.select(),o.doc.selection.clear(),l.innerHTML="",f&&(f.innerHTML=""),t;c=o.nodeIndex(l),l=l.parentNode}if(c==d-1)try{if(g=l.childNodes[c],s=h.createControlRange(),s.addElement(g),s.select(),m=e.getRng(),m.item&&g===m.item(0))return}catch(v){}}r(!0),r(),i.select()},this.getRangeAt=r}return e}),r(S,[m],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(T,[S,f,m],function(e,n,r){return function(i,o){function a(e){return o.settings.object_resizing===!1?!1:/TABLE|IMG|DIV/.test(e.nodeName)?"false"===e.getAttribute("data-mce-resize")?!1:!0:!1}function s(t){var n,r;n=t.screenX-E,r=t.screenY-k,H=n*N[2]+R,M=r*N[3]+A,H=5>H?5:H,M=5>M?5:M,(e.modifierPressed(t)||"IMG"==x.nodeName&&0!==N[2]*N[3])&&(H=Math.round(M/B),M=Math.round(H*B)),b.setStyles(w,{width:H,height:M}),0>N[2]&&H>=w.clientWidth&&b.setStyle(w,"left",S+(R-H)),0>N[3]&&M>=w.clientHeight&&b.setStyle(w,"top",T+(A-M)),L||(o.fire("ObjectResizeStart",{target:x,width:R,height:A}),L=!0)}function l(){function e(e,t){t&&(x.style[e]||!o.schema.isValid(x.nodeName.toLowerCase(),e)?b.setStyle(x,e,t):b.setAttrib(x,e,t))}L=!1,e("width",H),e("height",M),b.unbind(D,"mousemove",s),b.unbind(D,"mouseup",l),P!=D&&(b.unbind(P,"mousemove",s),b.unbind(P,"mouseup",l)),b.remove(w),O&&"TABLE"!=x.nodeName||c(x),o.fire("ObjectResized",{target:x,width:H,height:M}),o.nodeChanged()}function c(e,n,r){var i,c,d,f,p;i=b.getPos(e,o.getBody()),S=i.x,T=i.y,p=e.getBoundingClientRect(),c=p.width||p.right-p.left,d=p.height||p.bottom-p.top,x!=e&&(g(),x=e,H=M=0),f=o.fire("ObjectSelected",{target:e}),a(e)&&!f.isDefaultPrevented()?C(_,function(e,i){function a(t){L=!0,E=t.screenX,k=t.screenY,R=x.clientWidth,A=x.clientHeight,B=A/R,N=e,w=x.cloneNode(!0),b.addClass(w,"mce-clonedresizable"),w.contentEditable=!1,w.unSelectabe=!0,b.setStyles(w,{left:S,top:T,margin:0}),w.removeAttribute("data-mce-selected"),o.getBody().appendChild(w),b.bind(D,"mousemove",s),b.bind(D,"mouseup",l),P!=D&&(b.bind(P,"mousemove",s),b.bind(P,"mouseup",l))}var u,f;return n?(i==n&&a(r),t):(u=b.get("mceResizeHandle"+i),u?b.show(u):(f=o.getBody(),u=b.add(f,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":!0,"class":"mce-resizehandle",contentEditable:!1,unSelectabe:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),b.bind(u,"mousedown",function(e){e.preventDefault(),a(e)})),b.setStyles(u,{left:c*e[0]+S-u.offsetWidth/2,top:d*e[1]+T-u.offsetHeight/2}),t)}):u(),x.setAttribute("data-mce-selected","1")}function u(){var e,t;x&&x.removeAttribute("data-mce-selected");for(e in _)t=b.get("mceResizeHandle"+e),t&&(b.unbind(t),b.remove(t))}function d(e){function n(e,t){do if(e===t)return!0;while(e=e.parentNode)}var r;return C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=b.getParent(r,O?"table":"table,img,hr"),r&&n(i.getStart(),r)&&n(i.getEnd(),r)&&(!O||r!=i.getStart()&&"IMG"!==i.getStart().nodeName)?(c(r),t):(u(),t)}function f(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function p(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function h(e){var t=e.srcElement,n,r,i,a,s,l,u;n=t.getBoundingClientRect(),l=e.clientX-n.left,u=e.clientY-n.top;for(r in _)if(i=_[r],a=t.offsetWidth*i[0],s=t.offsetHeight*i[1],8>Math.abs(a-l)&&8>Math.abs(s-u)){N=i;break}L=!0,o.getDoc().selection.empty(),c(t,r,e)}function m(e){var n=e.srcElement;if(n!=x){if(g(),0===n.id.indexOf("mceResizeHandle"))return e.returnValue=!1,t;("IMG"==n.nodeName||"TABLE"==n.nodeName)&&(u(),x=n,f(n,"resizestart",h))}}function g(){p(x,"resizestart",h)}function v(e){var t;if(O){t=D.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function y(){x=w=null,O&&(g(),p(o.getBody(),"controlselect",m))}var b=o.dom,C=n.each,x,w,_,N,E,k,S,T,R,A,B,L,H,M,D=o.getDoc(),P=document,O=r.ie;_={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var I=".mce-content-body";return o.contentStyles.push(I+" div.mce-resizehandle {"+"position: absolute;"+"border: 1px solid black;"+"background: #FFF;"+"width: 5px;"+"height: 5px;"+"z-index: 10000"+"}"+I+" .mce-resizehandle:hover {"+"background: #000"+"}"+I+" img[data-mce-selected], hr[data-mce-selected] {"+"outline: 1px solid black;"+"resize: none"+"}"+I+" .mce-clonedresizable {"+"position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;"+"filter: alpha(opacity=50);"+"z-index: 10000"+"}"),o.on("init",function(){if(O)o.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(u(),v(e.target))}),f(o.getBody(),"controlselect",m);else try{o.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}o.on("nodechange mousedown ResizeEditor",d),o.on("keydown keyup",function(e){x&&"TABLE"==x.nodeName&&d(e)})}),{controlSelect:v,destroy:y}}}),r(R,[d,k,T,m,f],function(e,n,r,i,o){function a(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var s=o.each,l=o.grep,c=o.trim,u=i.ie,d=i.opera;return a.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?""+o:""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=""+r,/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return s(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+u);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,l,c,u,d,f,p,h="&#xFEFF;",m;if(2==e)return p=o.getNode(),f=p.nodeName,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(l=o.getRng(),u=a.uniqueId(),d=o.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_start" style="'+m+'">'+h+"</span>"),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML('<span data-mce-type="bookmark" id="'+u+'_end" style="'+m+'">'+h+"</span>"))
5}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(l.cloneRange()),d||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},h))),l=r(l),l.collapse(!0),l.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return o.moveToBookmark({id:u,keep:1}),{id:u}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,s;if(n){for(o=n[0],i=c,r=n.length-1;r>=1;r--){if(s=i.childNodes,n[r]>s.length-1)return;i=s[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,c,u=e.keep;if(n&&(r=n.parentNode,"start"==t?(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),f=p=r,h=m=i):(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,m=i),!u)){for(c=n.previousSibling,a=n.nextSibling,s(l(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);c&&a&&c.nodeType==a.nodeType&&3==c.nodeType&&!d&&(i=c.nodeValue.length,c.appendData(a.nodeValue),o.remove(a),"start"==t?(f=p=c,h=m=i):(p=c,m=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||u||(e.innerHTML='<br data-mce-bogus="1" />'),e}var i=this,o=i.dom,a,c,f,p,h,m;if(e)if(e.start){if(a=o.createRng(),c=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),f&&(a=o.createRng(),a.setStart(r(f),h),a.setEnd(r(p),m),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(n,r){function i(n,r){var i=new e(n,n);do{if(3==n.nodeType&&0!==c(n.nodeValue).length)return r?s.setStart(n,0):s.setEnd(n,n.nodeValue.length),t;if("BR"==n.nodeName)return r?s.setStartBefore(n):s.setEndBefore(n),t}while(n=r?i.next():i.prev())}var o=this,a=o.dom,s=a.createRng(),l;if(n){if(!r&&o.controlSelection.controlSelect(n))return;l=a.nodeIndex(n),s.setStart(n.parentNode,l),s.setEnd(n.parentNode,l+1),r&&(i(n,1),i(n)),o.setRng(s)}return n},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,o=t.win.document;if(e&&t.tridentSel)return t.tridentSel.getRangeAt(0);try{(n=t.getSel())&&(r=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():o.createRange())}catch(a){}return u&&r&&r.setStart&&o.selection.createRange().item&&(i=o.selection.createRange().item(0),r=o.createRange(),r.setStartBefore(i),r.setEndAfter(i)),r||(r=o.createRange?o.createRange():o.body.createTextRange()),r.setStart&&9===r.startContainer.nodeType&&r.collapsed&&(i=t.dom.getRoot(),r.setStart(i,0),r.setEnd(i,0)),t.selectedRange&&t.explicitRange&&(0===r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)&&0===r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)?r=t.explicitRange:(t.selectedRange=null,t.explicitRange=null)),r},setRng:function(e,n){var r=this,i;if(e.select)try{e.select()}catch(o){}else if(r.tridentSel){if(e.cloneRange)try{return r.tridentSel.addRange(e),t}catch(o){}}else if(i=r.getSel()){r.explicitRange=e;try{i.removeAllRanges()}catch(o){}i.addRange(e),n===!1&&i.extend&&(i.collapse(e.endContainer,e.endOffset),i.extend(e.startContainer,e.startOffset)),r.selectedRange=i.rangeCount>0?i.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset;return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):n.item?n.item(0):n.parentElement():t.dom.getRoot()},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a=[];if(t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&a.push(t),t&&n&&t!=n){o=t;for(var s=new e(t,i.getRoot());(o=s.next())&&o!=n;)i.isBlock(o)&&a.push(o)}return n&&t!=n&&a.push(n),a},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),0>=n.compareBoundaryPoints(n.START_TO_START,r)):!0},normalize:function(){function n(n){function s(t,n){for(var r=new e(t,p.getParent(t.parentNode,p.isBlock)||h);t=r[n?"prev":"next"]();)if("BR"===t.nodeName)return!0}function l(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function c(n,r){var i,s;for(r=r||u,i=new e(r,p.getParent(r.parentNode,p.isBlock)||h);m=i[n?"prev":"next"]();){if(3===m.nodeType&&m.nodeValue.length>0)return u=m,d=n?m.nodeValue.length:0,o=!0,t;if(p.isBlock(m)||g[m.nodeName.toLowerCase()])return;s=m}a&&s&&(u=s,o=!0,d=0)}var u,d,f,p=r.dom,h=p.getRoot(),m,g,v;if(u=i[(n?"start":"end")+"Container"],d=i[(n?"start":"end")+"Offset"],g=p.schema.getNonEmptyElements(),9===u.nodeType&&(u=p.getRoot(),d=0),u===h){if(n&&(m=u.childNodes[d>0?d-1:0],m&&(v=m.nodeName.toLowerCase(),g[m.nodeName]||"TABLE"==m.nodeName)))return;if(u.hasChildNodes()&&(d=Math.min(!n&&d>0?d-1:d,u.childNodes.length-1),u=u.childNodes[d],d=0,u.hasChildNodes()&&!/TABLE/.test(u.nodeName))){m=u,f=new e(u,h);do{if(3===m.nodeType&&m.nodeValue.length>0){d=n?0:m.nodeValue.length,u=m,o=!0;break}if(g[m.nodeName.toLowerCase()]){d=p.nodeIndex(m),u=m.parentNode,"IMG"!=m.nodeName||n||d++,o=!0;break}}while(m=n?f.next():f.prev())}}a&&(3===u.nodeType&&0===d&&c(!0),1===u.nodeType&&(m=u.childNodes[d],!m||"BR"!==m.nodeName||l(m,"A")||s(m)||s(m,!0)||c(!0,u.childNodes[d]))),n&&!a&&3===u.nodeType&&d===u.nodeValue.length&&c(!1),o&&i["set"+(n?"Start":"End")](u,d)}var r=this,i,o,a;u||(i=r.getRng(),a=i.collapsed,n(!0),a||n(),o&&(a&&i.collapse(!0),r.setRng(i,r.isForward())))},selectorChanged:function(e,n){var r=this,i;return r.selectorChangedData||(r.selectorChangedData={},i={},r.editor.on("NodeChange",function(e){var n=e.element,o=r.dom,a=o.getParents(n,null,o.getRoot()),l={};s(r.selectorChangedData,function(e,n){s(a,function(r){return o.is(r,n)?(i[n]||(s(e,function(e){e(!0,{node:r,selector:n,parents:a})}),i[n]=e),l[n]=e,!1):t})}),s(i,function(e,t){l[t]||(delete i[t],s(e,function(e){e(!1,{node:n,selector:t,parents:a})}))})})),r.selectorChangedData[e]||(r.selectorChangedData[e]=[]),r.selectorChangedData[e].push(n),r},scrollIntoView:function(e){var t,n,r=this,i=r.dom;n=i.getViewPort(r.editor.getWin()),t=i.getPos(e).y,(n.y>t||t+25>n.y+n.h)&&r.editor.getWin().scrollTo(0,n.y>t?t:t-n.h+25)},destroy:function(){this.win=null,this.controlSelection.destroy()}},a}),r(A,[f],function(e){function n(e){this.walk=function(n,i){function o(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function a(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function s(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function l(e,t,n){var r=n?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=a(g==e?g:g[r],r),y.length&&(n||y.reverse(),i(o(y)))}var c=n.startContainer,u=n.startOffset,d=n.endContainer,f=n.endOffset,p,h,m,g,v,y,b;if(b=e.select("td.mce-item-selected,th.mce-item-selected"),b.length>0)return r(b,function(e){i([e])}),t;if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=d.childNodes[Math.min(f-1,d.childNodes.length-1)]),c==d)return i(o([c]));for(p=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return l(c,p,!0);if(g===p)break}for(g=d;g;g=g.parentNode){if(g===c)return l(d,p);if(g===p)break}h=s(c,p)||c,m=s(d,p)||d,l(c,h,!0),y=a(h==c?h:h.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&i(o(y)),l(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&n.nodeValue.length>r&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&n.nodeValue.length>r&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&i.nodeValue.length>o&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}}}var r=e.each;return n.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},n}),r(B,[d,A,f],function(e,n,r){return function(i){function o(e){return e.nodeType&&(e=e.nodeName),!!i.schema.getTextBlockElements()[e.toLowerCase()]}function a(e,t){return I.getParents(e,t,I.getRoot())}function s(e){return 1===e.nodeType&&"_mce_caret"===e.id}function l(){d({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:!1},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){et(n,function(t,n){I.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),et("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){d(e,{block:e,remove:"all"})}),d(i.settings.formats)}function c(){i.addShortcut("ctrl+b","bold_desc","Bold"),i.addShortcut("ctrl+i","italic_desc","Italic"),i.addShortcut("ctrl+u","underline_desc","Underline");for(var e=1;6>=e;e++)i.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);i.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),i.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),i.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function u(e){return e?O[e]:O}function d(e,t){e&&("string"!=typeof e?et(e,function(e,t){d(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function f(e){var t;return i.dom.getParent(e,function(e){return t=i.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function p(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=f(e.parentNode),i.dom.getStyle(e,"color")&&t?i.dom.setStyle(e,"text-decoration",t):i.dom.getStyle(e,"textdecoration")===t&&i.dom.setStyle(e,"text-decoration",null))}function h(n,r,a){function l(e,t){t=t||g,e&&(t.onformat&&t.onformat(e,t,r,a),et(t.styles,function(t,n){I.setStyle(e,n,E(t,r))}),et(t.attributes,function(t,n){I.setAttrib(e,n,E(t,r))}),et(t.classes,function(t){t=E(t,r),I.hasClass(e,t)||I.addClass(e,t)}))}function c(){function t(t,n){var r=new e(n);for(a=r.current();a;a=r.prev())if(a.childNodes.length>1||a==t||"BR"==a.tagName)return a}var n=i.selection.getRng(),r=n.startContainer,o=n.endContainer;if(r!=o&&0===n.endOffset){var s=t(r,o),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function d(e,n,r,i,o){var a=[],s=-1,l,c=-1,u=-1,d;return et(e.childNodes,function(e,n){return"UL"===e.nodeName||"OL"===e.nodeName?(s=n,l=e,!1):t}),et(e.childNodes,function(e,t){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==n.id+"_start"?c=t:e.id==n.id+"_end"&&(u=t))}),0>=s||s>c&&u>s?(et(tt(e.childNodes),o),0):(d=I.clone(r,K),et(tt(e.childNodes),function(e,t){(s>c&&s>t||c>s&&t>s)&&(a.push(e),e.parentNode.removeChild(e))}),s>c?e.insertBefore(d,l):c>s&&e.insertBefore(d,l.nextSibling),i.push(d),et(a,function(e){d.appendChild(e)}),d)}function f(e,i,a){var c=[],u,f,p=!0;u=g.inline||g.block,f=I.create(u),l(f),W.walk(e,function(e){function h(e){var b,x,w,N,E;return E=p,b=e.nodeName.toLowerCase(),x=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(E=p,p="true"===J(e),N=!0),_(b,"br")?(y=0,g.block&&I.remove(e),t):g.wrapper&&v(e,n,r)?(y=0,t):p&&!N&&g.block&&!g.wrapper&&o(b)&&z(x,u)?(e=I.rename(e,u),l(e),c.push(e),y=0,t):g.selector&&(et(m,function(t){"collapsed"in t&&t.collapsed!==C||I.is(e,t.selector)&&!s(e)&&(l(e,t),w=!0)}),!g.inline||w)?(y=0,t):(!p||N||!z(u,b)||!z(x,u)||!a&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||s(e)||g.inline&&V(e)?"li"==b&&i?y=d(e,i,f,c,h):(y=0,et(tt(e.childNodes),h),N&&(p=E),y=0):(y||(y=I.clone(f,K),e.parentNode.insertBefore(y,e),c.push(y)),y.appendChild(e)),t)}var y;et(e,h)}),g.wrap_links===!1&&et(c,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(f,K),c.push(r),i=tt(e.childNodes),n=0;i.length>n;n++)r.appendChild(i[n]);e.appendChild(r)}et(tt(e.childNodes),t)}t(e)}),et(c,function(e){function i(e){var t=0;return et(e.childNodes,function(e){k(e)||L(e)||t++}),t}function o(e){var n,r;return et(e.childNodes,function(e){return 1!=e.nodeType||L(e)||s(e)?t:(n=e,K)}),n&&w(n,g)&&(r=I.clone(n,K),l(r),I.replace(r,e,G),I.remove(n,1)),r||e}var a;if(a=i(e),(c.length>1||!V(e))&&0===a)return I.remove(e,1),t;if(g.inline||g.wrapper){if(g.exact||1!==a||(e=o(e)),et(m,function(t){et(I.select(t.inline,e),function(e){var n;if(t.wrap_links===!1){n=e.parentNode;do if("A"===n.nodeName)return;while(n=n.parentNode)}R(t,r,e,t.exact?e:null)})}),v(e.parentNode,n,r))return I.remove(e,1),e=0,G;g.merge_with_parents&&I.getParent(e.parentNode,function(i){return v(i,n,r)?(I.remove(e,1),e=0,G):t}),e&&g.merge_siblings!==!1&&(e=H(B(e),e),e=H(e,B(e,G)))}})}var m=u(n),g=m[0],y,b,C=!a&&F.isCollapsed();if(g)if(a)a.nodeType?(b=I.createRng(),b.setStartBefore(a),b.setEndAfter(a),f(T(b,m),null,!0)):f(a,null,!0);else if(C&&g.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)D("apply",n,r);else{var x=i.selection.getNode();U||!m[0].defaultBlock||I.getParent(x,I.isBlock)||h(m[0].defaultBlock),i.selection.setRng(c()),y=F.getBookmark(),f(T(F.getRng(G),m),y),g.styles&&(g.styles.color||g.styles.textDecoration)&&(nt(x,p,"childNodes"),p(x)),F.moveToBookmark(y),P(F.getRng(G)),i.nodeChanged()}}function m(e,n,r){function o(e){var t,r,i,a,s;if(1===e.nodeType&&J(e)&&(a=C,C="true"===J(e),s=!0),t=tt(e.childNodes),C&&!s)for(r=0,i=h.length;i>r&&!R(h[r],n,e,e);r++);if(m.deep&&t.length){for(r=0,i=t.length;i>r;r++)o(t[r]);s&&(C=a)}}function s(t){var r;return et(a(t.parentNode).reverse(),function(t){var i;r||"_start"==t.id||"_end"==t.id||(i=v(t,e,n),i&&i.split!==!1&&(r=t))}),r}function l(e,t,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=t.parentNode;o&&o!=u;o=o.parentNode){for(a=I.clone(o,K),c=0;h.length>c;c++)if(R(h[c],n,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||m.mixed&&V(e)||(t=I.split(e,t)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return t}function c(e){return l(s(e),e,e,!0)}function d(e){var t=I.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return L(n)&&(n=n[e?"firstChild":"lastChild"]),I.remove(t,!0),n}function p(e){var t,n;e=T(e,h,G),m.split&&(t=M(e,G),n=M(e),t!=n?(/^(TR|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TD"==t.nodeName?t.firstChild||t:t.firstChild.firstChild||t),t=S(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=S(n,"span",{id:"_end","data-mce-type":"bookmark"}),c(t),c(n),t=d(G),n=d()):t=n=c(t),e.startContainer=t.parentNode,e.startOffset=q(t),e.endContainer=n.parentNode,e.endOffset=q(n)+1),W.walk(e,function(e){et(e,function(e){o(e),1===e.nodeType&&"underline"===i.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===f(e.parentNode)&&R({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=u(e),m=h[0],g,b,C=!0;return r?(r.nodeType?(b=I.createRng(),b.setStartBefore(r),b.setEndAfter(r),p(b)):p(r),t):(F.isCollapsed()&&m.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length?D("remove",e,n):(g=F.getBookmark(),p(F.getRng(G)),F.moveToBookmark(g),m.inline&&y(e,n,F.getStart())&&P(F.getRng(!0)),i.nodeChanged()),t)}function g(e,t,n){var r=u(e);!y(e,t,n)||"toggle"in r[0]&&!r[0].toggle?h(e,t,n):m(e,t,n)}function v(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===X){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?I.getAttrib(e,o):N(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!_(a,E(s[o],n)))return}}else for(l=0;s.length>l;l++)if("attributes"===i?I.getAttrib(e,s[l]):N(e,s[l]))return t;return t}var o=u(t),a,s,l;if(o&&e)for(s=0;o.length>s;s++)if(a=o[s],w(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;l.length>s;s++)if(!I.hasClass(e,l[s]))return;return a}}function y(e,t,n){function r(n){return n=I.getParent(n,function(n){return!!v(n,e,t,!0)}),v(n,e,t)}var i;return n?r(n):(n=F.getNode(),r(n)?G:(i=F.getStart(),i!=n&&r(i)?G:K))}function b(e,t){var n,r=[],i={};return n=F.getStart(),I.getParent(n,function(n){var o,a;for(o=0;e.length>o;o++)a=e[o],!i[a]&&v(n,a,t)&&(i[a]=!0,r.push(a))},I.getRoot()),r}function C(e){var t=u(e),n,r,i,o,s;if(t)for(n=F.getStart(),r=a(n),o=t.length-1;o>=0;o--){if(s=t[o].selector,!s)return G;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return G}return K}function x(e,n,r){var o;return Y||(Y={},o={},i.on("NodeChange",function(e){var n=a(e.element),r={};et(Y,function(e,i){et(n,function(a){return v(a,i,{},e.similar)?(o[i]||(et(e,function(e){e(!0,{node:a,format:i,parents:n})}),o[i]=e),r[i]=e,!1):t})}),et(o,function(t,i){r[i]||(delete o[i],et(t,function(t){t(!1,{node:e.element,format:i,parents:n})}))})})),et(e.split(","),function(e){Y[e]||(Y[e]=[],Y[e].similar=r),Y[e].push(n)}),this}function w(e,n){return _(e,n.inline)?G:_(e,n.block)?G:n.selector?1==e.nodeType&&I.is(e,n.selector):t}function _(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function N(e,t){var n=I.getStyle(e,t);return("color"==t||"backgroundColor"==t)&&(n=I.toHex(n)),"fontWeight"==t&&700==n&&(n="bold"),""+n}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function k(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(n,r,s){function l(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var n,i,o,a,s;if(n=i=e?v:b,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==n.nodeType&&!k(n)&&(e?y>0:n.nodeValue.length>C))return n;for(;;){if(!r[0].block_expand&&V(i))return i;for(o=i[a];o;o=o[a])if(!L(o)&&!k(o)&&!t(o))return i;if(i.parentNode==s){n=i;break}i=i.parentNode}return n}function c(e,t){for(t===X&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function u(e){for(var t=e;t;){if(1===t.nodeType&&J(t))return"false"===J(t)?t:e;t=t.parentNode}return e}function d(n,r,o){function a(e,n){var r,i,a=e.nodeValue;return n===t&&(n=o?a.length:0),o?(r=a.lastIndexOf(" ",n),i=a.lastIndexOf("\u00a0",n),r=r>i?r:i,-1===r||s||r++):(r=a.indexOf(" ",n),i=a.indexOf("\u00a0",n),r=-1!==r&&(-1===i||i>r)?r:i),r}var l,c,u,d;if(3===n.nodeType){if(u=a(n,r),-1!==u)return{container:n,offset:u};d=n}for(l=new e(n,I.getParent(n,V)||i.getBody());c=l[o?"prev":"next"]();)if(3===c.nodeType){if(d=c,u=a(c),-1!==u)return{container:c,offset:u}}else if(V(c))break;return d?(r=o?0:d.length,{container:d,offset:r}):t}function f(e,t){var i,o,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[t]&&(e=e[t]),i=a(e),o=0;i.length>o;o++)for(s=0;r.length>s;s++)if(l=r[s],!("collapsed"in l&&l.collapsed!==n.collapsed)&&I.is(i[o],l.selector))return i[o];return e}function p(e,t){var n;if(r[0].wrapper||(n=I.getParent(e,r[0].block)),n||(n=I.getParent(3==e.nodeType?e.parentNode:e,o)),n&&r[0].wrapper&&(n=a(n,"ul,ol").reverse()[0]||n),!n)for(n=e;n[t]&&!V(n[t])&&(n=n[t],!_(n,"br")););return n||e}var h,m,g,v=n.startContainer,y=n.startOffset,b=n.endContainer,C=n.endOffset;if(1==v.nodeType&&v.hasChildNodes()&&(h=v.childNodes.length-1,v=v.childNodes[y>h?h:y],3==v.nodeType&&(y=0)),1==b.nodeType&&b.hasChildNodes()&&(h=b.childNodes.length-1,b=b.childNodes[C>h?h:C-1],3==b.nodeType&&(C=b.nodeValue.length)),v=u(v),b=u(b),(L(v.parentNode)||L(v))&&(v=L(v)?v:v.parentNode,v=v.nextSibling||v,3==v.nodeType&&(y=0)),(L(b.parentNode)||L(b))&&(b=L(b)?b:b.parentNode,b=b.previousSibling||b,3==b.nodeType&&(C=b.length)),r[0].inline&&(n.collapsed&&(g=d(v,y,!0),g&&(v=g.container,y=g.offset),g=d(b,C),g&&(b=g.container,C=g.offset)),m=c(b,C),m.node)){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=c(m.node.previousSibling);m.node&&m.offset>0&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1)&&m.offset>1&&(b=m.node,b.splitText(m.offset-1))}return(r[0].inline||r[0].block_expand)&&(r[0].inline&&3==v.nodeType&&0!==y||(v=l(!0)),r[0].inline&&3==b.nodeType&&C!==b.nodeValue.length||(b=l())),r[0].selector&&r[0].expand!==K&&!r[0].inline&&(v=f(v,"previousSibling"),b=f(b,"nextSibling")),(r[0].block||r[0].selector)&&(v=p(v,"previousSibling"),b=p(b,"nextSibling"),r[0].block&&(V(v)||(v=l(!0)),V(b)||(b=l()))),1==v.nodeType&&(y=q(v),v=v.parentNode),1==b.nodeType&&(C=q(b)+1,b=b.parentNode),{startContainer:v,startOffset:y,endContainer:b,endOffset:C}}function R(e,n,r,i){var o,a,s;if(!w(r,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,t){e=E(e,n),"number"==typeof t&&(t=e,i=0),(!i||_(N(i,t),e))&&I.setStyle(r,t,""),s=1}),s&&""===I.getAttrib(r,"style")&&(r.removeAttribute("style"),r.removeAttribute("data-mce-style")),et(e.attributes,function(e,o){var a;if(e=E(e,n),"number"==typeof o&&(o=e,i=0),!i||_(I.getAttrib(i,o),e)){if("class"==o&&(e=I.getAttrib(r,o),e&&(a="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(a+=(a?" ":"")+e)}),a)))return I.setAttrib(r,o,a),t;"class"==o&&r.removeAttribute("className"),j.test(o)&&r.removeAttribute("data-mce-"+o),r.removeAttribute(o)}}),et(e.classes,function(e){e=E(e,n),(!i||I.hasClass(i,e))&&I.removeClass(r,e)}),a=I.getAttribs(r),o=0;a.length>o;o++)if(0!==a[o].nodeName.indexOf("_"))return K;return"none"!=e.remove?(A(r,e),G):t}function A(e,t){function n(e,t,n){return e=B(e,t,n),!e||"BR"==e.nodeName||V(e)}var r=e.parentNode,i;t.block&&(U?r==I.getRoot()&&(t.list_block&&_(e,t.list_block)||et(tt(e.childNodes),function(e){z(U,e.nodeName.toLowerCase())?i?i.appendChild(e):i=S(e,U):i=0})):V(e)&&!V(r)&&(n(e,K)||n(e.firstChild,G,1)||e.insertBefore(I.create("br"),e.firstChild),n(e,G)||n(e.lastChild,K,1)||e.appendChild(I.create("br")))),t.selector&&t.inline&&!_(t.inline,e)||I.remove(e,1)}function B(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!k(e))return e}function L(e){return e&&1==e.nodeType&&"bookmark"==e.getAttribute("data-mce-type")}function H(e,t){function n(e,t){function n(e){var t={};return et(I.getAttribs(e),function(n){var r=n.nodeName.toLowerCase();0!==r.indexOf("_")&&"style"!==r&&(t[r]=I.getAttrib(e,r))}),t}function r(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],n===X)return K;if(e[r]!=n)return K;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return K;return G}return e.nodeName!=t.nodeName?K:r(n(e),n(t))?r(I.parseStyle(I.getAttrib(e,"style")),I.parseStyle(I.getAttrib(t,"style")))?G:K:K}function r(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!L(i))return i}return e}var i,o;if(e&&t&&(e=r(e,"previousSibling"),t=r(t,"nextSibling"),n(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return I.remove(t),et(tt(t.childNodes),function(t){e.appendChild(t)}),e}return t}function M(t,n){var r,o,a;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],1==r.nodeType&&(a=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[o>a?a:o]),3===r.nodeType&&n&&o>=r.nodeValue.length&&(r=new e(r,i.getBody()).next()||r),3!==r.nodeType||n||0!==o||(r=new e(r,i.getBody()).prev()||r),r}function D(t,n,r){function o(e){var t=I.create("span",{id:g,"data-mce-bogus":!0,style:y?"color:red":""});return e&&t.appendChild(i.getDoc().createTextNode($)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function s(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function l(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function c(e,t){var n,r;if(e)r=F.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=l(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=s(F.getStart()),!e)for(;e=I.get(g);)c(e,!1)}function d(){var e,t,i,a,c,d,f;e=F.getRng(!0),a=e.startOffset,d=e.startContainer,f=d.nodeValue,t=s(F.getStart()),t&&(i=l(t)),f&&a>0&&f.length>a&&/\w/.test(f.charAt(a))&&/\w/.test(f.charAt(a-1))?(c=F.getBookmark(),e.collapse(!0),e=T(e,u(n)),e=W.split(e),h(n,r,e),F.moveToBookmark(c)):(t&&i.nodeValue===$?h(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,h(n,r,t)),F.setCursorLocation(i,a))}function f(){var e=F.getRng(!0),t,i,a,s,l,c,d=[],f,p;for(t=e.startContainer,i=e.startOffset,l=t,3==t.nodeType&&((i!=t.nodeValue.length||t.nodeValue===$)&&(s=!0),l=l.parentNode);l;){if(v(l,n,r)){c=l;break}l.nextSibling&&(s=!0),d.push(l),l=l.parentNode}if(c)if(s)a=F.getBookmark(),e.collapse(!0),e=T(e,u(n),!0),e=W.split(e),m(n,r,e),F.moveToBookmark(a);else{for(p=o(),l=p,f=d.length-1;f>=0;f--)l.appendChild(I.clone(d[f],!1)),l=l.firstChild;l.appendChild(I.doc.createTextNode($)),l=l.firstChild,I.insertAfter(p,c),F.setCursorLocation(l,1)}}function p(){var e;e=s(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===g||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",y=i.settings.caret_debug;i._hasCaretEvents||(Z=function(){var e=[],t;if(a(s(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;c(),(8==t||37==t||39==t)&&c(s(F.getStart())),p()},i.on("SetContent",function(e){e.selection&&p()}),i._hasCaretEvents=!0),"apply"==t?d():f()}function P(n){var r=n.startContainer,i=n.startOffset,o,a,s,l,c;if(3==r.nodeType&&i>=r.nodeValue.length&&(i=q(r),r=r.parentNode,o=!0),1==r.nodeType)for(l=r.childNodes,r=l[Math.min(i,l.length-1)],a=new e(r,I.getParent(r,I.isBlock)),(i>l.length-1||o)&&a.next(),s=a.current();s;s=a.next())if(3==s.nodeType&&!k(s))return c=I.create("a",null,$),s.parentNode.insertBefore(c,s),n.setStart(s,0),F.setRng(n),I.remove(c),t}var O={},I=i.dom,F=i.selection,W=new n(I),z=i.schema.isValidChild,V=I.isBlock,U=i.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,G=!0,Y,X,J=I.getContentEditable,Q,Z,et=r.each,tt=r.grep,nt=r.walk,rt=r.extend;rt(this,{get:u,register:d,apply:h,remove:m,toggle:g,match:y,matchAll:b,matchNode:v,canApply:C,formatChanged:x}),l(),c(),i.on("BeforeGetContent",function(){Z&&Z()}),i.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(L,[m,f],function(e,n){var r=n.trim,i;return i=RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","<div[^>]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(n){function o(){return r(n.getContent({format:"raw",no_events:1}).replace(i,""))}function a(){s.typing=!1,s.add()}var s,l=0,c=[],u;return n.on("init",function(){s.add()}),n.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s.beforeChange()}),n.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s.add()}),n.on("ObjectResizeStart",function(){s.beforeChange()}),n.on("SaveContent ObjectResized",a),n.dom.bind(n.dom.getRoot(),"dragend",a),n.dom.bind(n.getBody(),"focusout",function(){!n.removed&&s.typing&&a()}),n.on("KeyUp",function(t){var r=t.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||t.ctrlKey)&&(a(),n.nodeChanged()),(46==r||8==r||e.isMac&&(91==r||93==r))&&n.nodeChanged()}),n.on("KeyDown",function(e){var n=e.keyCode;return n>=33&&36>=n||n>=37&&40>=n||45==n?(s.typing&&a(),t):((16>n||n>20)&&224!=n&&91!=n&&!s.typing&&(s.beforeChange(),s.typing=!0,s.add()),t)}),n.on("MouseDown",function(){s.typing&&a()}),n.addShortcut("ctrl+z","undo_desc","Undo"),n.addShortcut("ctrl+y","redo_desc","Redo"),n.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||n.nodeChanged()}),s={data:c,typing:!1,beforeChange:function(){u=n.selection.getBookmark(2,!0)},add:function(e){var t,r=n.settings,i;if(e=e||{},e.content=o(),n.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(i=c[l],i&&i.content==e.content)return null;if(c[l]&&(c[l].beforeBookmark=u),r.custom_undo_redo_levels&&c.length>r.custom_undo_redo_levels){for(t=0;c.length-1>t;t++)c[t]=c[t+1];c.length--,l=c.length}return e.bookmark=n.selection.getBookmark(2,!0),c.length-1>l&&(c.length=l+1),c.push(e),l=c.length-1,n.fire("AddUndo",{level:e,lastLevel:i}),n.isNotDirty=0,e},undo:function(){var e;return s.typing&&(s.add(),s.typing=!1),l>0&&(e=c[--l],n.setContent(e.content,{format:"raw"}),n.selection.moveToBookmark(e.beforeBookmark),n.fire("undo",{level:e})),e},redo:function(){var e;return c.length-1>l&&(e=c[++l],n.setContent(e.content,{format:"raw"}),n.selection.moveToBookmark(e.bookmark),n.fire("redo",{level:e})),e},clear:function(){c=[],l=0,s.typing=!1,n.fire("ClearUndos")},hasUndo:function(){return l>0||s.typing&&c[0]&&o()!=c[0].content},hasRedo:function(){return c.length-1>l&&!this.typing},transact:function(e){s.beforeChange(),e(),s.add()}}}}),r(H,[d,m],function(e,n){var r=n.ie;return function(n){function i(i){function d(e){return e&&o.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==o.getContentEditable(e)}function f(e){var t;o.isBlock(e)&&(t=a.getRng(),e.appendChild(o.create("span",null,"\u00a0")),a.select(e),e.lastChild.outerHTML="",a.setRng(t))}function p(e){for(var t=e,n=[],r;t=t.firstChild;){if(o.isBlock(t))return;1!=t.nodeType||u[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?o.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&o.remove(t)
6}function h(t){var n,r,i,s=t,l;if(i=o.createRng(),t.hasChildNodes()){for(n=new e(t,t);r=n.current();){if(3==r.nodeType){i.setStart(r,0),i.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){i.setStartBefore(r),i.setEndBefore(r);break}s=r,r=n.next()}r||(i.setStart(s,0),i.setEnd(s,0))}else"BR"==t.nodeName?t.nextSibling&&o.isBlock(t.nextSibling)?((!A||9>A)&&(l=o.create("br"),t.parentNode.insertBefore(l,t)),i.setStartBefore(t),i.setEndBefore(t)):(i.setStartAfter(t),i.setEndAfter(t)):(i.setStart(t,0),i.setEnd(t,0));a.setRng(i),o.remove(l),a.scrollIntoView(t)}function m(e){var t=S,n,i,a;if(n=e||"TABLE"==D?o.create(e||O):R.cloneNode(!1),a=n,s.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),o.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(a=i,n.appendChild(i))}while(t=t.parentNode);return r||(a.innerHTML='<br data-mce-bogus="1">'),n}function g(t){var n,r,i;if(3==S.nodeType&&(t?T>0:S.nodeValue.length>T))return!1;if(S.parentNode==R&&I&&!t)return!0;if(t&&1==S.nodeType&&S==R.firstChild)return!0;if("TABLE"===S.nodeName||S.previousSibling&&"TABLE"==S.previousSibling.nodeName)return I&&!t||!I&&t;for(n=new e(S,R),3==S.nodeType&&(t&&0===T?n.prev():t||T!=S.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),u[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function v(e,t){var r,i,a,s,l,u,f=O||"P";if(i=o.getParent(e,o.isBlock),u=n.getBody().nodeName.toLowerCase(),!i||!d(i)){if(i=i||k,!i.hasChildNodes())return r=o.create(f),i.appendChild(r),N.setStart(r,0),N.setEnd(r,0),r;for(s=e;s.parentNode!=i;)s=s.parentNode;for(;s&&!o.isBlock(s);)a=s,s=s.previousSibling;if(a&&c.isValidChild(u,f.toLowerCase())){for(r=o.create(f),a.parentNode.insertBefore(r,a),s=a;s&&!o.isBlock(s);)l=s.nextSibling,r.appendChild(s),s=l;N.setStart(e,t),N.setEnd(e,t)}}return e}function y(){function e(e){for(var t=M[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===R}function t(){var e=M.parentNode;return"LI"==e.nodeName?e:M}var n=M.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(O="LI"),L=O?m(O):o.create("BR"),e(!0)&&e()?"LI"==n?o.insertAfter(L,t()):o.replace(L,M):e(!0)?"LI"==n?(o.insertAfter(L,t()),L.appendChild(o.doc.createTextNode(" ")),L.appendChild(M)):M.parentNode.insertBefore(L,M):e()?(o.insertAfter(L,t()),f(L)):(M=t(),E=N.cloneRange(),E.setStartAfter(R),E.setEndAfter(M),H=E.extractContents(),o.insertAfter(H,M),o.insertAfter(L,M)),o.remove(R),h(L),l.add()}function b(){for(var t=new e(S,R),n;n=t.next();)if(u[n.nodeName.toLowerCase()]||n.length>0)return!0}function C(){var e,t,n;S&&3==S.nodeType&&T>=S.nodeValue.length&&(r||b()||(e=o.create("br"),N.insertNode(e),N.setStartAfter(e),N.setEndAfter(e),t=!0)),e=o.create("br"),N.insertNode(e),r&&"PRE"==D&&(!A||8>A)&&e.parentNode.insertBefore(o.doc.createTextNode("\r"),e),n=o.create("span",{},"&nbsp;"),e.parentNode.insertBefore(n,e),a.scrollIntoView(n),o.remove(n),t?(N.setStartBefore(e),N.setEndBefore(e)):(N.setStartAfter(e),N.setEndAfter(e)),a.setRng(N),l.add()}function x(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function w(e){var t=o.getRoot(),n,r;for(n=e;n!==t&&"false"!==o.getContentEditable(n);)"true"===o.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function _(e){var t;r||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(o.getStyle(t,"float",!0)))&&o.add(e,"br"))}var N=a.getRng(!0),E,k,S,T,R,A,B,L,H,M,D,P,O,I;if(!N.collapsed)return n.execCommand("Delete"),t;if(!i.isDefaultPrevented()&&(S=N.startContainer,T=N.startOffset,O=(s.force_p_newlines?"p":"")||s.forced_root_block,O=O?O.toUpperCase():"",A=o.doc.documentMode,B=i.shiftKey,1==S.nodeType&&S.hasChildNodes()&&(I=T>S.childNodes.length-1,S=S.childNodes[Math.min(T,S.childNodes.length-1)]||S,T=I&&3==S.nodeType?S.nodeValue.length:0),k=w(S))){if(l.beforeChange(),!o.isBlock(k)&&k!=o.getRoot())return(!O||B)&&C(),t;if((O&&!B||!O&&B)&&(S=v(S,T)),R=o.getParent(S,o.isBlock),M=R?o.getParent(R.parentNode,o.isBlock):null,D=R?R.nodeName.toUpperCase():"",P=M?M.nodeName.toUpperCase():"","LI"!=P||i.ctrlKey||(R=M,D=P),"LI"==D){if(!O&&B)return C(),t;if(o.isEmpty(R))return y(),t}if("PRE"==D&&s.br_in_pre!==!1){if(!B)return C(),t}else if(!O&&!B&&"LI"!=D||O&&B)return C(),t;O&&R===n.getBody()||(O=O||"P",g()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(D)&&"HGROUP"!=P?m(O):m(),s.end_container_on_empty_block&&d(M)&&o.isEmpty(R)?L=o.split(M,R):o.insertAfter(L,R),h(L)):g(!0)?(L=R.parentNode.insertBefore(m(),R),f(L)):(E=N.cloneRange(),E.setEndAfter(R),H=E.extractContents(),x(H),L=H.firstChild,o.insertAfter(H,R),p(L),_(R),h(L)),o.setAttrib(L,"id",""),l.add())}}var o=n.dom,a=n.selection,s=n.settings,l=n.undoManager,c=n.schema,u=c.getNonEmptyElements();n.on("keydown",function(e){13==e.keyCode&&i(e)!==!1&&e.preventDefault()})}}),r(M,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("KeyUp NodeChange",t)}}),r(D,[N,m,f],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f=!1;return function(n){function r(e,t,n){var r;return e=e.toLowerCase(),(r=_.exec[e])?(r(e,t,n),d):f}function p(e){var t;return e=e.toLowerCase(),(t=_.state[e])?t(e):-1}function h(e){var t;return e=e.toLowerCase(),(t=_.value[e])?t(e):f}function m(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){_[t][n]=e})})}function g(e,r,i){return r===t&&(r=f),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function v(e){return E.match(e)}function y(e,r){E.toggle(e,r?{value:r}:t),n.nodeChanged()}function b(e){k=w.getBookmark(e)}function C(){w.moveToBookmark(k)}var x=n.dom,w=n.selection,_={state:{},exec:{},value:{}},N=n.settings,E=n.formatter,k;o(this,{execCommand:r,queryCommandState:p,queryCommandValue:h,addCommands:m}),m({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(e){var t=n.getDoc(),r;try{g(e)}catch(i){r=d}(r||!t.queryCommandSupported(e))&&(c?n.windowManager.confirm(n.getLang("clipboard_msg"),function(e){e&&window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}):n.windowManager.alert("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."))},unlink:function(e){w.isCollapsed()&&w.select(w.getNode()),g(e),w.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&E.remove("align"+e)}),y("align"+t),r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;g(e),t=x.getParent(w.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(b(),x.split(n,t),C()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){y(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){y(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(N.font_size_style_values),r=l(N.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),y(e,n)},RemoveFormat:function(e){E.remove(e)},mceBlockQuote:function(){y("blockquote")},FormatBlock:function(e,t,n){return y(n||"p")},mceCleanup:function(){var e=w.getBookmark();n.setContent(n.getContent({cleanup:d}),{cleanup:d}),w.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||w.getNode();i!=n.getBody()&&(b(),n.dom.remove(i,d),C())},mceSelectNodeDepth:function(e,r,i){var o=0;x.getParent(w.getNode(),function(e){return 1==e.nodeType&&o++==i?(w.select(e),f):t},n.getBody())},mceSelectNode:function(e,t,n){w.select(n)},mceInsertContent:function(t,r,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=w.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^&nbsp;/," "):t("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),r.length>i?e=e.replace(/&nbsp;(<br>|)$/," "):t("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}var a,s,l,c,d,f,p,h,m,g,v,y,b,C;if(/^ | $/.test(i)&&(i=o(i)),a=n.parser,s=new e({},n.schema),b='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',f={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,b),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),l=w.getNode(),f={context:l.nodeName.toLowerCase()},d=a.parse(i,f),v=d.lastChild,"mce_marker"==v.attr("id"))for(p=v,v=v.prev;v;v=v.walk(!0))if(3==v.type||!x.isBlock(v.name)){v.parent.insert(p,v,"br"===v.name);break}if(f.invalid){for(w.setContent(b),l=w.getNode(),c=n.getBody(),9==l.nodeType?l=v=c:v=l;v!==c;)l=v,v=v.parentNode;i=l==c?c.innerHTML:x.getOuterHTML(l),i=s.serialize(a.parse(i.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return s.serialize(d)}))),l==c?x.setHTML(c,i):x.setOuterHTML(l,i)}else i=s.serialize(d),v=l.firstChild,y=l.lastChild,!v||v===y&&"BR"===v.nodeName?x.setHTML(l,i):w.setContent(i);p=x.get("mce_marker"),h=x.getRect(p),m=x.getViewPort(n.getWin()),(h.y+h.h>m.y+m.h||h.y<m.y||h.x>m.x+m.w||h.x<m.x)&&(C=u?n.getDoc().documentElement:n.getBody(),C.scrollLeft=h.x,C.scrollTop=h.y-m.h+25),g=x.createRng(),v=p.previousSibling,v&&3==v.nodeType?(g.setStart(v,v.nodeValue.length),u||(y=p.nextSibling,y&&3==y.nodeType&&(v.appendData(y.data),y.parentNode.removeChild(y)))):(g.setStartBefore(p),g.setEndBefore(p)),x.remove(p),w.setRng(g),n.fire("SetContent",f),n.addVisual()},mceInsertRawHTML:function(e,t,r){w.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){y(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,n,r;t=N.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),p("InsertUnorderedList")||p("InsertOrderedList")?g(e):(N.forced_root_block||x.getParent(w.getNode(),x.isBlock)||E.apply("div"),i(w.getSelectedBlocks(),function(i){var o;"LI"!=i.nodeName&&(o="rtl"==x.getStyle(i,"direction",!0)?"paddingRight":"paddingLeft","outdent"==e?(r=Math.max(0,parseInt(i.style[o]||0,10)-t),x.setStyle(i,o,r?r+n:"")):(r=parseInt(i.style[o]||0,10)+t+n,x.setStyle(i,o,r)))}))},mceRepaint:function(){if(c)try{b(d),w.getSel()&&w.getSel().selectAllChildren(n.getBody()),w.collapse(d),C()}catch(e){}},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,w.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=x.getParent(w.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||E.remove("link"),n.href&&E.apply("link",n,r)},selectAll:function(){var e=x.getRoot(),t=x.createRng();w.getRng().setStart?(t.setStart(e,0),t.setEnd(e,e.childNodes.length),w.setRng(t)):g("SelectAll")},mceNewDocument:function(){n.setContent("")}}),m({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=w.isCollapsed()?[x.getParent(w.getNode(),x.isBlock)]:w.getSelectedBlocks(),r=a(n,function(e){return!!E.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return v(e)},mceBlockQuote:function(){return v("blockquote")},Outdent:function(){var e;if(N.inline_styles){if((e=x.getParent(w.getStart(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=x.getParent(w.getEnd(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return p("InsertUnorderedList")||p("InsertOrderedList")||!N.inline_styles&&!!x.getParent(w.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=x.getParent(w.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),m({"FontSize,FontName":function(e){var t=0,n;return(n=x.getParent(w.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),m({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(P,[f],function(e){function n(e,o){var a=this,s,l;return e=i(e),o=a.settings=o||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?(a.source=e,t):(0===e.indexOf("/")&&0!==e.indexOf("//")&&(e=(o.base_uri?o.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new n(location.href).directory,e=(o.base_uri&&o.base_uri.protocol||"http")+"://mce_host"+a.toAbsPath(l,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),r(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s=o.base_uri,s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),t)}var r=e.each,i=e.trim;return n.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var t=this,r;if("./"===e)return e;if(e=new n(e,{base_uri:t}),"mce_host"!=e.host&&t.host!=e.host&&e.host||t.port!=e.port||t.protocol!=e.protocol)return e.getURI();var i=t.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=t.toRelPath(t.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,t){return e=new n(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?t:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var n,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),r(e,function(e){e&&o.push(e)}),e=o,n=t.length-1,o=[];n>=0;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?i>0?i--:o.push(t[n]):i++);return n=e.length-i,s=0>=n?o.reverse().join("/"):e.slice(0,n).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},n}),r(O,[f],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(I,[O,f],function(e,n){function r(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var i=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,o=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,a=/^\s*|\s*$/g,s,l=e.extend({init:function(e){function n(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):t}function r(e){return e?function(t){return t._name===e}:t}function s(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):t}function l(e,n,r){return e?function(t){var i=t[e]?t[e]():"";return n?"="===n?i===r:"*="===n?i.indexOf(r)>=0:"~="===n?(" "+i+" ").indexOf(" "+r+" ")>=0:"!="===n?i!=r:"^="===n?0===i.indexOf(r):"$="===n?i.substr(i.length-r.length)===r:!1:!!r}:t}function c(e){var n;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(n=d(e[1],[]),function(e){return!f(e,n)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?0===n%2:"odd"===e?1===n%2:t[e]?t[e]():!1})):t}function u(e,t,o){function u(e){e&&t.push(e)}var d;return d=i.exec(e.replace(a,"")),u(n(d[1])),u(r(d[2])),u(s(d[3])),u(l(d[4],d[5],d[6])),u(c(d[7])),t.psuedo=!!d[7],t.direct=o,t}function d(e,t){var n=[],r,i,a;do if(o.exec(""),i=o.exec(e),i&&(e=i[3],n.push(i[1]),i[2])){r=i[3];break}while(i);for(r&&d(r,t),e=[],a=0;n.length>a;a++)">"!=n[a]&&e.push(u(n[a],[],">"===n[a-1]));return t.push(e),t}var f=this.match;this._selectors=d(e,[])},match:function(e,t){var r,i,o,a,s,l,c,u,d,f,p,h,m;for(t=t||this._selectors,r=0,i=t.length;i>r;r++){for(s=t[r],a=s.length,m=e,h=0,o=a-1;o>=0;o--)for(u=s[o];m;){for(u.psuedo&&(p=m.parent().items(),d=n.inArray(m,p),f=p.length),l=0,c=u.length;c>l;l++)if(!u[l](m,d,f)){l=c+1;break}if(l===c){h++;break}if(o===a-1)break;m=m.parent()}if(h===a)return!0}return!1},find:function(e){function t(e,r,i){var o,a,s,l,c,u=r[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==r.length-1?n.push(c):c.items&&t(c.items(),r,i+1);else if(u.direct)return;c.items&&t(c.items(),r,i)}}var n=[],i,o,a=this._selectors;if(e.items){for(i=0,o=a.length;o>i;i++)t(e.items(),a[i],0);o>1&&(n=r(n))}return s||(s=l.Collection),new s(n)}});return l}),r(F,[f,I,O],function(e,n,r){var i,o,a=Array.prototype.push,s=Array.prototype.slice;return o={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?a.apply(n,t):t instanceof i?n.add(t.toArray()):a.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var t=this,r,o,a=[],s,l;for("string"==typeof e?(e=new n(e),l=function(t){return e.match(t)}):l=e,r=0,o=t.length;o>r;r++)s=t[r],l(s)&&a.push(s);return new i(a)},slice:function(){return new i(s.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new i(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,n){var r=this,i,o;return n!==i?(r.each(function(t){t[e]&&t[e](n)}),r):(o=r[0],o&&o[e]?o[e]():t)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){o[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name width height disabled active selected checked visible parent value data".split(" "),function(e){o[e]=function(t){return this.prop(e,t)}}),i=r.extend(o),n.Collection=i,i}),r(W,[f,g],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){return t.DOM.getSize(e)},getPos:function(e,n){return t.DOM.getPos(e,n)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)}}}),r(z,[O,f,F,W],function(e,n,r,i){var o=n.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),a={},s="onmousewheel"in document,l=!1,c=e.extend({Statics:{controlIdLookup:{}},classPrefix:"mce-",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t;e&&!(t=c.controlIdLookup[e.id]);)e=e.parentNode;return t},init:function(e){var r=this,o,a;if(r.settings=e=n.extend({},r.Defaults,e),r._id=i.id(),r._text=r._name="",r._width=r._height=0,r._aria={role:e.role},o=e.classes)for(o=o.split(" "),o.map={},a=o.length;a--;)o.map[o[a]]=!0;r._classes=o||[],r.visible(!0),n.each("title text width height name classes visible disabled active value".split(" "),function(t){var n=e[t],i;n!==i?r[t](n):r["_"+t]===i&&(r["_"+t]=!1)}),r.on("click",function(){return r.disabled()?!1:t}),e.classes&&n.each(e.classes.split(" "),function(e){r.addClass(e)}),r.settings=e,r._borderBox=r.parseBox(e.border),r._paddingBox=r.parseBox(e.padding),r._marginBox=r.parseBox(e.margin),e.hidden&&r.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml,refresh",parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseInt(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,n=e.settings,r,i,o=e.getEl(),a,s,l,c,u,d,f;r=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),d=n.minWidth,f=n.minHeight,l=d||o.offsetWidth,c=f||o.offsetHeight,a=n.width,s=n.height,u=n.autoResize,u=u!==t?u:!a&&!s,a=a||l,s=s||c;var p=r.left+r.right,h=r.top+r.bottom,m=n.maxWidth||65535,g=n.maxHeight||65535;return e._layoutRect=i={x:n.x||0,y:n.y||0,w:a,h:s,deltaW:p,deltaH:h,contentW:a-p,contentH:s-h,innerW:a-p,innerH:s-h,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,m),minH:Math.min(c,g),maxW:m,maxH:g,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=n.minW>i?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=n.minH>i?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=n.minW-o>i?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=n.minH-a>i?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(l=c.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s;t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=r.x+"px",s.x=r.x),r.y!==s.y&&(t.top=r.y+"px",s.y=r.y),r.w!==s.w&&(t.width=r.w-o+"px",s.w=r.w),r.h!==s.h&&(t.height=r.h-a+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=r.innerW+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=r.innerH+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,n){function r(e){var n,r;return function(o){return n||i.parents().each(function(i){var o=i.settings.callbacks;return o&&(n=o[e])?(r=i,!1):t}),n.call(r,o)}}var i=this,a,s,l,c;if(n)for("string"==typeof n&&(n=r(n)),l=e.toLowerCase().split(" "),c=l.length;c--;)e=l[c],a=i._bindings,a||(a=i._bindings={}),s=a[e],s||(s=a[e]=[]),s.push(n),o[e]&&(i._nativeEvents?i._nativeEvents[e]=!0:i._nativeEvents={name:!0},i._rendered&&i.bindPendingEvents());return i},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},parents:function(e){var t=this,n=new r;for(t=t.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},getEl:function(e,t){var n,r=e?this._id+"-"+e:this._id;return n=a[r]=(t===!0?null:a[r])||i.get(r)},visible:function(e){var n=this,r;return e!==t?(n._visible!==e&&(n._rendered&&(n.getEl().style.display=e?"":"none"),n._visible=e,r=n.parent(),r&&(r._lastRect=null),n.fire(e?"show":"hide")),n):n._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}},blur:function(){this.getEl().blur()},aria:function(e,n){var r=this,i=r.getEl();return n===t?r._aria[e]:(r._aria[e]=n,r._rendered&&("label"==e&&i.setAttribute("aria-labeledby",r._id),i.setAttribute("role"==e?e:"aria-"+e,n)),r)},encode:function(e,t){return t!==!1&&c.translate&&(e=c.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r;if(e.items)for(var o=e.items().toArray(),a=o.length;a--;)o[a].remove();return n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&i.off(t),delete c.controlIdLookup[e._id],t.parentNode&&t.parentNode.removeChild(t),e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(i.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(i.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,r,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||i.css(e.getEl(),"display","none"),e.settings.border&&(r=e.borderBox(),i.css(e.getEl(),{"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left})),c.controlIdLookup[e._id]=e;for(var l in e._aria)e.aria(l,e._aria[l]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;s.length>r&&a[r]===s[r];r++);for(i=s.length-1;i>=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;a.length>i;i++)t=a[i],t.fire("mouseenter",{target:t.getEl()})}}function r(e){e.preventDefault(),"mousewheel"==e.type?(e.deltaY=-1/40*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-1/40*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=o.fire("wheel",e)}var o=this,a,c,u,d,f,p;
7if(o._rendered=!0,f=o._nativeEvents){for(u=o.parents().toArray(),u.unshift(o),a=0,c=u.length;!d&&c>a;a++)d=u[a]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=a,a=0;c>a;a++)u[a]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||l?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(i.on(d.getEl(),"mouseleave",t),i.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):d[p]||(i.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):s?i.on(o.getEl(),"mousewheel",r):i.on(o.getEl(),"DOMMouseScroll",r)}}},reflow:function(){return this.repaint(),this}});return c}),r(V,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(U,[z,F,I,V,f,W],function(e,n,r,i,o,a){var s={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var t=this;t._super(e),e=t.settings,t._items=new n,t.addClass("container"),t.addClass("container-body","body"),e.containerCls&&t.addClass(e.containerCls),t._layout=i.create((e.layout||t.layout)+"layout"),t.settings.items&&t.add(t.settings.items),t._hasBody=!0},items:function(){return this._items},find:function(e){return e=s[e]=s[e]||new r(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,r,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),r=o.extend({},n.settings.defaults,t),t.type=r.type=r.type||t.type||n.settings.defaultType||(r.defaults?r.defaults.type:null),t=i.create(r)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=a.createFragment(t.renderHtml()),r.hasChildNodes()&&r.childNodes.length-1>=n?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),n||(t+=1),t>=0&&i.length>t&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},preRender:function(){},renderHtml:function(){var e=this,t=e._layout;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'" role="'+this.settings.role+'">'+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div>"+"</div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&a.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),a.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,n=e._layoutRect,r=e._lastRect;return r&&r.w==n.w&&r.h==n.h?t:(e._layout.recalc(e),n=e.layoutRect(),e._lastRect={x:n.x,y:n.y,w:n.w,h:n.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(q,[W],function(e){function n(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=document,l,c,u,d,f,p;i=i||{},c=function(t){var r=n(),c,h;t.preventDefault(),l=t.button,c=o(),f=t.screenX,p=t.screenY,h=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,a=s.createElement("div"),e.css(a,{position:"absolute",top:0,left:0,width:r.width,height:r.height,zIndex:65535,opacity:1e-4,background:"red",cursor:h}),s.body.appendChild(a),e.on(s,"mousemove",d),e.on(s,"mouseup",u),i.start(t)},d=function(e){return e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-p,e.preventDefault(),i.drag(e),t)},u=function(t){e.off(s,"mousemove",d),e.off(s,"mouseup",u),a.parentNode.removeChild(a),i.stop&&i.stop(t)},this.destroy=function(){e.off(o())},e.on(o(),"mousedown",c)}}),r($,[W,q],function(e,n){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function r(){function n(n,s,l,c,u,d){var f,p,h,m,g,v,y,b,C;if(p=o.getEl("scroll"+n)){if(b=s.toLowerCase(),C=l.toLowerCase(),o.getEl("absend")&&e.css(o.getEl("absend"),b,o.layoutRect()[c]-1),!u)return e.css(p,"display","none"),t;e.css(p,"display","block"),f=o.getEl("body"),h=o.getEl("scroll"+n+"t"),m=f["client"+l]-2*a,m-=r&&i?p["client"+d]:0,g=f["scroll"+l],v=m/g,y={},y[b]=f["offset"+s]+a,y[C]=m,e.css(p,y),y={},y[b]=f["scroll"+s]*v,y[C]=m*v,e.css(h,y)}}var r,i,s;s=o.getEl("body"),r=s.scrollWidth>s.clientWidth,i=s.scrollHeight>s.clientHeight,n("h","Left","Width","contentW",r,"Height"),n("v","Top","Height","contentH",i,"Width")}function i(){function t(t,r,i,s,l){var c,u=o._id+"-scroll"+t,d=o.classPrefix;o.getEl().appendChild(e.createFragment('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+t+'">'+'<div id="'+u+'t" class="'+d+'scrollbar-thumb"></div>'+"</div>")),o.draghelper=new n(u+"t",{start:function(){c=o.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var n,u,d,f,p=o.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=o.getEl("body")["client"+i]-2*a,f-=u&&d?o.getEl("scroll"+t)["client"+l]:0,n=f/o.getEl("body")["scroll"+i],o.getEl("body")["scroll"+r]=c+e["delta"+s]/n},stop:function(){e.removeClass(e.get(u),d+"active")}})}o.addClass("scroll"),t("v","Top","Height","Y","Width"),t("h","Left","Width","X","Height")}var o=this,a=2;o.settings.autoScroll&&(o._hasScroll||(o._hasScroll=!0,i(),o.on("wheel",function(e){var t=o.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,r()}),e.on(o.getEl("body"),"scroll",r)),r())}}}),r(j,[U,$],function(e,n){var r=e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[n],fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,n={};return e.find("*").each(function(e){var r=e.name(),i=e.value();r&&i!==t&&(n[r]=i)}),n},renderHtml:function(){var e=this,n=e._layout,r=e.settings.html;return e.preRender(),n.preRender(e),r===t?r='<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+n.renderHtml(e)+"</div>":("function"==typeof r&&(r=r.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e._preBodyHtml||"")+r+"</div>"}});return r}),r(K,[W],function(e){return{moveRel:function(t,n){var r=this,i,o,a,s,l,c,u,d;return o=e.getPos(t),a=o.x,s=o.y,i=r.getEl(),l=i.offsetWidth,c=i.offsetHeight,u=t.offsetWidth,d=t.offsetHeight,n=(n||"").split(""),"b"===n[0]&&(s+=d),"r"===n[1]&&(a+=u),"c"===n[0]&&(s+=Math.round(d/2)),"c"===n[1]&&(a+=Math.round(u/2)),"b"===n[3]&&(s-=c),"r"===n[4]&&(a-=l),"c"===n[3]&&(s-=Math.round(c/2)),"c"===n[4]&&(a-=Math.round(l/2)),r.moveTo(a,s),r},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(e,t){var n=this;return n._rendered?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}}}),r(G,[W],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(Y,[j,K,G,W],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;l.length>e;e++)l[e].modal&&(t++,n=l[e]),l[e].getEl().style.zIndex=t,l[e].zIndex=t,t++;var i=document.getElementById(d.classPrefix+"modal-block");n?r.css(i,"z-index",n.zIndex-1):i&&(i.parentNode.removeChild(i),c=!1),u.currentZIndex=t}function n(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function i(e){var t=document.body.scrollTop||window.pageYOffset||document.documentElement.scrollTop;e.settings.autofix&&(t>(e._absY||e.layoutRect().y)?(e._absY=e._absY||e.layoutRect().y,e.getEl().style.position="fixed",e.layoutRect({y:0}).repaint()):(e.getEl().style.position="absolute",e.layoutRect({y:e._absY}).repaint()))}var d=this;d._super(e),d._eventsRoot=d,d.addClass("floatpanel"),e.autohide&&(o||(o=function(e){var t,r=d.getParentCtrl(e.target);for(t=s.length;t--;){var i=s[t];if(i.settings.autohide){if(r&&(n(r,i)||i.parent()===r))continue;i.hide()}}},r.on(document,"click",o)),s.push(d)),e.autofix&&(a||(a=function(){var e;for(e=s.length;e--;)i(s[e])},r.on(window,"scroll",a)),d.on("move",function(){i(this)})),d.on("postrender show",function(e){if(e.control==d){var n,i=d.classPrefix;d.modal&&!c&&(n=r.createFragment('<div id="'+i+'modal-block" class="'+i+"reset "+i+'fade"></div>'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),e.popover&&(d._preBodyHtml='<div class="'+d.classPrefix+'arrow"></div>',d.addClass("popover").addClass("bottom").addClass("start"))},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},u}),r(X,[W],function(e){return function(n){function r(){if(!m)if(m=[],f.find)f.find("*").each(function(e){e.canFocus&&m.push(e.getEl())});else for(var e=f.getEl().getElementsByTagName("*"),t=0;e.length>t;t++)e[t].id&&e[t]&&m.push(e[t])}function i(){return document.getElementById(g)}function o(e){return e=e||i(),e&&e.getAttribute("role")}function a(e){for(var t,n=e||i();n=n.parentNode;)if(t=o(n))return t}function s(e){var n=document.getElementById(g);return n?n.getAttribute("aria-"+e):t}function l(){var t=i();if(!t||"TEXTAREA"!=t.nodeName&&"text"!=t.type)return n.onAction?n.onAction(g):e.fire(i(),"click",{keyboard:!0}),!0}function c(){var e;n.onCancel?((e=i())&&e.blur(),n.onCancel()):n.root.fire("cancel")}function u(e){var t=-1,i,o;for(r(),o=m.length;o--;)if(m[o].id===g){t=o;break}t+=e,0>t?t=m.length-1:t>=m.length&&(t=0),i=m[t],i.focus(),g=i.id,n.actOnFocus&&l()}function d(){var e,i;for(i=o(n.root.getEl()),r(),e=m.length;e--;)if("toolbar"==i&&m[e].id===g)return m[e].focus(),t;m[0].focus()}var f=n.root,p=n.enableUpDown!==!1,h=n.enableLeftRight!==!1,m=n.items,g;return f.on("keydown",function(e){var t=37,r=39,i=38,d=40,f=27,m=14,g=13,v=32,y=9,b;switch(e.keyCode){case t:h&&(n.leftAction?n.leftAction():u(-1),b=!0);break;case r:h&&("menuitem"==o()&&"menu"==a()?s("haspopup")&&l():u(1),b=!0);break;case i:p&&(u(-1),b=!0);break;case d:p&&("menuitem"==o()&&"menubar"==a()?l():"button"==o()&&s("haspopup")?l():u(1),b=!0);break;case y:b=!0,e.shiftKey?u(-1):u(1);break;case f:b=!0,c();break;case m:case g:case v:b=l()}b&&(e.stopPropagation(),e.preventDefault())}),f.on("focusin",function(e){r(),g=e.target.id}),{moveFocus:u,focusFirst:d,cancel:c}}}),r(J,[Y,j,W,X,q],function(e,n,r,i,o){var a=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var t=this;t._super(e),t.addClass("window"),e.buttons&&(t.statusbar=new n({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:"end",defaults:{type:"button"},items:e.buttons}),t.statusbar.addClass("foot"),t.statusbar.parent(t)),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()}),t.aria("label",e.title),t._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,n,i,o;e._fullscreen&&(e.layoutRect(r.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),n=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=n.headerW,i>n.w&&(e.layoutRect({w:i}),o=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+n.deltaW,i>n.w&&(e.layoutRect({w:i}),o=!0)),o&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),n=0,i;e.settings.title&&!e._fullscreen&&(i=e.getEl("head"),t.headerW=i.offsetWidth,t.headerH=i.offsetHeight,n+=t.headerH),e.statusbar&&(n+=e.statusbar.layoutRect().h),t.deltaH+=n,t.minH+=n,t.h+=n;var o=r.getWindowSize();return t.x=Math.max(0,o.w/2-t.w/2),t.y=Math.max(0,o.h/2-t.h/2),t},renderHtml:function(){var e=this,n=e._layout,r=e._id,i=e.classPrefix,o=e.settings,a="",s="",l=o.html;return e.preRender(),n.preRender(e),o.title&&(a='<div id="'+r+'-head" class="'+i+'window-head">'+'<div class="'+i+'title">'+e.encode(o.title)+"</div>"+'<button type="button" class="'+i+'close" aria-hidden="true">&times;</button>'+'<div id="'+r+'-dragh" class="'+i+'dragh"></div>'+"</div>"),o.url&&(l='<iframe src="'+o.url+'" tabindex="-1"></iframe>'),l===t&&(l=n.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+r+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+a+'<div id="'+r+'-body" class="'+e.classes("body")+'">'+l+"</div>"+s+"</div>"},fullscreen:function(e){var t=this,n=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(r.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=r.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var n=r.getWindowSize();t.moveTo(0,0).resizeTo(n.w,n.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,r.addClass(n,o+"fullscreen"),r.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=r.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,r.removeClass(n,o+"fullscreen"),r.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,r,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new i({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(r=r||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open").firstChild)):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(r=r||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!r&&n&&n.focus(),this.dragHelger=new o(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e._super(),e.dragHelger.destroy(),e.statusbar&&this.statusbar.remove()}});return a}),r(Q,[J],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Z,[J,Q],function(e,t){return function(n){var r=this,i=[];r.windows=i,r.open=function(t){var r;return t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",minWidth:50,onclick:function(){r.find("form")[0].submit(),r.close()}},{text:"Cancel",onclick:function(){r.close()}}]),r=new e(t),i.push(r),r.on("close",function(){for(var e=i.length;e--;)i[e]===r&&i.splice(e,1);n.focus()}),t.data&&r.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),n.nodeChanged(),r.renderTo(document.body).reflow()},r.alert=function(e,n,r){t.alert(e,function(){n.call(r||this)})},r.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},r.close=function(){i.length&&i[window.length-1].win.close()}}}),r(et,[S,A,b,h,m,f],function(e,n,r,i,o,a){return function(s){function l(e,t){try{s.getDoc().execCommand(e,!1,t)}catch(n){}}function c(){var e=s.getDoc().documentMode;return e?e:6}function u(e){return e.isDefaultPrevented()}function d(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,o,l,c,u;n=F.getRng();var d=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=I.getParent(n.startContainer,I.isBlock),e&&(r=I.getNext(r,I.isBlock)),!r||!t()&&n.collapsed||(i=I.create("em",{id:"__mceDel"}),D(a.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=I.createRng(),n.setStart(d[0],d[1]),n.setEnd(d[2],d[3]),F.setRng(n),s.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(o=F.getBookmark();u=I.get("__mceDel");)I.remove(u,!0);F.moveToBookmark(o)}}s.on("keydown",function(n){var r;r=n.keyCode==O,u(n)||!r&&n.keyCode!=P||e.modifierPressed(n)||(n.preventDefault(),t(r))}),s.addCommand("Delete",function(){t()})}function f(){function e(e){var t=I.create("body"),n=e.cloneContents();return t.appendChild(n),F.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=I.createRng();r.selectNode(s.getBody());var i=e(r);return n===i}s.on("keydown",function(e){var n=e.keyCode,r;if(!u(e)&&(n==O||n==P)){if(r=s.selection.isCollapsed(),r&&!I.isEmpty(s.getBody()))return;if(q&&!r)return;if(!r&&!t(s.selection.getRng()))return;e.preventDefault(),s.setContent(""),s.selection.setCursorLocation(s.getBody(),0),s.nodeChanged()}})}function p(){s.on("keydown",function(t){!u(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),s.execCommand("SelectAll"))})}function h(){s.settings.content_editable||(I.bind(s.getDoc(),"focusin",function(){F.setRng(F.getRng())}),I.bind(s.getDoc(),"mousedown",function(e){e.target==s.getDoc().documentElement&&(s.getWin().focus(),F.setRng(F.getRng()))}))}function m(){s.on("keydown",function(e){if(!u(e)&&e.keyCode===P&&F.isCollapsed()&&0===F.getRng(!0).startOffset){var t=F.getNode(),n=t.previousSibling;n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(I.remove(n),e.preventDefault())}})}function g(){window.Range.prototype.getClientRects||s.on("mousedown",function(e){if(!u(e)&&"HTML"===e.target.nodeName){var t=s.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function v(){s.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&F.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&I.hasClass(e,"mceItemAnchor")&&F.select(e),s.nodeChanged()})}function y(){function e(){var e=I.getAttribs(F.getStart().cloneNode(!1));return function(){var t=F.getStart();t!==s.getBody()&&(I.setAttrib(t,"style",null),D(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function n(){return!F.isCollapsed()&&I.getParent(F.getStart(),I.isBlock)!=I.getParent(F.getEnd(),I.isBlock)}s.on("keypress",function(r){var i;return u(r)||8!=r.keyCode&&46!=r.keyCode||!n()?t:(i=e(),s.getDoc().execCommand("delete",!1,null),i(),r.preventDefault(),!1)}),I.bind(s.getDoc(),"cut",function(t){var r;!u(t)&&n()&&(r=e(),setTimeout(function(){r()},0))})}function b(){var e,t;s.on("selectionchange",function(){t&&(clearTimeout(t),t=0),t=window.setTimeout(function(){var t=F.getRng();e&&n.compareRanges(t,e)||(s.nodeChanged(),e=t)},50)})}function C(){document.body.setAttribute("role","application")}function x(){s.on("keydown",function(e){if(!u(e)&&e.keyCode===P&&F.isCollapsed()&&0===F.getRng(!0).startOffset){var t=F.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function w(){c()>7||(l("RespectVisibilityInDesign",!0),s.contentStyles.push(".mceHideBrInPre pre br {display: none}"),I.addClass(s.getBody(),"mceHideBrInPre"),z.addNodeFilter("pre",function(e){for(var t=e.length,n,i,o,a;t--;)for(n=e[t].getAll("br"),i=n.length;i--;)o=n[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new r("#text",3),o,!0).value="\n"}),V.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function _(){I.bind(s.getBody(),"mouseup",function(){var e,t=F.getNode();"IMG"==t.nodeName&&((e=I.getStyle(t,"width"))&&(I.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),I.setStyle(t,"width","")),(e=I.getStyle(t,"height"))&&(I.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),I.setStyle(t,"height","")))})}function N(){s.on("keydown",function(t){var n,r,i,o,a,l,c,d;if(n=t.keyCode==O,!u(t)&&(n||t.keyCode==P)&&!e.modifierPressed(t)&&(r=F.getRng(),i=r.startContainer,o=r.startOffset,c=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!c||c&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;d=s.schema.getNonEmptyElements(),t.preventDefault(),a=I.create("br",{id:"__tmp"}),i.parentNode.insertBefore(a,i),s.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=F.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!I.isBlock(l)&&I.isEmpty(l)&&!d[l.nodeName.toLowerCase()]&&I.remove(l),I.remove("__tmp")}})}function E(){s.on("keydown",function(t){var n,r,i,o,a;if(!u(t)&&t.keyCode==e.BACKSPACE&&(n=F.getRng(),r=n.startContainer,i=n.startOffset,o=I.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(s.formatter.toggle("blockquote",null,a),n=I.createRng(),n.setStart(r,0),n.setEnd(r,0),F.setRng(n))}})}function k(){function e(){s._refreshContentEditable(),l("StyleWithCSS",!1),l("enableInlineTableEditing",!1),W.object_resizing||l("enableObjectResizing",!1)}W.readonly||s.on("BeforeExecCommand MouseDown",e)}function S(){function e(){D(I.select("a"),function(e){var t=e.parentNode,n=I.getRoot();if(t.lastChild===e){for(;t&&!I.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}I.add(t,"br",{"data-mce-bogus":1})}})}s.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function T(){W.forced_root_block&&s.on("init",function(){l("DefaultParagraphSeparator",W.forced_root_block)})}function R(){s.on("Undo Redo SetContent",function(e){e.initial||s.execCommand("mceRepaint")})}function A(){s.on("keydown",function(e){var t;u(e)||e.keyCode!=P||(t=s.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),s.undoManager.beforeChange(),I.remove(t.item(0)),s.undoManager.add()))})}function B(){var e;c()>=10&&(e="",D("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),s.contentStyles.push(e+"{padding-right: 1px !important}"))}function L(){9>c()&&(z.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),V.addNodeFilter("noscript",function(e){for(var t=e.length,n,o,a;t--;)n=e[t],o=e[t].firstChild,o?o.value=i.decode(o.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),o=new r("#text",3),o.value=a,o.raw=!0,n.append(o)))}))}function H(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),I.unbind(r,"mouseup",n),I.unbind(r,"mousemove",t),a=o=0}var r=I.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,I.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(I.bind(r,"mouseup",n),I.bind(r,"mousemove",t),I.win.focus(),a.select())}})}function M(){s.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||F.normalize()})}var D=a.each,P=e.BACKSPACE,O=e.DELETE,I=s.dom,F=s.selection,W=s.settings,z=s.parser,V=s.serializer,U=o.gecko,q=o.ie,$=o.webkit;x(),E(),f(),M(),$&&(N(),d(),h(),v(),T(),o.iOS?b():p()),q&&(m(),C(),w(),_(),A(),B(),L(),H()),U&&(m(),g(),y(),k(),S(),R())}}),r(tt,[f],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n}}}),r(nt,[f,m],function(e,n){var r=e.each,i=e.explode,o={f9:120,f10:121,f11:122};return function(e){var a=this,s={};e.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&r(s,function(r){var i=n.isMac?e.metaKey:e.ctrlKey;if(r.ctrl==i&&r.alt==e.altKey&&r.shift==e.shiftKey)return e.keyCode==r.keyCode||e.charCode&&e.charCode==r.charCode?(e.preventDefault(),"keydown"==e.type&&r.func.call(r.scope),!0):t})}),a.add=function(t,n,a,l){var c;return c=a,"string"==typeof a?a=function(){e.execCommand(c,!1,null)}:a.length&&(a=function(){e.execCommand(c[0],c[1],c[2])}),r(i(t.toLowerCase()),function(t){var c={func:a,scope:l||e,desc:e.translate(n),alt:!1,ctrl:!1,shift:!1};r(i(t,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":c[e]=!0;break;default:c.charCode=e.charCodeAt(0),c.keyCode=o[e]||e.toUpperCase().charCodeAt(0)}}),s[(c.ctrl?"ctrl":"")+","+(c.alt?"alt":"")+","+(c.shift?"shift":"")+","+c.keyCode]=c}),!0}}}),r(rt,[g,y,b,E,N,R,B,L,H,M,D,P,v,u,Z,C,w,et,m,f,tt,nt],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",directionality:"ltr",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.settings=t,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!1,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,H=C.resolve,M=h.Event,D=b.gecko,P=b.ie,O=b.opera;return N.prototype={render:function(){function e(){var e=p.ScriptLoader;r.language&&e.add(n.editorManager.baseURL+"/langs/"+r.language+".js"),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]&&k.load(r.theme,"themes/"+r.theme+"/theme"+o+".js"),C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;
8if(!M.domLoaded)return E.bind(window,"ready",function(){n.render()}),t;if(n.editorManager.settings=r,n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=1,a._mceOldSubmit(a)})),n.windowManager=new m(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&(n.save(),n.isNotDirty=1)}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0})},n.editorManager.on("BeforeUnload",n._beforeUnload)),e()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h=[];if(t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(document.domain&&location.hostname!=document.domain&&(t.editorManager.relaxedDomain=document.domain),t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',p=0;t.contentCSS.length>p;p++)t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+t.contentCSS[p]+'" />';t.contentCSS=[],u=n.body_id||"tinymce",-1!=u.indexOf("=")&&(u=t.getParam("body_id","","hash"),u=u[t.id]||u),d=n.body_class||"",-1!=d.indexOf("=")&&(d=t.getParam("body_class","","hash"),d=d[t.id]||""),t.iframeHTML+='</head><body id="'+u+'" class="mce-content-body '+d+'" '+"onload=\"window.parent.tinymce.get('"+t.id+"').fire('load');\"><br></body></html>",t.editorManager.relaxedDomain&&(P||O&&11>parseFloat(window.opera.version()))&&(c='javascript:(function(){document.open();document.domain="'+document.domain+'";'+'var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);'+"document.close();ed.initContentBody();})()"),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),t.editorManager.relaxedDomain&&c||t.initContentBody(),r=s=l=null},initContentBody:function(){var t=this,n=t.settings,o=E.get(t.id),f=t.getDoc(),p,h;n.inline||(t.getElement().style.visibility=t.orgVisibility),P&&t.editorManager.relaxedDomain||n.content_editable||(f.open(),f.write(t.iframeHTML),f.close(),t.editorManager.relaxedDomain&&(f.domain=t.editorManager.relaxedDomain)),n.content_editable&&(E.addClass(o,"mce-content-body"),o.tabIndex=-1,t.contentDocument=f=n.content_document||document,t.contentWindow=n.content_window||window,t.bodyElement=o,n.content_document=n.content_window=null,n.root_name=o.nodeName.toLowerCase()),p=t.getBody(),p.disabled=!0,n.readonly||(p.contentEditable=t.getParam("content_editable_state",!0)),p.disabled=!1,t.schema=new g(n),t.dom=new e(f,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,class_filter:n.class_filter,update_styles:!0,root_element:n.content_editable?t.id:null,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=new v(n,t.schema),t.parser.addAttributeFilter("src,href,style",function(e,n){for(var r=e.length,i,o=t.dom,a,s;r--;)i=e[r],a=i.attr(n),s="data-mce-"+n,i.attributes.map[s]||("style"===n?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,t.convertURL(a,n,i.name)))}),t.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),t.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),t.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var n=e.length,i,o=t.schema.getNonEmptyElements();n--;)i=e[n],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),t.serializer=new i(n,t),t.selection=new a(t.dom,t.getWin(),t.serializer,t),t.formatter=new s(t),t.undoManager=new l(t),t.forceBlocks=new u(t),t.enterKey=new c(t),t.editorCommands=new d(t),t.fire("PreInit"),n.browser_spellcheck||n.gecko_spellcheck||(f.body.spellcheck=!1),t.fire("PostRender"),t.quirks=y(t),n.directionality&&(p.dir=n.directionality),n.nowrap&&(p.style.whiteSpace="nowrap"),n.protect&&t.on("BeforeSetContent",function(e){R(n.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),n.padd_empty_editor&&t.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.initialized=!0,R(t._pendingNativeEvents,function(e){t.dom.bind(_(t,e),e,function(e){t.fire(e.type,e)})}),t.fire("init"),t.focus(!0),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),t.contentStyles.length>0&&(h="",R(t.contentStyles,function(e){h+=e+"\r\n"}),t.dom.addStyle(h)),R(t.contentCSS,function(e){t.dom.loadCSS(e)}),n.auto_focus&&setTimeout(function(){var e=t.editorManager.get(n.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),o=f=p=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||n.getWin().focus(),(D||i)&&(l=n.getBody(),l.setActive?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),i[L(e[0])]=e.length>1?L(e[1]):L(e)}):i=r,i):r},nodeChanged:function(){var e=this,n=e.selection,r,i,o;e.initialized&&!e.settings.disable_nodechange&&(o=e.getBody(),r=n.getStart()||o,r=P&&r.ownerDocument!=e.getDoc()?e.getBody():r,"IMG"==r.nodeName&&n.isCollapsed()&&(r=r.parentNode),i=[],e.dom.getParent(r,function(e){return e===o?!0:(i.push(e),t)}),e.fire("NodeChange",{element:r,parents:i}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,t.icon=t.icon||(t.icon!==!1?e:!1),n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,n,r,i){var o=this,a=0,s;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||o.focus(),i=T({},i),o.fire("BeforeExecCommand",{command:e,ui:n,value:r}),i.terminate?!1:(s=o.execCommands[e])&&s.func.call(s.scope,n,r)!==!0?(o.fire("ExecCommand",{command:e,ui:n,value:r}),!0):(R(o.plugins,function(i){return i.execCommand&&i.execCommand(e,n,r)?(o.fire("ExecCommand",{command:e,ui:n,value:r}),a=!0,!1):t}),a?a:o.theme&&o.theme.execCommand&&o.theme.execCommand(e,n,r)?(o.fire("ExecCommand",{command:e,ui:n,value:r}),!0):o.editorCommands.execCommand(e,n,r)?(o.fire("ExecCommand",{command:e,ui:n,value:r}),!0):(o.getDoc().execCommand(e,n,r),o.fire("ExecCommand",{command:e,ui:n,value:r}),t))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):t},save:function(e){var n=this,r=n.getElement(),i,o;if(r&&n.initialized)return e=e||{},e.save=!0,e.element=r,i=e.content=n.getContent(e),e.no_events||n.fire("SaveContent",e),i=e.content,/TEXTAREA|INPUT/i.test(r.nodeName)?r.value=i:(r.innerHTML=i,(o=E.getParent(n.id,"form"))&&R(o.elements,function(e){return e.name==n.id?(e.value=i,!1):t})),e.element=r=null,i},setContent:function(e,n){var r=this,i=r.getBody(),a;return n=n||{},n.format=n.format||"html",n.set=!0,n.content=e,n.no_events||r.fire("BeforeSetContent",n),e=n.content,P||0!==e.length&&!/^\s+$/.test(e)?("raw"!==n.format&&(e=new o({},r.schema).serialize(r.parser.parse(e,{isRootContent:!0}))),n.content=L(e),r.dom.setHTML(i,n.content),n.no_events||r.fire("SetContent",n),r.settings.content_editable&&document.activeElement!==r.getBody()||r.selection.normalize(),n.content):(a=r.settings.forced_root_block,e=a&&r.schema.isValidChild(i.nodeName.toLowerCase(),a.toLowerCase())?"<"+a+'><br data-mce-bogus="1"></'+a+">":'<br data-mce-bogus="1">',i.innerHTML=e,r.selection.select(i,!0),r.selection.collapse(!0),t)},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty&&this.undoManager.hasUndo()},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var a;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",a=i.getAttrib(e,"border"),a&&"0"!=a||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)),t;case"A":return i.getAttrib(e,"href",!1)||(a=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",a&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))),t}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this,t=e.getContainer(),n=e.getDoc();e.removed||(e.removed=1,P&&n&&n.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(M.unbind(e.getWin()),M.unbind(e.getDoc())),M.unbind(e.getBody()),M.unbind(t),e.fire("remove"),e.editorManager.remove(e),E.remove(t))},bindNative:function(e){var t=this;t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e]},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;t.destroyed||(D&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off(t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null,E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1)},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return D?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(it,[],function(){var e={};return{add:function(t,n){for(var r in n)e[r]=n[r]},translate:function(n){if(n===t)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var r=n.slice(1);n=(e[n[0]]||n[0]).replace(/\{([^\}]+)\}/g,function(e,t){return r[t]})}return e[n]||n},data:e}}),r(ot,[g],function(e){function t(n){function r(){try{return document.activeElement}catch(e){return document.body}}function i(i){function o(n){return!!e.DOM.getParent(n,t.isEditorUIElement)}var a=i.editor,s,l;a.on("init",function(){"onbeforedeactivate"in document?a.dom.bind(a.getBody(),"beforedeactivate",function(){var e=a.getDoc().selection;l=e&&e.createRange?e.createRange():a.selection.getRng()}):a.inline&&a.on("nodechange",function(){for(var e,t=document.activeElement;t;){if(t==a.getBody()){e=!0;break}t=t.parentNode}e&&(l=a.selection.getRng())})}),a.on("focusin",function(){var e=n.focusedEditor;s&&(a.selection.setRng(s),s=null),e!=a&&(e&&e.fire("blur",{focusedEditor:a}),a.fire("focus",{blurredEditor:e}),a.focus(!1),n.focusedEditor=a)}),a.on("focusout",function(){s=l,window.setTimeout(function(){var e=n.focusedEditor;e!=a&&(s=null),o(r())||e!=a||(a.fire("blur",{focusedEditor:null}),n.focusedEditor=null,s=null)},0)})}n.on("AddEditor",i)}return t.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},t}),r(at,[rt,g,P,m,f,tt,it,ot],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,h,m={majorVersion:"4",minorVersion:"0b2",releaseDate:"2013-04-24",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;a.length>s;s++){var c=a[s].src;if(/tinymce(\.jquery|)(\.min|\.dev|).js/.test(c)){-1!=c.indexOf(".min")&&(i=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new l(e)},init:function(t){function n(e){var t=e.id;return t||(t=e.name,t=t&&!c.get(t)?e.name:c.uniqueId(),e.setAttribute("id",t)),t}function r(e,t,n){var r=e[t];if(r)return r.apply(n||this,Array.prototype.slice.call(arguments,2))}function i(e,t){return t.constructor===RegExp?t.test(e.className):c.hasClass(e,t)}var o=this,a=[],s;o.settings=t,c.bind(window,"ready",function(){var l,h;switch(r(t,"onpageload"),t.mode){case"exact":l=t.elements||"",l.length>0&&d(u(l),function(n){c.get(n)?(s=new e(n,t,o),a.push(s),s.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),s=new e(n,t,o),a.push(s),s.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(s=new e(n(r),t,o),a.push(s),s.render(!0))});break;default:t.types?d(t.types,function(r){d(c.select(r.selector),function(i){var s=new e(n(i),f({},t,r),o);a.push(s),s.render(1)})}):t.selector&&d(c.select(t.selector),function(r){var i=new e(n(r),t,o);a.push(i),i.render(1)})}t.oninit&&(l=h=0,d(a,function(e){h++,e.initialized?l++:e.on("init",function(){l++,l==h&&r(t,"oninit")}),l==h&&r(t,"oninit")}))})},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),h||(h=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",h)),e},createEditor:function(t){return this.add(new e(t))},remove:function(e){var t=this,n,r=t.editors;if(!r[e.id])return null;for(delete r[e.id],n=0;r.length>n;n++)if(r[n]==e){r.splice(n,1);break}return t.activeEditor==e&&(t.activeEditor=r[0]),e.destroy(),t.fire("RemoveEditor",{editor:e}),r.length||c.unbind(window,"beforeunload",h),e},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(m,a),m.setup(),window.tinymce=window.tinyMCE=m,m}),r(st,[at,f],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(lt,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(ct,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";t.length>r;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(ut,[ct,lt,f],function(e,n,r){function i(e){this.settings=o({},e),this.count=0}var o=r.extend;return i.sendRPC=function(e){return(new i).send(e)},i.prototype={send:function(r){var i=r.error,a=r.success;r=o(this.settings,r),r.success=function(n,o){n=e.parse(n),n===t&&(n={error:"JSON Parse error."}),n.error?i.call(r.error_scope||r.scope,n.error,o):a.call(r.success_scope||r.scope,n.result)},r.error=function(e,t){i&&i.call(r.error_scope||r.scope,e,t)},r.data=e.serialize({id:r.id||"c"+this.count++,method:r.method,params:r.params}),r.content_type="application/json",n.send(r)}},i}),r(dt,[g],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ft,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?c+e:i.indexOf(",",c),-1===r||r>i.length?null:(n=i.substring(c,r),c=r+1,n)}var r,i,s,c=0;a={},o.load(l),i=o.getAttribute(l)||"";do r=n(parseInt(n(),32)||0),null!==r&&(s=n(parseInt(n(),32)||0),a[r]=s);while(null!==r);e()}function r(){var t,n="";for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n),o.save(l),e()}var i,o,a,s,l;return window.localStorage?localStorage:(l="tinymce",o=document.documentElement,o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i)}),r(pt,[g,u,v,y,f,m],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ht,[O,f],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(mt,[ht],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(gt,[z,K],function(e,n){return e.extend({Mixins:[n],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var n=this;return e!==t?(n._value=e,n._rendered&&(n.getEl().lastChild.innerHTML=n.encode(e)),n):n._value},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes()+'" role="presentation">'+'<div class="'+t+'tooltip-arrow"></div>'+'<div class="'+t+'tooltip-inner">'+e.encode(e._text)+"</div>"+"</div>"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(vt,[z,gt],function(e,t){var n;return e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&t.on("mouseenter mouseleave",function(n){n.control==t&&"mouseenter"==n.type?t.tooltip().moveTo(-65535).text(e.tooltip).show().moveRel(t.getEl(),"bc tc"):t.tooltip().moveTo(-65535).hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}})}),r(yt,[vt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+'<button role="presentation" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+(e._text?(r?" ":"")+e.encode(e._text):"")+"</button>"+"</div>"}})}),r(bt,[U],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'">'+'<div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div>"+"</div>"}})}),r(Ct,[vt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var n=this;return e!==t?(e?n.addClass("checked"):n.removeClass("checked"),n._checked=e,n.aria("checked",e),n):n._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes()+'" unselectable="on" aria-labeledby="'+t+'-al" tabindex="-1">'+'<i class="'+n+"ico "+n+'i-checkbox"></i>'+'<span id="'+t+'-al" class="'+n+'label">'+e.encode(e._text)+"</span>"+"</div>"}})}),r(xt,[U],function(e){return e.extend({})}),r(wt,[yt,Y],function(e,t){var n=e.extend({showPanel:function(){var e=this,n=e.settings;n.panel.popover=!0,n.panel.autohide=!0,e.active(!0),e.panel?e.panel.show():e.panel=new t(n.panel).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()).reflow().moveRel(e.getEl(),n.popoverAlign||"bc-tc")},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&e.showPanel()}),e._super()}});return n}),r(_t,[wt],function(e){return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},showPreview:function(e){this.getEl("preview").style.backgroundColor=e},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+'<button role="presentation" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+(e._text?(r?" ":"")+e.encode(e._text):"")+"</button>"+"</div>"}})}),r(Nt,[vt,W],function(e,n){return e.extend({init:function(e){var r=this;r._super(e),r.addClass("combobox"),r.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&r.fire("action"),t=t.parentNode}),r.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&r.parents().reverse().each(function(n){return e.preventDefault(),r.fire("change"),n.submit?(n.submit(),!1):t})}),e.placeholder&&(r.addClass("placeholder"),r.on("focusin",function(){r._hasOnChange||(n.on(r.getEl("inp"),"change",function(){r.fire("change")}),r._hasOnChange=!0),r.hasClass("placeholder")&&(r.getEl("inp").value="",r.removeClass("placeholder"))}),r.on("focusout",function(){0===r.value().length&&(r.getEl("inp").value=e.placeholder,r.addClass("placeholder"))}))},value:function(e){var n=this;return e!==t?(n._value=e,n.removeClass("placeholder"),n._rendered&&(n.getEl("inp").value=e),n):n._rendered?(e=n.getEl("inp").value,e!=n.settings.placeholder?e:""):n._value},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect();return r?n.css(t.firstChild,{width:i.w-r.offsetWidth-10}):n.css(t.firstChild,{width:i.w-10}),e._super(),e},disabled:function(e){var t=this;t._super(e),t._rendered&&(t.getEl().disabled=e)
9},focus:function(){this.getEl("inp").focus()},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1">'+'<button id="'+t+'-action" hidefocus tabindex="-1">'+(o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button>"+"</div>",e.addClass("has-open")),'<div id="'+t+'" class="'+e.classes()+'">'+'<input id="'+t+'-inp" class="'+r+"textbox "+r+'placeholder" value="'+i+'" hidefocus="true">'+s+"</div>"}})}),r(Et,[z,X],function(e,n){return e.extend({Defaults:{delimiter:"\u00bb"},init:function(e){var t=this;t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new n({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var n=this;return e!==t?(n._data=e,n.update(),n):n._data},update:function(){this.getEl().innerHTML=this._getPathHtml()},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classPrefix+'path">'+e._getPathHtml()+"</div>"},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'<div class="'+o+'divider" aria-hidden="true"> '+e.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(n==r-1?" "+o+"last":"")+'" data-index="'+n+'" tabindex="-1" id="'+e._id+"-"+n+'">'+t[n].name+"</div>";return i||(i='<div class="'+o+'path-item">&nbsp;</div>'),i}})}),r(kt,[Et,at],function(e,t){return e.extend({postRender:function(){function e(e){return 1===e.nodeType&&("BR"==e.nodeName||!!e.getAttribute("data-mce-bogus"))}var n=this,r=t.activeEditor;return n.on("select",function(t){for(var n=[],i=r.selection.getNode(),o=r.getBody();i&&(e(i)||n.push(i),i=i.parentNode,i!=o););r.focus(),r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(St,[U],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div>"+"</div>"}})}),r(Tt,[U,St],function(e,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10},preRender:function(){var e=this,r=e.items();r.each(function(r){var i,o=r.settings.label;o&&(i=new n({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:o,flex:0,forId:r._id}]}),i.type="formitem",r.settings.flex===t&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},fromJSON:function(e){var t=this;if(e)for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,n={};return e.find("*").each(function(e){var r=e.name(),i=e.value();r&&i!==t&&(n[r]=i)}),n},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Rt,[Tt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div>"+"</fieldset>"}})}),r(At,[Nt],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Bt,[mt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Lt,[mt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,M,D,P,O,I,F,W,z,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=a.direction,s=a.align,l=a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",L="contentH",I="left",D="w",H="x",M="innerW",P="minW",O="maxW",F="right",W="deltaW",z="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",L="contentW",I="top",D="h",H="y",M="innerH",P="minH",O="maxH",F="bottom",W="deltaH",z="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[E],y=o[I]+h[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[B]:i[R]-d+i[B],x[P]=_+i[W],x[L]=i[R]-d,x[z]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[E]+Math.ceil(h.flex*C),y>b?(d-=h[S]-h[E],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[H]=o[I],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[E],"center"===s?x[H]=Math.round(i[M]/2-h[D]/2):"stretch"===s?(x[D]=V(h[P]||0,i[M]-o[I]-o[F]),x[H]=o[I]):"end"===s&&(x[H]=i[M]-h[D]-o.top),h.flex>0&&(y+=Math.ceil(h.flex*C)),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Ht,[ht],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Mt,[V,z,Y,f,at],function(e,n,r,i,o){function a(e){function n(e){return e.replace(/%(\w+)/g,"")}var r=o.activeEditor,i,a,s=r.dom,c="",u,d;return d=r.settings.preview_styles,d===!1?"":(d||(d="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(e=r.formatter.get(e))?(e=e[0],i=e.block||e.inline||"span",a=s.create(i),l(e.styles,function(e,t){e=n(e),e&&s.setStyle(a,t,e)}),l(e.attributes,function(e,t){e=n(e),e&&s.setAttrib(a,t,e)}),l(e.classes,function(e){e=n(e),s.hasClass(a,e)||s.addClass(a,e)}),r.fire("PreviewFormats"),s.setStyles(a,{position:"absolute",left:-65535}),r.getBody().appendChild(a),u=s.getStyle(r.getBody(),"fontSize",!0),u=/px$/.test(u)?parseInt(u,10):0,l(d.split(" "),function(e){var t=s.getStyle(a,e,!0);if(!("background-color"==e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=s.getStyle(r.getBody(),e,!0),"#ffffff"==s.toHex(t).toLowerCase())||"color"==e&&"#000000"==s.toHex(t).toLowerCase())){if("font-size"==e&&/em|%$/.test(t)){if(0===u)return;t=parseFloat(t,10)/(/%$/.test(t)?100:1),t=t*u+"px"}"border"==e&&t&&(c+="padding:0 2px;"),c+=e+":"+t+";"}}),r.fire("AfterPreviewFormats"),s.remove(a),c):t)}function s(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}var l=i.each;n.translate=function(e){return o.translate(e)},o.on("AddEditor",function(t){function n(){function e(r){var i=[];if(r)return l(r,function(r){var o={text:{raw:r.title},icon:r.icon};if(r.items)o.menu=e(r.items);else{var s=r.format||"custom"+t++;r.format||(r.name=s,n.push(r)),o.textStyle=function(){return a(s)},o.onclick=function(){h(s)}}i.push(o)}),i}var t=0,n=[],r=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];m.on("init",function(){l(n,function(e){m.formatter.register(e.name,e)})});var i=e(m.settings.style_formats||r);return i}function c(){return m.undoManager?m.undoManager.hasUndo():!1}function u(){return m.undoManager?m.undoManager.hasRedo():!1}function d(){var e=this;e.disabled(!c()),m.on("Undo Redo AddUndo",function(){e.disabled(!c())})}function f(){var e=this;e.disabled(!u()),m.on("Undo Redo AddUndo",function(){e.disabled(!u())})}function p(){var e=this;m.on("VisualAid",function(t){e.active(t.hasVisual)}),e.active(m.hasVisual)}function h(e){e.control&&(e=e.control.settings.format),e&&o.activeEditor.execCommand("mceToggleFormat",!1,e)}var m=t.editor,g;g=n(),l({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){m.addButton(t,{tooltip:e,onPostRender:function(){var e=this;m.formatter?m.formatter.formatChanged(t,function(t){e.active(t)}):m.on("init",function(){m.formatter.formatChanged(t,function(t){e.active(t)})})},onclick:function(){h(t)}})}),l({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(e,t){m.addButton(t,{tooltip:e[0],cmd:e[1]})}),l({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bulleted list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(e,t){m.addButton(t,{tooltip:e[0],cmd:e[1],onPostRender:function(){var e=this;m.formatter?m.formatter.formatChanged(t,function(t){e.active(t)}):m.on("init",function(){m.formatter.formatChanged(t,function(t){e.active(t)})})}})}),m.addButton("undo",{tooltip:"Undo",onPostRender:d,cmd:"undo"}),m.addButton("redo",{tooltip:"Redo",onPostRender:f,cmd:"redo"}),m.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),m.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:d,cmd:"undo"}),m.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:f,cmd:"redo"}),m.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:p,cmd:"mceToggleVisualAid"}),l({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(e,t){m.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),m.on("mousedown",function(){r.hideAll()}),e.add("styleselect",function(t){var n=[].concat(g);return e.create("menubutton",i.extend({text:"Formats",menu:n},t))}),e.add("formatselect",function(t){var n=[],r=s("Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return l(r,function(e){n.push({text:{raw:e[0]},format:e[1],textStyle:function(){return a(e[1])}})}),e.create("listbox",i.extend({text:{raw:r[0][0]},menu:n,onclick:h},t))}),e.add("fontselect",function(t){var n=[],r=s("Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats");return l(r,function(e){n.push({text:{raw:e[0]},format:e[1],style:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),e.create("listbox",i.extend({text:"Font Family",menu:n,onclick:function(e){e.control.settings.format&&o.activeEditor.execCommand("FontName",!1,e.control.settings.format)}},t))}),e.add("fontsizeselect",function(t){var n=[];return l("8pt 10pt 12pt 14pt 18pt 24pt 36pt".split(" "),function(e){n.push({text:e,format:e})}),e.create("listbox",i.extend({text:"Font Sizes",menu:n,onclick:function(e){e.control.settings.format&&o.activeEditor.execCommand("FontSize",!1,e.control.settings.format)}},t))}),m.addMenuItem("formats",{text:"Formats",menu:g})})}),r(Dt,[mt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,N[d]=k>N[d]?k:N[d],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),A-=(d>0?y:0)+N[d];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var L;L="start"==t.packV?0:B>0?Math.floor(B/n):0;var H=0,M=t.flexWidths;if(M)for(d=0;M.length>d;d++)H+=M[d];else H=r;var D=A/H;for(d=0;r>d;d++)N[d]+=M?Math.ceil(M[d]*D):D;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+L,d=0;r>d&&(u=i[f*r+d],u);d++)m=u.settings,c=u.layoutRect(),a=N[d],T=R=0,c.x=p,c.y=h,v=m.alignH||C,"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||x,"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Pt,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes()+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e){return this.getEl().contentWindow.document.body.innerHTML=e,this}})}),r(Ot,[vt],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(e.getEl().offsetWidth>t.maxW&&(t.minW=t.maxW,e.addClass("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,e.getEl().offsetHeight)),t},disabled:function(e){var t=this,n;return e!==n&&(t.toggleClass("label-disabled",e),t._rendered&&(t.getEl()[0].className=t.classes())),t._super(e)},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&(t.getEl().innerHTML=t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'<label id="'+e._id+'" class="'+e.classes()+'"'+(t?' for="'+t:"")+'">'+e.encode(e._text)+"</label>"}})}),r(It,[U,X],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(Ft,[It],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(Wt,[yt,V,Ft],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),"bl-tl")},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+'<button id="'+t+'-open" role="presentation" tabindex="-1">'+(i?'<i class="'+i+'"></i>':"")+(e._text?(i?" ":"")+e.encode(e._text):"")+' <i class="'+r+'caret"></i>'+"</button>"+"</div>"},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&n.showMenu())}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").childNodes,n=0;r.length>n;n++)3==r[n].nodeType&&(r[n].data=t.encode(e));return this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[Wt],function(e){return e.extend({init:function(e){var t=this,n,r,i,o,a;if(t._values=n=e.values,n){for(r=0;n.length>r;r++)i=n[r].selected||e.value===n[r].value,i&&(o=o||n[r].text,t._value=n[r].value);e.menu=n}e.text=e.text||o||n[0].text,t._super(e),t.addClass("listbox"),t.on("select",function(n){var r=n.control;a&&(n.lastControl=a),e.multiple?r.active(!r.active()):t.value(n.control.settings.value),a=r})},value:function(e){function n(e,t){e.items().each(function(e){i=e.value()===t,i&&(o=o||e.text()),e.active(i),e.menu&&n(e.menu,t)})}var r=this,i,o,a,s;if(e!==t){if(r.menu)n(r.menu,e);else for(a=r.settings.menu,s=0;a.length>s;s++)i=a[s].value==e,i&&(o=o||a[s].text),a[s].active=i;r.text(o)}return r._super(e)}})}),r(Vt,[vt,V],function(e,t){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this;t.hasPopup=!0,t._super(e),e=t.settings,t.addClass("menu-item"),e.menu&&t.addClass("menu-item-expand"),("-"===t._text||"|"===t._text)&&(t.addClass("menu-item-sep"),t.aria("role","separator"),t.canFocus=!1,t._text="-"),e.selectable&&(t.aria("role","menuitemcheckbox"),t.aria("checked",!0),t.addClass("menu-item-checkbox"),e.icon="selected"),t.on("mousedown",function(e){e.preventDefault()}),t.on("mouseenter click",function(n){n.control===t&&(e.menu||"click"!==n.type?(t.showMenu(),n.keyboard&&setTimeout(function(){t.menu.items()[0].focus()},0)):(t.parent().hideAll(),t.fire("cancel"),t.fire("select")))}),e.menu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r;e.parent().items().each(function(t){t!==e&&t.hideMenu()}),n.menu&&(e.menu?e.menu.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.menu.reflow(),e.menu.fire("show"),e.menu.on("cancel",function(){e.focus()}),e.menu.on("hide",function(t){t.control===e.menu&&e.removeClass("selected")})),e.menu._parentMenu=e.parent(),e.menu.addClass("menu-sub"),e.menu.moveRel(e.getEl(),"tr-tl"),e.addClass("selected"),e.aria("expanded",!0))},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.encode(e._text),o=e.settings.icon;return o&&e.parent().addClass("menu-has-icons"),o=r+"ico "+r+"i-"+(e.settings.icon||"none"),'<div id="'+t+'" class="'+e.classes()+'" tabindex="-1">'+("-"!==i?'<i class="'+o+'"></i>&nbsp;':"")+("-"!==i?'<span id="'+t+'-text" class="'+r+'text">'+i+"</span>":"")+(n.shortcut?'<div id="'+t+'-shortcut" class="'+r+'menu-shortcut">'+n.shortcut+"</div>":"")+(n.menu?'<div class="'+r+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n()),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[Y,X,Vt],function(e,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var t=this;e.autohide=!0,t._super(e),t.addClass("menu"),t.keyNav=new n({root:t,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){t.parent()instanceof r&&t.keyNav.cancel()},onCancel:function(){t.fire("cancel",{},!1),t.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(n){var r=n.settings;return r.icon||r.selectable?(e._hasIcons=!0,!1):t}),e._super()}});return i}),r(qt,[vt],function(e){return e.extend({Defaults:{classes:"radio",checked:!1},init:function(e){var t=this;t._super(e),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked()||(t.parent().items().filter("radio:checked").exec("checked",!1),t.checked(!0))}),t.checked(e.checked)},checked:function(e){var n=this;return e!==t?(e?n.addClass("checked"):n.removeClass("checked"),n._checked=e,n):n._checked},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes()+'" role="radio" unselectable="on">'+'<i class="'+n+"ico "+n+'radio"></i>'+e._text+"</div>"}})}),r($t,[U],function(e){return e.extend({})}),r(jt,[vt,q,W],function(e,t,n){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),e.settings.both&&e.addClass("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){function e(e){return{width:e.clientWidth,height:e.clientHeight}}function r(t,r){var o,s,l,c,u=a.settings;o=a.getContainer(),s=a.getContentAreaContainer().firstChild,l=e(o),c=e(s),t=Math.max(u.min_width||100,t),r=Math.max(u.min_height||100,r),t=Math.min(u.max_width||65535,t),r=Math.min(u.max_height||65535,r),i.settings.both&&n.css(o,"width",t+(l.width-c.width)),n.css(o,"height",r+(l.height-c.height)),i.settings.both&&n.css(s,"width",t),n.css(s,"height",r),a.fire("ResizeEditor")}var i=this,o,a=i.settings.editor;i._super(),i.resizeDragHelper=new t(this._id,{start:function(){o=e(a.getContentAreaContainer().firstChild)},drag:function(e){r(o.width+e.deltaX,o.height+e.deltaY)},end:function(){}})}})}),r(Kt,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes()+'"></div>'}})}),r(Gt,[Wt,g],function(e,t){var n=t.DOM;return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,t=e.getEl(),r=e.layoutRect(),i,o,a;return e._super(),i=t.firstChild,o=t.lastChild,n.css(i,{width:r.w-o.offsetWidth,height:r.h-2}),n.css(o,{height:r.h-2}),a=i.firstChild.style,a.width=a.height="100%",a=o.firstChild.style,a.width=a.height="100%",e},activeMenu:function(e){var t=this;n.toggleClass(t.getEl().lastChild,t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'<div id="'+t+'" class="'+e.classes()+'">'+'<button hidefocus tabindex="-1">'+(r?'<i class="'+r+'"></i>':"")+(e._text?(r?" ":"")+e._text:"")+"</button>"+'<button class="'+n+'open" hidefocus tabindex="-1">'+(e._menuBtnText?(r?" ":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i>'+"</button>"+"</div>"},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){e.control!=this||n.getParent(e.target,"."+this.classPrefix+"open")||(e.stopImmediatePropagation(),t.call(this,e))}),delete e.settings.onclick,e._super()}})}),r(Yt,[Ht],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Xt,[j,W],function(e,t){"use stict";return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='<div id="'+e._id+"-t"+i+'" class="'+r+'tab" unselectable="on">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes()+'" hideFocus="1" tabIndex="-1">'+'<div id="'+e._id+'-head" class="'+r+'tabs">'+n+"</div>"+'<div id="'+e._id+'-body" class="'+e.classes("body")+'">'+t.renderHtml(e)+"</div>"+"</div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,n,r;n=r=0,e.items().each(function(t,i){n=Math.max(n,t.layoutRect().minW),r=Math.max(r,t.layoutRect().minH),e.settings.activeTab!=i&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=n,e.settings.h=r,e.layoutRect({x:0,y:0,w:n,h:r})});var i=e.getEl("head").offsetHeight;return e.settings.minWidth=n,e.settings.minHeight=r+i,t=e._super(),t.deltaH+=e.getEl("head").offsetHeight,t.innerH=t.h-t.deltaH,t}})}),r(Jt,[vt,W],function(e,n){return e.extend({init:function(e){var n=this;n._super(e),n._value=e.value||"",n.addClass("textbox"),e.multiline?n.addClass("multiline"):n.on("keydown",function(e){13==e.keyCode&&n.parents().reverse().each(function(n){return e.preventDefault(),n.submit?(n.submit(),!1):t})})},value:function(e){var n=this;return e!==t?(n._value=e,n._rendered&&(n.getEl().value=e),n):n._rendered?n.getEl().value:n._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;return t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{},r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),n.multiline?'<textarea id="'+t+'" class="'+e.classes()+'" '+(n.rows?' rows="'+n.rows+'"':"")+' hidefocus="true"'+i+">"+r+"</textarea>":'<input id="'+t+'" class="'+e.classes()+'" value="'+r+'" hidefocus="true"'+i+">"},postRender:function(){var e=this;return n.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()}})}),r(Qt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('<div class="mce-throbber"></div>'))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,M,D,P,O,I,F,W,z,V,U,q,$,j,K,G,Y,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Lt,Ht,Mt,Dt,Pt,Ot,It,Ft,Wt,zt,Vt,Ut,qt,$t,jt,Kt,Gt,Yt,Xt,Jt,Qt])})(this);
  
1// Underscore.js 1.4.2
2// http://underscorejs.org
3// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
4// Underscore may be freely distributed under the MIT license.
5
6(function() {
7
8 // Baseline setup
9 // --------------
10
11 // Establish the root object, `window` in the browser, or `global` on the server.
12 var root = this;
13
14 // Save the previous value of the `_` variable.
15 var previousUnderscore = root._;
16
17 // Establish the object that gets returned to break out of a loop iteration.
18 var breaker = {};
19
20 // Save bytes in the minified (but not gzipped) version:
21 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
22
23 // Create quick reference variables for speed access to core prototypes.
24 var push = ArrayProto.push,
25 slice = ArrayProto.slice,
26 concat = ArrayProto.concat,
27 unshift = ArrayProto.unshift,
28 toString = ObjProto.toString,
29 hasOwnProperty = ObjProto.hasOwnProperty;
30
31 // All **ECMAScript 5** native function implementations that we hope to use
32 // are declared here.
33 var
34 nativeForEach = ArrayProto.forEach,
35 nativeMap = ArrayProto.map,
36 nativeReduce = ArrayProto.reduce,
37 nativeReduceRight = ArrayProto.reduceRight,
38 nativeFilter = ArrayProto.filter,
39 nativeEvery = ArrayProto.every,
40 nativeSome = ArrayProto.some,
41 nativeIndexOf = ArrayProto.indexOf,
42 nativeLastIndexOf = ArrayProto.lastIndexOf,
43 nativeIsArray = Array.isArray,
44 nativeKeys = Object.keys,
45 nativeBind = FuncProto.bind;
46
47 // Create a safe reference to the Underscore object for use below.
48 var _ = function(obj) {
49 if (obj instanceof _) return obj;
50 if (!(this instanceof _)) return new _(obj);
51 this._wrapped = obj;
52 };
53
54 // Export the Underscore object for **Node.js**, with
55 // backwards-compatibility for the old `require()` API. If we're in
56 // the browser, add `_` as a global object via a string identifier,
57 // for Closure Compiler "advanced" mode.
58 if (typeof exports !== 'undefined') {
59 if (typeof module !== 'undefined' && module.exports) {
60 exports = module.exports = _;
61 }
62 exports._ = _;
63 } else {
64 root['_'] = _;
65 }
66
67 // Current version.
68 _.VERSION = '1.4.2';
69
70 // Collection Functions
71 // --------------------
72
73 // The cornerstone, an `each` implementation, aka `forEach`.
74 // Handles objects with the built-in `forEach`, arrays, and raw objects.
75 // Delegates to **ECMAScript 5**'s native `forEach` if available.
76 var each = _.each = _.forEach = function(obj, iterator, context) {
77 if (obj == null) return;
78 if (nativeForEach && obj.forEach === nativeForEach) {
79 obj.forEach(iterator, context);
80 } else if (obj.length === +obj.length) {
81 for (var i = 0, l = obj.length; i < l; i++) {
82 if (iterator.call(context, obj[i], i, obj) === breaker) return;
83 }
84 } else {
85 for (var key in obj) {
86 if (_.has(obj, key)) {
87 if (iterator.call(context, obj[key], key, obj) === breaker) return;
88 }
89 }
90 }
91 };
92
93 // Return the results of applying the iterator to each element.
94 // Delegates to **ECMAScript 5**'s native `map` if available.
95 _.map = _.collect = function(obj, iterator, context) {
96 var results = [];
97 if (obj == null) return results;
98 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
99 each(obj, function(value, index, list) {
100 results[results.length] = iterator.call(context, value, index, list);
101 });
102 return results;
103 };
104
105 // **Reduce** builds up a single result from a list of values, aka `inject`,
106 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
107 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
108 var initial = arguments.length > 2;
109 if (obj == null) obj = [];
110 if (nativeReduce && obj.reduce === nativeReduce) {
111 if (context) iterator = _.bind(iterator, context);
112 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
113 }
114 each(obj, function(value, index, list) {
115 if (!initial) {
116 memo = value;
117 initial = true;
118 } else {
119 memo = iterator.call(context, memo, value, index, list);
120 }
121 });
122 if (!initial) throw new TypeError('Reduce of empty array with no initial value');
123 return memo;
124 };
125
126 // The right-associative version of reduce, also known as `foldr`.
127 // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
128 _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
129 var initial = arguments.length > 2;
130 if (obj == null) obj = [];
131 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
132 if (context) iterator = _.bind(iterator, context);
133 return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
134 }
135 var length = obj.length;
136 if (length !== +length) {
137 var keys = _.keys(obj);
138 length = keys.length;
139 }
140 each(obj, function(value, index, list) {
141 index = keys ? keys[--length] : --length;
142 if (!initial) {
143 memo = obj[index];
144 initial = true;
145 } else {
146 memo = iterator.call(context, memo, obj[index], index, list);
147 }
148 });
149 if (!initial) throw new TypeError('Reduce of empty array with no initial value');
150 return memo;
151 };
152
153 // Return the first value which passes a truth test. Aliased as `detect`.
154 _.find = _.detect = function(obj, iterator, context) {
155 var result;
156 any(obj, function(value, index, list) {
157 if (iterator.call(context, value, index, list)) {
158 result = value;
159 return true;
160 }
161 });
162 return result;
163 };
164
165 // Return all the elements that pass a truth test.
166 // Delegates to **ECMAScript 5**'s native `filter` if available.
167 // Aliased as `select`.
168 _.filter = _.select = function(obj, iterator, context) {
169 var results = [];
170 if (obj == null) return results;
171 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
172 each(obj, function(value, index, list) {
173 if (iterator.call(context, value, index, list)) results[results.length] = value;
174 });
175 return results;
176 };
177
178 // Return all the elements for which a truth test fails.
179 _.reject = function(obj, iterator, context) {
180 var results = [];
181 if (obj == null) return results;
182 each(obj, function(value, index, list) {
183 if (!iterator.call(context, value, index, list)) results[results.length] = value;
184 });
185 return results;
186 };
187
188 // Determine whether all of the elements match a truth test.
189 // Delegates to **ECMAScript 5**'s native `every` if available.
190 // Aliased as `all`.
191 _.every = _.all = function(obj, iterator, context) {
192 iterator || (iterator = _.identity);
193 var result = true;
194 if (obj == null) return result;
195 if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
196 each(obj, function(value, index, list) {
197 if (!(result = result && iterator.call(context, value, index, list))) return breaker;
198 });
199 return !!result;
200 };
201
202 // Determine if at least one element in the object matches a truth test.
203 // Delegates to **ECMAScript 5**'s native `some` if available.
204 // Aliased as `any`.
205 var any = _.some = _.any = function(obj, iterator, context) {
206 iterator || (iterator = _.identity);
207 var result = false;
208 if (obj == null) return result;
209 if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
210 each(obj, function(value, index, list) {
211 if (result || (result = iterator.call(context, value, index, list))) return breaker;
212 });
213 return !!result;
214 };
215
216 // Determine if the array or object contains a given value (using `===`).
217 // Aliased as `include`.
218 _.contains = _.include = function(obj, target) {
219 var found = false;
220 if (obj == null) return found;
221 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
222 found = any(obj, function(value) {
223 return value === target;
224 });
225 return found;
226 };
227
228 // Invoke a method (with arguments) on every item in a collection.
229 _.invoke = function(obj, method) {
230 var args = slice.call(arguments, 2);
231 return _.map(obj, function(value) {
232 return (_.isFunction(method) ? method : value[method]).apply(value, args);
233 });
234 };
235
236 // Convenience version of a common use case of `map`: fetching a property.
237 _.pluck = function(obj, key) {
238 return _.map(obj, function(value){ return value[key]; });
239 };
240
241 // Convenience version of a common use case of `filter`: selecting only objects
242 // with specific `key:value` pairs.
243 _.where = function(obj, attrs) {
244 if (_.isEmpty(attrs)) return [];
245 return _.filter(obj, function(value) {
246 for (var key in attrs) {
247 if (attrs[key] !== value[key]) return false;
248 }
249 return true;
250 });
251 };
252
253 // Return the maximum element or (element-based computation).
254 // Can't optimize arrays of integers longer than 65,535 elements.
255 // See: https://bugs.webkit.org/show_bug.cgi?id=80797
256 _.max = function(obj, iterator, context) {
257 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
258 return Math.max.apply(Math, obj);
259 }
260 if (!iterator && _.isEmpty(obj)) return -Infinity;
261 var result = {computed : -Infinity};
262 each(obj, function(value, index, list) {
263 var computed = iterator ? iterator.call(context, value, index, list) : value;
264 computed >= result.computed && (result = {value : value, computed : computed});
265 });
266 return result.value;
267 };
268
269 // Return the minimum element (or element-based computation).
270 _.min = function(obj, iterator, context) {
271 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
272 return Math.min.apply(Math, obj);
273 }
274 if (!iterator && _.isEmpty(obj)) return Infinity;
275 var result = {computed : Infinity};
276 each(obj, function(value, index, list) {
277 var computed = iterator ? iterator.call(context, value, index, list) : value;
278 computed < result.computed && (result = {value : value, computed : computed});
279 });
280 return result.value;
281 };
282
283 // Shuffle an array.
284 _.shuffle = function(obj) {
285 var rand;
286 var index = 0;
287 var shuffled = [];
288 each(obj, function(value) {
289 rand = _.random(index++);
290 shuffled[index - 1] = shuffled[rand];
291 shuffled[rand] = value;
292 });
293 return shuffled;
294 };
295
296 // An internal function to generate lookup iterators.
297 var lookupIterator = function(value) {
298 return _.isFunction(value) ? value : function(obj){ return obj[value]; };
299 };
300
301 // Sort the object's values by a criterion produced by an iterator.
302 _.sortBy = function(obj, value, context) {
303 var iterator = lookupIterator(value);
304 return _.pluck(_.map(obj, function(value, index, list) {
305 return {
306 value : value,
307 index : index,
308 criteria : iterator.call(context, value, index, list)
309 };
310 }).sort(function(left, right) {
311 var a = left.criteria;
312 var b = right.criteria;
313 if (a !== b) {
314 if (a > b || a === void 0) return 1;
315 if (a < b || b === void 0) return -1;
316 }
317 return left.index < right.index ? -1 : 1;
318 }), 'value');
319 };
320
321 // An internal function used for aggregate "group by" operations.
322 var group = function(obj, value, context, behavior) {
323 var result = {};
324 var iterator = lookupIterator(value);
325 each(obj, function(value, index) {
326 var key = iterator.call(context, value, index, obj);
327 behavior(result, key, value);
328 });
329 return result;
330 };
331
332 // Groups the object's values by a criterion. Pass either a string attribute
333 // to group by, or a function that returns the criterion.
334 _.groupBy = function(obj, value, context) {
335 return group(obj, value, context, function(result, key, value) {
336 (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
337 });
338 };
339
340 // Counts instances of an object that group by a certain criterion. Pass
341 // either a string attribute to count by, or a function that returns the
342 // criterion.
343 _.countBy = function(obj, value, context) {
344 return group(obj, value, context, function(result, key, value) {
345 if (!_.has(result, key)) result[key] = 0;
346 result[key]++;
347 });
348 };
349
350 // Use a comparator function to figure out the smallest index at which
351 // an object should be inserted so as to maintain order. Uses binary search.
352 _.sortedIndex = function(array, obj, iterator, context) {
353 iterator = iterator == null ? _.identity : lookupIterator(iterator);
354 var value = iterator.call(context, obj);
355 var low = 0, high = array.length;
356 while (low < high) {
357 var mid = (low + high) >>> 1;
358 iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
359 }
360 return low;
361 };
362
363 // Safely convert anything iterable into a real, live array.
364 _.toArray = function(obj) {
365 if (!obj) return [];
366 if (obj.length === +obj.length) return slice.call(obj);
367 return _.values(obj);
368 };
369
370 // Return the number of elements in an object.
371 _.size = function(obj) {
372 return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
373 };
374
375 // Array Functions
376 // ---------------
377
378 // Get the first element of an array. Passing **n** will return the first N
379 // values in the array. Aliased as `head` and `take`. The **guard** check
380 // allows it to work with `_.map`.
381 _.first = _.head = _.take = function(array, n, guard) {
382 return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
383 };
384
385 // Returns everything but the last entry of the array. Especially useful on
386 // the arguments object. Passing **n** will return all the values in
387 // the array, excluding the last N. The **guard** check allows it to work with
388 // `_.map`.
389 _.initial = function(array, n, guard) {
390 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
391 };
392
393 // Get the last element of an array. Passing **n** will return the last N
394 // values in the array. The **guard** check allows it to work with `_.map`.
395 _.last = function(array, n, guard) {
396 if ((n != null) && !guard) {
397 return slice.call(array, Math.max(array.length - n, 0));
398 } else {
399 return array[array.length - 1];
400 }
401 };
402
403 // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
404 // Especially useful on the arguments object. Passing an **n** will return
405 // the rest N values in the array. The **guard**
406 // check allows it to work with `_.map`.
407 _.rest = _.tail = _.drop = function(array, n, guard) {
408 return slice.call(array, (n == null) || guard ? 1 : n);
409 };
410
411 // Trim out all falsy values from an array.
412 _.compact = function(array) {
413 return _.filter(array, function(value){ return !!value; });
414 };
415
416 // Internal implementation of a recursive `flatten` function.
417 var flatten = function(input, shallow, output) {
418 each(input, function(value) {
419 if (_.isArray(value)) {
420 shallow ? push.apply(output, value) : flatten(value, shallow, output);
421 } else {
422 output.push(value);
423 }
424 });
425 return output;
426 };
427
428 // Return a completely flattened version of an array.
429 _.flatten = function(array, shallow) {
430 return flatten(array, shallow, []);
431 };
432
433 // Return a version of the array that does not contain the specified value(s).
434 _.without = function(array) {
435 return _.difference(array, slice.call(arguments, 1));
436 };
437
438 // Produce a duplicate-free version of the array. If the array has already
439 // been sorted, you have the option of using a faster algorithm.
440 // Aliased as `unique`.
441 _.uniq = _.unique = function(array, isSorted, iterator, context) {
442 var initial = iterator ? _.map(array, iterator, context) : array;
443 var results = [];
444 var seen = [];
445 each(initial, function(value, index) {
446 if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
447 seen.push(value);
448 results.push(array[index]);
449 }
450 });
451 return results;
452 };
453
454 // Produce an array that contains the union: each distinct element from all of
455 // the passed-in arrays.
456 _.union = function() {
457 return _.uniq(concat.apply(ArrayProto, arguments));
458 };
459
460 // Produce an array that contains every item shared between all the
461 // passed-in arrays.
462 _.intersection = function(array) {
463 var rest = slice.call(arguments, 1);
464 return _.filter(_.uniq(array), function(item) {
465 return _.every(rest, function(other) {
466 return _.indexOf(other, item) >= 0;
467 });
468 });
469 };
470
471 // Take the difference between one array and a number of other arrays.
472 // Only the elements present in just the first array will remain.
473 _.difference = function(array) {
474 var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
475 return _.filter(array, function(value){ return !_.contains(rest, value); });
476 };
477
478 // Zip together multiple lists into a single array -- elements that share
479 // an index go together.
480 _.zip = function() {
481 var args = slice.call(arguments);
482 var length = _.max(_.pluck(args, 'length'));
483 var results = new Array(length);
484 for (var i = 0; i < length; i++) {
485 results[i] = _.pluck(args, "" + i);
486 }
487 return results;
488 };
489
490 // Converts lists into objects. Pass either a single array of `[key, value]`
491 // pairs, or two parallel arrays of the same length -- one of keys, and one of
492 // the corresponding values.
493 _.object = function(list, values) {
494 var result = {};
495 for (var i = 0, l = list.length; i < l; i++) {
496 if (values) {
497 result[list[i]] = values[i];
498 } else {
499 result[list[i][0]] = list[i][1];
500 }
501 }
502 return result;
503 };
504
505 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
506 // we need this function. Return the position of the first occurrence of an
507 // item in an array, or -1 if the item is not included in the array.
508 // Delegates to **ECMAScript 5**'s native `indexOf` if available.
509 // If the array is large and already in sort order, pass `true`
510 // for **isSorted** to use binary search.
511 _.indexOf = function(array, item, isSorted) {
512 if (array == null) return -1;
513 var i = 0, l = array.length;
514 if (isSorted) {
515 if (typeof isSorted == 'number') {
516 i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
517 } else {
518 i = _.sortedIndex(array, item);
519 return array[i] === item ? i : -1;
520 }
521 }
522 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
523 for (; i < l; i++) if (array[i] === item) return i;
524 return -1;
525 };
526
527 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
528 _.lastIndexOf = function(array, item, from) {
529 if (array == null) return -1;
530 var hasIndex = from != null;
531 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
532 return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
533 }
534 var i = (hasIndex ? from : array.length);
535 while (i--) if (array[i] === item) return i;
536 return -1;
537 };
538
539 // Generate an integer Array containing an arithmetic progression. A port of
540 // the native Python `range()` function. See
541 // [the Python documentation](http://docs.python.org/library/functions.html#range).
542 _.range = function(start, stop, step) {
543 if (arguments.length <= 1) {
544 stop = start || 0;
545 start = 0;
546 }
547 step = arguments[2] || 1;
548
549 var len = Math.max(Math.ceil((stop - start) / step), 0);
550 var idx = 0;
551 var range = new Array(len);
552
553 while(idx < len) {
554 range[idx++] = start;
555 start += step;
556 }
557
558 return range;
559 };
560
561 // Function (ahem) Functions
562 // ------------------
563
564 // Reusable constructor function for prototype setting.
565 var ctor = function(){};
566
567 // Create a function bound to a given object (assigning `this`, and arguments,
568 // optionally). Binding with arguments is also known as `curry`.
569 // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
570 // We check for `func.bind` first, to fail fast when `func` is undefined.
571 _.bind = function bind(func, context) {
572 var bound, args;
573 if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
574 if (!_.isFunction(func)) throw new TypeError;
575 args = slice.call(arguments, 2);
576 return bound = function() {
577 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
578 ctor.prototype = func.prototype;
579 var self = new ctor;
580 var result = func.apply(self, args.concat(slice.call(arguments)));
581 if (Object(result) === result) return result;
582 return self;
583 };
584 };
585
586 // Bind all of an object's methods to that object. Useful for ensuring that
587 // all callbacks defined on an object belong to it.
588 _.bindAll = function(obj) {
589 var funcs = slice.call(arguments, 1);
590 if (funcs.length == 0) funcs = _.functions(obj);
591 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
592 return obj;
593 };
594
595 // Memoize an expensive function by storing its results.
596 _.memoize = function(func, hasher) {
597 var memo = {};
598 hasher || (hasher = _.identity);
599 return function() {
600 var key = hasher.apply(this, arguments);
601 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
602 };
603 };
604
605 // Delays a function for the given number of milliseconds, and then calls
606 // it with the arguments supplied.
607 _.delay = function(func, wait) {
608 var args = slice.call(arguments, 2);
609 return setTimeout(function(){ return func.apply(null, args); }, wait);
610 };
611
612 // Defers a function, scheduling it to run after the current call stack has
613 // cleared.
614 _.defer = function(func) {
615 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
616 };
617
618 // Returns a function, that, when invoked, will only be triggered at most once
619 // during a given window of time.
620 _.throttle = function(func, wait) {
621 var context, args, timeout, throttling, more, result;
622 var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
623 return function() {
624 context = this; args = arguments;
625 var later = function() {
626 timeout = null;
627 if (more) {
628 result = func.apply(context, args);
629 }
630 whenDone();
631 };
632 if (!timeout) timeout = setTimeout(later, wait);
633 if (throttling) {
634 more = true;
635 } else {
636 throttling = true;
637 result = func.apply(context, args);
638 }
639 whenDone();
640 return result;
641 };
642 };
643
644 // Returns a function, that, as long as it continues to be invoked, will not
645 // be triggered. The function will be called after it stops being called for
646 // N milliseconds. If `immediate` is passed, trigger the function on the
647 // leading edge, instead of the trailing.
648 _.debounce = function(func, wait, immediate) {
649 var timeout, result;
650 return function() {
651 var context = this, args = arguments;
652 var later = function() {
653 timeout = null;
654 if (!immediate) result = func.apply(context, args);
655 };
656 var callNow = immediate && !timeout;
657 clearTimeout(timeout);
658 timeout = setTimeout(later, wait);
659 if (callNow) result = func.apply(context, args);
660 return result;
661 };
662 };
663
664 // Returns a function that will be executed at most one time, no matter how
665 // often you call it. Useful for lazy initialization.
666 _.once = function(func) {
667 var ran = false, memo;
668 return function() {
669 if (ran) return memo;
670 ran = true;
671 memo = func.apply(this, arguments);
672 func = null;
673 return memo;
674 };
675 };
676
677 // Returns the first function passed as an argument to the second,
678 // allowing you to adjust arguments, run code before and after, and
679 // conditionally execute the original function.
680 _.wrap = function(func, wrapper) {
681 return function() {
682 var args = [func];
683 push.apply(args, arguments);
684 return wrapper.apply(this, args);
685 };
686 };
687
688 // Returns a function that is the composition of a list of functions, each
689 // consuming the return value of the function that follows.
690 _.compose = function() {
691 var funcs = arguments;
692 return function() {
693 var args = arguments;
694 for (var i = funcs.length - 1; i >= 0; i--) {
695 args = [funcs[i].apply(this, args)];
696 }
697 return args[0];
698 };
699 };
700
701 // Returns a function that will only be executed after being called N times.
702 _.after = function(times, func) {
703 if (times <= 0) return func();
704 return function() {
705 if (--times < 1) {
706 return func.apply(this, arguments);
707 }
708 };
709 };
710
711 // Object Functions
712 // ----------------
713
714 // Retrieve the names of an object's properties.
715 // Delegates to **ECMAScript 5**'s native `Object.keys`
716 _.keys = nativeKeys || function(obj) {
717 if (obj !== Object(obj)) throw new TypeError('Invalid object');
718 var keys = [];
719 for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
720 return keys;
721 };
722
723 // Retrieve the values of an object's properties.
724 _.values = function(obj) {
725 var values = [];
726 for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
727 return values;
728 };
729
730 // Convert an object into a list of `[key, value]` pairs.
731 _.pairs = function(obj) {
732 var pairs = [];
733 for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
734 return pairs;
735 };
736
737 // Invert the keys and values of an object. The values must be serializable.
738 _.invert = function(obj) {
739 var result = {};
740 for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
741 return result;
742 };
743
744 // Return a sorted list of the function names available on the object.
745 // Aliased as `methods`
746 _.functions = _.methods = function(obj) {
747 var names = [];
748 for (var key in obj) {
749 if (_.isFunction(obj[key])) names.push(key);
750 }
751 return names.sort();
752 };
753
754 // Extend a given object with all the properties in passed-in object(s).
755 _.extend = function(obj) {
756 each(slice.call(arguments, 1), function(source) {
757 for (var prop in source) {
758 obj[prop] = source[prop];
759 }
760 });
761 return obj;
762 };
763
764 // Return a copy of the object only containing the whitelisted properties.
765 _.pick = function(obj) {
766 var copy = {};
767 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
768 each(keys, function(key) {
769 if (key in obj) copy[key] = obj[key];
770 });
771 return copy;
772 };
773
774 // Return a copy of the object without the blacklisted properties.
775 _.omit = function(obj) {
776 var copy = {};
777 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
778 for (var key in obj) {
779 if (!_.contains(keys, key)) copy[key] = obj[key];
780 }
781 return copy;
782 };
783
784 // Fill in a given object with default properties.
785 _.defaults = function(obj) {
786 each(slice.call(arguments, 1), function(source) {
787 for (var prop in source) {
788 if (obj[prop] == null) obj[prop] = source[prop];
789 }
790 });
791 return obj;
792 };
793
794 // Create a (shallow-cloned) duplicate of an object.
795 _.clone = function(obj) {
796 if (!_.isObject(obj)) return obj;
797 return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
798 };
799
800 // Invokes interceptor with the obj, and then returns obj.
801 // The primary purpose of this method is to "tap into" a method chain, in
802 // order to perform operations on intermediate results within the chain.
803 _.tap = function(obj, interceptor) {
804 interceptor(obj);
805 return obj;
806 };
807
808 // Internal recursive comparison function for `isEqual`.
809 var eq = function(a, b, aStack, bStack) {
810 // Identical objects are equal. `0 === -0`, but they aren't identical.
811 // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
812 if (a === b) return a !== 0 || 1 / a == 1 / b;
813 // A strict comparison is necessary because `null == undefined`.
814 if (a == null || b == null) return a === b;
815 // Unwrap any wrapped objects.
816 if (a instanceof _) a = a._wrapped;
817 if (b instanceof _) b = b._wrapped;
818 // Compare `[[Class]]` names.
819 var className = toString.call(a);
820 if (className != toString.call(b)) return false;
821 switch (className) {
822 // Strings, numbers, dates, and booleans are compared by value.
823 case '[object String]':
824 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
825 // equivalent to `new String("5")`.
826 return a == String(b);
827 case '[object Number]':
828 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
829 // other numeric values.
830 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
831 case '[object Date]':
832 case '[object Boolean]':
833 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
834 // millisecond representations. Note that invalid dates with millisecond representations
835 // of `NaN` are not equivalent.
836 return +a == +b;
837 // RegExps are compared by their source patterns and flags.
838 case '[object RegExp]':
839 return a.source == b.source &&
840 a.global == b.global &&
841 a.multiline == b.multiline &&
842 a.ignoreCase == b.ignoreCase;
843 }
844 if (typeof a != 'object' || typeof b != 'object') return false;
845 // Assume equality for cyclic structures. The algorithm for detecting cyclic
846 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
847 var length = aStack.length;
848 while (length--) {
849 // Linear search. Performance is inversely proportional to the number of
850 // unique nested structures.
851 if (aStack[length] == a) return bStack[length] == b;
852 }
853 // Add the first object to the stack of traversed objects.
854 aStack.push(a);
855 bStack.push(b);
856 var size = 0, result = true;
857 // Recursively compare objects and arrays.
858 if (className == '[object Array]') {
859 // Compare array lengths to determine if a deep comparison is necessary.
860 size = a.length;
861 result = size == b.length;
862 if (result) {
863 // Deep compare the contents, ignoring non-numeric properties.
864 while (size--) {
865 if (!(result = eq(a[size], b[size], aStack, bStack))) break;
866 }
867 }
868 } else {
869 // Objects with different constructors are not equivalent, but `Object`s
870 // from different frames are.
871 var aCtor = a.constructor, bCtor = b.constructor;
872 if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
873 _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
874 return false;
875 }
876 // Deep compare objects.
877 for (var key in a) {
878 if (_.has(a, key)) {
879 // Count the expected number of properties.
880 size++;
881 // Deep compare each member.
882 if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
883 }
884 }
885 // Ensure that both objects contain the same number of properties.
886 if (result) {
887 for (key in b) {
888 if (_.has(b, key) && !(size--)) break;
889 }
890 result = !size;
891 }
892 }
893 // Remove the first object from the stack of traversed objects.
894 aStack.pop();
895 bStack.pop();
896 return result;
897 };
898
899 // Perform a deep comparison to check if two objects are equal.
900 _.isEqual = function(a, b) {
901 return eq(a, b, [], []);
902 };
903
904 // Is a given array, string, or object empty?
905 // An "empty" object has no enumerable own-properties.
906 _.isEmpty = function(obj) {
907 if (obj == null) return true;
908 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
909 for (var key in obj) if (_.has(obj, key)) return false;
910 return true;
911 };
912
913 // Is a given value a DOM element?
914 _.isElement = function(obj) {
915 return !!(obj && obj.nodeType === 1);
916 };
917
918 // Is a given value an array?
919 // Delegates to ECMA5's native Array.isArray
920 _.isArray = nativeIsArray || function(obj) {
921 return toString.call(obj) == '[object Array]';
922 };
923
924 // Is a given variable an object?
925 _.isObject = function(obj) {
926 return obj === Object(obj);
927 };
928
929 // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
930 each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
931 _['is' + name] = function(obj) {
932 return toString.call(obj) == '[object ' + name + ']';
933 };
934 });
935
936 // Define a fallback version of the method in browsers (ahem, IE), where
937 // there isn't any inspectable "Arguments" type.
938 if (!_.isArguments(arguments)) {
939 _.isArguments = function(obj) {
940 return !!(obj && _.has(obj, 'callee'));
941 };
942 }
943
944 // Optimize `isFunction` if appropriate.
945 if (typeof (/./) !== 'function') {
946 _.isFunction = function(obj) {
947 return typeof obj === 'function';
948 };
949 }
950
951 // Is a given object a finite number?
952 _.isFinite = function(obj) {
953 return _.isNumber(obj) && isFinite(obj);
954 };
955
956 // Is the given value `NaN`? (NaN is the only number which does not equal itself).
957 _.isNaN = function(obj) {
958 return _.isNumber(obj) && obj != +obj;
959 };
960
961 // Is a given value a boolean?
962 _.isBoolean = function(obj) {
963 return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
964 };
965
966 // Is a given value equal to null?
967 _.isNull = function(obj) {
968 return obj === null;
969 };
970
971 // Is a given variable undefined?
972 _.isUndefined = function(obj) {
973 return obj === void 0;
974 };
975
976 // Shortcut function for checking if an object has a given property directly
977 // on itself (in other words, not on a prototype).
978 _.has = function(obj, key) {
979 return hasOwnProperty.call(obj, key);
980 };
981
982 // Utility Functions
983 // -----------------
984
985 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
986 // previous owner. Returns a reference to the Underscore object.
987 _.noConflict = function() {
988 root._ = previousUnderscore;
989 return this;
990 };
991
992 // Keep the identity function around for default iterators.
993 _.identity = function(value) {
994 return value;
995 };
996
997 // Run a function **n** times.
998 _.times = function(n, iterator, context) {
999 for (var i = 0; i < n; i++) iterator.call(context, i);
1000 };
1001
1002 // Return a random integer between min and max (inclusive).
1003 _.random = function(min, max) {
1004 if (max == null) {
1005 max = min;
1006 min = 0;
1007 }
1008 return min + (0 | Math.random() * (max - min + 1));
1009 };
1010
1011 // List of HTML entities for escaping.
1012 var entityMap = {
1013 escape: {
1014 '&': '&amp;',
1015 '<': '&lt;',
1016 '>': '&gt;',
1017 '"': '&quot;',
1018 "'": '&#x27;',
1019 '/': '&#x2F;'
1020 }
1021 };
1022 entityMap.unescape = _.invert(entityMap.escape);
1023
1024 // Regexes containing the keys and values listed immediately above.
1025 var entityRegexes = {
1026 escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
1027 unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
1028 };
1029
1030 // Functions for escaping and unescaping strings to/from HTML interpolation.
1031 _.each(['escape', 'unescape'], function(method) {
1032 _[method] = function(string) {
1033 if (string == null) return '';
1034 return ('' + string).replace(entityRegexes[method], function(match) {
1035 return entityMap[method][match];
1036 });
1037 };
1038 });
1039
1040 // If the value of the named property is a function then invoke it;
1041 // otherwise, return it.
1042 _.result = function(object, property) {
1043 if (object == null) return null;
1044 var value = object[property];
1045 return _.isFunction(value) ? value.call(object) : value;
1046 };
1047
1048 // Add your own custom functions to the Underscore object.
1049 _.mixin = function(obj) {
1050 each(_.functions(obj), function(name){
1051 var func = _[name] = obj[name];
1052 _.prototype[name] = function() {
1053 var args = [this._wrapped];
1054 push.apply(args, arguments);
1055 return result.call(this, func.apply(_, args));
1056 };
1057 });
1058 };
1059
1060 // Generate a unique integer id (unique within the entire client session).
1061 // Useful for temporary DOM ids.
1062 var idCounter = 0;
1063 _.uniqueId = function(prefix) {
1064 var id = idCounter++;
1065 return prefix ? prefix + id : id;
1066 };
1067
1068 // By default, Underscore uses ERB-style template delimiters, change the
1069 // following template settings to use alternative delimiters.
1070 _.templateSettings = {
1071 evaluate : /<%([\s\S]+?)%>/g,
1072 interpolate : /<%=([\s\S]+?)%>/g,
1073 escape : /<%-([\s\S]+?)%>/g
1074 };
1075
1076 // When customizing `templateSettings`, if you don't want to define an
1077 // interpolation, evaluation or escaping regex, we need one that is
1078 // guaranteed not to match.
1079 var noMatch = /(.)^/;
1080
1081 // Certain characters need to be escaped so that they can be put into a
1082 // string literal.
1083 var escapes = {
1084 "'": "'",
1085 '\\': '\\',
1086 '\r': 'r',
1087 '\n': 'n',
1088 '\t': 't',
1089 '\u2028': 'u2028',
1090 '\u2029': 'u2029'
1091 };
1092
1093 var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
1094
1095 // JavaScript micro-templating, similar to John Resig's implementation.
1096 // Underscore templating handles arbitrary delimiters, preserves whitespace,
1097 // and correctly escapes quotes within interpolated code.
1098 _.template = function(text, data, settings) {
1099 settings = _.defaults({}, settings, _.templateSettings);
1100
1101 // Combine delimiters into one regular expression via alternation.
1102 var matcher = new RegExp([
1103 (settings.escape || noMatch).source,
1104 (settings.interpolate || noMatch).source,
1105 (settings.evaluate || noMatch).source
1106 ].join('|') + '|$', 'g');
1107
1108 // Compile the template source, escaping string literals appropriately.
1109 var index = 0;
1110 var source = "__p+='";
1111 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
1112 source += text.slice(index, offset)
1113 .replace(escaper, function(match) { return '\\' + escapes[match]; });
1114 source +=
1115 escape ? "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" :
1116 interpolate ? "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" :
1117 evaluate ? "';\n" + evaluate + "\n__p+='" : '';
1118 index = offset + match.length;
1119 });
1120 source += "';\n";
1121
1122 // If a variable is not specified, place data values in local scope.
1123 if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
1124
1125 source = "var __t,__p='',__j=Array.prototype.join," +
1126 "print=function(){__p+=__j.call(arguments,'');};\n" +
1127 source + "return __p;\n";
1128
1129 try {
1130 var render = new Function(settings.variable || 'obj', '_', source);
1131 } catch (e) {
1132 e.source = source;
1133 throw e;
1134 }
1135
1136 if (data) return render(data, _);
1137 var template = function(data) {
1138 return render.call(this, data, _);
1139 };
1140
1141 // Provide the compiled function source as a convenience for precompilation.
1142 template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
1143
1144 return template;
1145 };
1146
1147 // Add a "chain" function, which will delegate to the wrapper.
1148 _.chain = function(obj) {
1149 return _(obj).chain();
1150 };
1151
1152 // OOP
1153 // ---------------
1154 // If Underscore is called as a function, it returns a wrapped object that
1155 // can be used OO-style. This wrapper holds altered versions of all the
1156 // underscore functions. Wrapped objects may be chained.
1157
1158 // Helper function to continue chaining intermediate results.
1159 var result = function(obj) {
1160 return this._chain ? _(obj).chain() : obj;
1161 };
1162
1163 // Add all of the Underscore functions to the wrapper object.
1164 _.mixin(_);
1165
1166 // Add all mutator Array functions to the wrapper.
1167 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
1168 var method = ArrayProto[name];
1169 _.prototype[name] = function() {
1170 var obj = this._wrapped;
1171 method.apply(obj, arguments);
1172 if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
1173 return result.call(this, obj);
1174 };
1175 });
1176
1177 // Add all accessor Array functions to the wrapper.
1178 each(['concat', 'join', 'slice'], function(name) {
1179 var method = ArrayProto[name];
1180 _.prototype[name] = function() {
1181 return result.call(this, method.apply(this._wrapped, arguments));
1182 };
1183 });
1184
1185 _.extend(_.prototype, {
1186
1187 // Start chaining a wrapped Underscore object.
1188 chain: function() {
1189 this._chain = true;
1190 return this;
1191 },
1192
1193 // Extracts the result from a wrapped and chained object.
1194 value: function() {
1195 return this._wrapped;
1196 }
1197
1198 });
1199
1200}).call(this);